Fixed separated namespaces.
[PerlMail.git] / PerlMail / Config.pm
index 08aa57d..9bec452 100644 (file)
@@ -33,17 +33,20 @@ use vars qw(@ISA @EXPORT);
                $Lock_pathname $PeerAddr $Socket_timeout $DB_table $DBI_database $DBI_user $DBI_pwd
                $sendmail_orig @addr_addon &FromAddress @h_rcpt @h_from
                %audit_profile @sms_squeezes @alternates_host @dnsbl_whitelist
+
+               $Audit $is_pgp $opt_F $procmailFROM_MAILER $store_ignore $store_ignorenewmail
+               $store_profile
                );
 
 require Mail::Alias;
 
 
-sub headerhas;
-sub store;
-sub headeris;
-sub did;
-sub dnsbl;
-sub store_muttrc_alternates;
+BEGIN {
+       for (qw(headerhas store headeris did dnsbl store_muttrc_alternates Received_for parts_linear mime_type
+                       body_first mimehead razor2 header_remap)) {
+               eval 'sub '.$_.' { return ::'.$_.'(@_); }';
+               }
+       }
 
 
 # perlmail-accept & perlmail-sendmail
@@ -176,6 +179,7 @@ our $store_profile; # imported
 our $store_ignore;     # imported
 sub audit
 {
+       $store_profile=undef();
        # TODO: <short-m@> storage?
 
        # never spawn new mail if FROM_MAILER
@@ -190,7 +194,8 @@ sub audit
        # spam honeypots
        return if did sub {
                local $_;
-               local $store_profile="silent";
+               # Do not local $store_file as it is our-imported
+               $store_profile="silent";
                store "=spam"         if grep /^\Qshort\@k332.feld.cvut.cz\E/i,Received_for();
                # TODO: foreign violation of RFC 822 section 4.4.4, Subject:.*Automatick.+odpov.+v.+nep.+tomnosti
                store "=spam"         if headeris "From",'<ghandchi@hotmail.com>';
@@ -207,15 +212,19 @@ sub audit
                        }
                store "=spam"         if ($_=mimehead(body_first())->mime_attr("Content-Type.charset")) && /^big5/i;
                };
+       $store_profile=undef();
 
        # spam detection
        return if did sub {
-               local $store_profile="silent";
+               # Do not local $store_file as it is our-imported
+               $store_profile="silent";
                local $_;
                store "=spam".($_ eq 1 ? "" : ";$_")      if $_=razor2();
                };
+       $store_profile=undef();
        return if did sub {
-               local $store_profile="silent";
+               # 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
@@ -224,6 +233,7 @@ sub audit
                # I don't send viruses but viruses propagate mails of mine
                store "=spam"                                   if headeris "X-Mailer",'ravmd/8.3.2';
                };
+       $store_profile=undef();
 
        # special delivery
        store "=err","bell" and return if headerhas \&Received_for,'<short+err@>';
@@ -245,7 +255,8 @@ sub audit
 
        # nasty public lists with $store_ignore
        {
-               local $store_profile="log";
+               # Do not local $store_file as it is our-imported
+               $store_profile="log";
                local $store_ignore;
                $store_ignore="smsmail"    if 1==$Audit->body() && length(join "",$Audit->body())<180;  # SMS mail
                $store_ignore="sms OS"     if $Audit->subject()=~/^Email pro: /;        # "^Email pro: gsm@sh\.cvut\.cz$";
@@ -267,6 +278,7 @@ sub audit
                store "=9kc","log"         if headeris  "List-Post",'<n9k@pandora.cz>';
                store "=9kcd","log"        if headeris  "List-Post",'<dev9k@pandora.cz>';
                }
+       $store_profile=undef();
 
        # lists
        store "=mozillabug","log"    if headeris "From"     ,'<bugzilla-daemon@mozilla.org>';