Use &clamscan for: =spam
authorshort <>
Sat, 19 Feb 2005 16:35:55 +0000 (16:35 +0000)
committershort <>
Sat, 19 Feb 2005 16:35:55 +0000 (16:35 +0000)
PerlMail/Config.pm

index 4179565..a8b0cd6 100644 (file)
@@ -31,6 +31,7 @@ use vars qw(@ISA @EXPORT);
                $HOME
                $Mail @ValidUsers $IdleMax $MaxBodySMS @SMSwebRcpt $SMSwebRcpt_username
                $Lock_pathname $PeerAddr $Socket_timeout $DB_table $DBI_database $DBI_user $DBI_pwd
+               $clamscan_waitpid_timeout
                $sendmail_orig @addr_addon &FromAddress @h_rcpt @h_from
                %audit_profile @sms_squeezes @alternates_host @dnsbl_whitelist
 
@@ -43,7 +44,7 @@ require Mail::Alias;
 
 BEGIN {
        for (qw(headerhas store headeris did dnsbl store_muttrc_alternates Received_for parts_linear mime_type
-                       body_first mimehead spamassassin header_remap lmtp_deliver)) {
+                       body_first mimehead spamassassin clamscan header_remap lmtp_deliver)) {
                eval 'sub '.$_.' { return ::'.$_.'(@_); }';
                }
        }
@@ -80,6 +81,7 @@ our $lmtp_pwd;
        }
 our $lmtp_user_from="lace";
 our $lmtp_user_to="lacemail";
+our $clamscan_waitpid_timeout=3;
 
 
 # perlmail-submit
@@ -302,13 +304,8 @@ sub audit
                # Do not local $store_file as it is our-imported
                $store_profile="silent";
                local $_;
+               store "=spam;virus=$_"                    if $_=clamscan();
                store "=spam".($_ eq 1 ? "" : ";$_")      if $_=spamassassin();
-               };
-       $store_profile=undef();
-       return if did sub {
-               # Do not local $store_file as it is our-imported
-               $store_profile="silent";
-               local $_;
                store "=spam"                      .";$_","log" if $_=dnsbl '.relays.ordb.org.' ,1;     # all hosts
                store "=spam"                      .";$_","log" if $_=dnsbl '.blackholes.mail-abuse.org.' ,1;   # all hosts
                # we don't check all hosts as they can be "dialup" category, FIXME: check for it