Bug in Local Domains

Sandor Dobos dobos_s at IBCNET.HU
Thu Jan 31 11:00:03 GMT 2002


Hi!

The from/to addresses are case insensetive in SMTP protokoll, but
mailscanner uses it in case sensitive way.
For example if You send a mail from Your ABC.com domain, and in Local
Domains file is only abc.com, then
if Your mail is disinfected it will be sent to outer recipients in spite of
You set not to deliver from local addresses!

The same case-sensitivity problem exists with spam white list.

Patch follows


<CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT>
--- sendmail.pl.bck Mon Jan 28 12:46:10 2002
+++ sendmail.pl     Thu Jan 31 10:57:01 2002
@@ -174,8 +174,8 @@
     $from =~ s/>$//; # trailing <>
     $fromdomain = $from;
     $fromdomain =~ s/^[^@]*@//; # Delete everything up to and including
the @ sign
-    next if $Config::SpamWhiteList{"$from"} ||
-            $Config::SpamWhiteList{"$fromdomain"};
+    next if $Config::SpamWhiteList{lc "$from"} ||
+            $Config::SpamWhiteList{lc "$fromdomain"};

     # Reverse the $relay IP address
     @IPwords = split(/\./, $relay);
@@ -473,8 +473,8 @@
     if ($Clean ne 'clean') {
       # Just delete the message if it came from a local domain/address
       if (!$Config::DeliverFromLocal &&
-          ($Config::LocalDomains{"$from"} ||
-           $Config::LocalDomains{"$fromdomain"})) {
+          ($Config::LocalDomains{lc "$from"} ||
+           $Config::LocalDomains{lc "$fromdomain"})) {
         Log::WarnLog("Virus originated from Internal LAN: User is $from,
Host is $relay");
         unlink "$InQ/$hfile";
         unlink "$InQ/$dfile";
<CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT>

<CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT>
--- disinfect.pl.bck     Thu Jan 31 10:57:48 2002
+++ disinfect.pl    Thu Jan 31 10:58:12 2002
@@ -103,8 +103,8 @@
     $fromdomain = $from;
     $fromdomain =~ s/^[^@]*@//; # Delete everything up to and including
the @
     next if !$Config::DeliverFromLocal &&
-            ($Config::LocalDomains{lc "$from"} ||
-             $Config::LocalDomains{lc "$fromdomain"});
+            ($Config::LocalDomains{"$from"} ||
+             $Config::LocalDomains{"$fromdomain"});

     # Need to be in the directory containing attachments for this message
     chdir($Config::SrcDir . "/$id");
<CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT><CUT>

Dobos Sandor
IBCnet Hungary Ltd.



More information about the MailScanner mailing list