~ubuntu-branches/ubuntu/saucy/dspam/saucy

« back to all changes in this revision

Viewing changes to src/tools/dspam_notify.in

  • Committer: Package Import Robot
  • Author(s): Thomas Preud'homme, Julien Valroff, Thomas Preud'homme
  • Date: 2012-04-22 17:46:10 UTC
  • mfrom: (8.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120422174610-m3bxpldro0e30gfw
Tags: 3.10.2+dfsg-1
[ Julien Valroff ]
* New upstream release
* Add gbp.conf to allow filtering out non DFSG-clean files when using
  git-import-orig to merge new upstream releases 
* Use definitive DEP-5 copyright format uri
* Add dspam_alias_retraining script to dspam package as example 
* Refresh and update patches 
* Use maintscript support in dh_installdeb rather than writing out
  dpkg-maintscript-helper commands by hand.  We now simply Pre-Depend on a
  new enough version of dpkg rather than using 'dpkg-maintscript-helper
  supports' guards, leading to more predictable behaviour on upgrades.
  Thanks to Colin Watson <cjwatson@ubuntu.com> (Closes: #659717)
* Add Thomas Preud'homme as uploader
* Set DM-Upload-Allowed: yes 

[ Thomas Preud'homme ]
* Remove multiarch support for libdspam7-dev as it contains an header with
  arch-specific contents (Closes: #669993).
* Build-depend on debhelper (>= 9.0.0) to match compatibility.
* Bump Standards-Version to 3.9.3 (no changes needed).
* Fix quarantine mails deletion in web frontend for spanish users
  (Closes: #673833).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl
2
2
#
3
 
# $Id: dspam_notify,v 1.05 2010/03/18 03:18:59 sbajic Exp $
 
3
# $Id: dspam_notify,v 1.06 2011/11/03 11:58:15 sbajic Exp $
4
4
 
5
5
use Net::SMTP;
6
6
 
10
10
require "/etc/dspam/dspam_notify.conf";
11
11
 
12
12
# Enter the location of you dspam.conf, dspam binary and path to dspam_admin/dspam_stats.
13
 
$DSPAMCONF = '@sysconfdir@/dspam.conf';
14
 
$DSPAM_BINARY = '@bindir@/@dspam_transformed@';
15
 
$BINDIR = '@bindir@';
 
13
$DSPAMCONF = '/etc/dspam/dspam.conf';
 
14
$DSPAM_BINARY = '/usr/bin/dspam';
 
15
$BINDIR = '/usr/bin';
16
16
 
17
17
######################################
18
18
# No need to config below this point.#
37
37
my ($SEC,$MIN,$HOUR,$MDAY,$MON,$YEAR,$WDAY,$YDAY,$ISDST) = localtime(time);
38
38
  
39
39
# Array containing Days of the week abreviations
40
 
@WEEKDAYS = ('Sun','Mon','Tue','Wed','Thur','Fri','Sat');
 
40
@WEEKDAYS = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
41
41
    
42
42
# Array containing Month abreviations
43
43
@MONTHS = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
50
50
$DAY_NUM = $MDAY; 
51
51
$YEAR += 1900;
52
52
 
53
 
$TODAY = $DAY_ABR . " " . $MONTH_ABR . " " . $DAY_NUM;
54
 
    
 
53
$TODAY = $DAY_ABR . " " . $MONTH_ABR . " " . sprintf("%2s", $DAY_NUM);
 
54
 
55
55
# Get the location of DSPAM home and if AllowOverride is set for dailyQuarantineSummary
56
56
$DSPAMHOME = "";
57
57
$ALLOW_OVERRIDE = "";
193
193
        Timeout => 30) || die ("Could not connect to SMTP server " . $SERVER . ":" . $PORT . "; $!");
194
194
for ($I = 0; $I <= $#RECIPIENT_LIST; $I++) {                                    # Loop through Recipients List and send the message
195
195
  if (@Q_TOTAL_ITEMS[$I] != 0) {                                                # Don't send reminders to users with empty quarantines
196
 
    $SMTP->mail($FROM);
 
196
    $SMTP->mail($FROM_EMAIL);
197
197
    $SMTP->to($RECIPIENT_LIST[$I]);
198
198
    $SMTP->data();
 
199
    $SMTP->datasend("From: $FROM_NAME <$FROM_EMAIL>\n");
199
200
    $SMTP->datasend("To: $RECIPIENT_LIST[$I]\n");
200
201
    $SMTP->datasend("Subject: $SUBJECT\n");
201
202
    $SMTP->datasend("Mime-Version: 1.0\n");
202
203
    $SMTP->datasend("Content-Type: text/html; charset=UTF-8\n");
 
204
    $SMTP->datasend("\n");
203
205
    $SMTP->datasend("<HTML>\n");
204
206
    $SMTP->datasend("<HEAD>\n");
205
207
    $SMTP->datasend("<TITLE>DSPAM Quarantine Summary for $RECIPIENT_LIST[$I]</TITLE>\n");