diff -Nur --no-dereference smeserver-unjunkmgr-3.1.old/root/usr/local/unjunkmgr/spamreminder.pl smeserver-unjunkmgr-3.1/root/usr/local/unjunkmgr/spamreminder.pl --- smeserver-unjunkmgr-3.1.old/root/usr/local/unjunkmgr/spamreminder.pl 2020-11-24 05:32:46.000000000 -0500 +++ smeserver-unjunkmgr-3.1/root/usr/local/unjunkmgr/spamreminder.pl 2021-06-01 11:30:11.725000000 -0400 @@ -44,53 +44,53 @@ my %db_conf = $db->get('unjunkmgr')->props; while ( my ( $parameter, $value ) = each(%db_conf) ) { - if ( $parameter eq 'enabled' ) { - $enabled = $value; - } - if ( $parameter eq 'adminemails' and uc($value) eq 'YES' ) { - $admin_email_addr = 'admin'; + if ( $parameter eq 'enabled' ) { + $enabled = $value; + } + if ( $parameter eq 'adminemails' and uc($value) eq 'YES' ) { + $admin_email_addr = 'admin'; + } + if ( $parameter eq 'unjunkhost' ) { + $unjunkhost = $value; + } + if ( $parameter eq 'useremails' ) { + $useremails = $value; + } + +} - if ( $parameter eq 'unjunkhost' ) { - $unjunkhost = $value; - } - if ( $parameter eq 'useremails' ) { - $useremails = $value; - } - - } - - # The address from which the weekly summary comes from - my $spamfilter_addr = 'Admin Junk Summary '; +# The address from which the weekly summary comes from +my $spamfilter_addr = 'Admin Junk Summary '; - # Which stylesheet to use for the summary email - my $css_file = '/usr/local/unjunkmgr/unjunkmgr.css'; +# Which stylesheet to use for the summary email +my $css_file = '/usr/local/unjunkmgr/unjunkmgr.css'; - # Debug enabled? - will send all reports to $admin_email_addr - my $debug = 0; +# Debug enabled? - will send all reports to $admin_email_addr +my $debug = 0; ############################################################################# - # Parameters for the Junkmail Summary functionality +# Parameters for the Junkmail Summary functionality - my $root_url = sprintf( "http://%s/unjunkmgr", $unjunkhost ); +my $root_url = sprintf( "http://%s/unjunkmgr", $unjunkhost ); - my $path = "/home/e-smith/files/users/"; +my $path = "/home/e-smith/files/users/"; - my $end_path_cur = "/Maildir/.junkmail/cur"; - my $end_path_new = "/Maildir/.junkmail/new"; +my $end_path_cur = "/Maildir/.junkmail/cur"; +my $end_path_new = "/Maildir/.junkmail/new"; - my $sa_dbase = '/home/e-smith/db/configuration'; - my $dbh = esmith::ConfigDB->open($sa_dbase) +my $sa_dbase = '/home/e-smith/db/configuration'; +my $dbh = esmith::ConfigDB->open($sa_dbase) || die "Unable to open spamassassin configuration dbase."; - my %sa_conf = $dbh->get('spamassassin')->props; +my %sa_conf = $dbh->get('spamassassin')->props; - my $disabled = 0; - my $days_to_keep = 5; - my $spam_mark = 7; - my $spam_discard = 10; - - my $parameter = ""; - my $value = ""; - while ( ( $parameter, $value ) = each(%sa_conf) ) { +my $disabled = 0; +my $days_to_keep = 5; +my $spam_mark = 7; +my $spam_discard = 10; + +my $parameter = ""; +my $value = ""; +while ( ( $parameter, $value ) = each(%sa_conf) ) { if ( $parameter eq 'status' and not $value eq 'enabled' ) { $disabled = 1; } @@ -103,19 +103,19 @@ if ( $parameter eq 'RejectLevel' ) { $spam_discard = $value; } - } +} - #printf("Enabled = %s\n",$disabled); - #printf("Retention = %s\n",$days_to_keep); - #printf("TagLevel = %s\n",$spam_mark); - #printf("RejectLevel = %s\n",$spam_discard); - - if ( uc($useremails) eq 'YES' or lc($admin_email_addr) eq 'admin' ) { - Junkmail_Reminder(); - } +#printf("Enabled = %s\n",$disabled); +#printf("Retention = %s\n",$days_to_keep); +#printf("TagLevel = %s\n",$spam_mark); +#printf("RejectLevel = %s\n",$spam_discard); + +if ( uc($useremails) eq 'YES' or lc($admin_email_addr) eq 'admin' ) { + Junkmail_Reminder(); +} - #All done - exit 0; +#All done +exit 0; ############################################################################# # Subroutines ############################################################### @@ -124,7 +124,7 @@ ######################################## # Process parms # ######################################## - sub parse_arg { +sub parse_arg { my $startdate = shift; my $enddate = shift; my $secsinday = 86400; @@ -154,9 +154,9 @@ return ( $start, $end ); - } +} - sub get_email_details { +sub get_email_details { my $entry = shift; my $score; my $spam; @@ -223,14 +223,14 @@ close(ORIGINAL); return ( $subject, $from, $to, $spam_string ); - } +} ################################################################################ # The function serializes a complex datastructure into a safe and compact # single line string. ################################################################################ - sub serialize_cmd { +sub serialize_cmd { my $cmd = shift; my $out = $cmd; @@ -239,9 +239,9 @@ $out =~ s/([\;%\r\n])/sprintf("%%%02X", ord($1))/ge; return $out; - } +} - sub Junkmail_Reminder { +sub Junkmail_Reminder { my $found; my $entry; @@ -392,5 +392,5 @@ $msg->send(); } } - } +}