Log permitted filenames

Tony Finch dot at DOTAT.AT
Thu Dec 4 12:03:07 GMT 2003


Ulysees <Ulysees at ULYSEES.COM> wrote:
>
>What I think would be really usefull would be
>Dec  2 06:55:16 $hostname MailScanner[11630]: Filename Checks: Windows/DOS
>Executable (patch.exe) in $msgid

I have a pile of patches to make tracking message-IDs possible. Here's
a selection related to file types and names...

--- SweepOther.pm       4 Jul 2003 18:08:28 -0000       1.1.1.6
+++ SweepOther.pm       7 Aug 2003 09:38:46 -0000       1.7
@@ -195,19 +196,20 @@
           $MatchFound = 1;
           if ($allowdeny eq 'deny') {
             # It's a rejection rule, so log the error.
-            MailScanner::Log::InfoLog("Filename Checks: %s (%s)",
-                                      $logtext, $attach);
+            MailScanner::Log::InfoLog("Filename Checks: %s (%s %s)",
+                                      $logtext, $id, $attach);
             $message->{namereports}{$safename} .= "$usertext ($safename)\n";
             $message->{nametypes}{$safename}   .= "f";
             $counter++;
             $message->{nameinfected}++;
           } else {
-            MailScanner::Log::InfoLog("Filename Checks: Allowing %s", $safename)
+            MailScanner::Log::InfoLog("Filename Checks: Allowing %s %s",
+                                     $id, $safename)
               if $LogNames;
           }
         }
-        MailScanner::Log::InfoLog("Filename Checks: Allowing %s " .
-                                  "(no rule matched)", $safename)
+        MailScanner::Log::InfoLog("Filename Checks: Allowing %s %s " .
+                                  "(no rule matched)", $id, $safename)
           if $LogNames && !$MatchFound;
       }
     }
@@ -348,14 +350,15 @@
         $MatchFound = 1;
         if ($allowdeny eq 'deny') {
           # It's a rejection rule, so log the error.
-          MailScanner::Log::InfoLog("Filetype Checks: %s (%s)",
-                                    $logtext, $attach);
+          MailScanner::Log::InfoLog("Filetype Checks: %s (%s %s)",
+                                    $logtext, $id, $attach);
           $message->{namereports}{$safename} .= "$usertext ($safename)\n";
           $message->{nametypes}{$safename}   .= "f";
           $counter++;
           $message->{nameinfected}++;
         } else {
-          MailScanner::Log::InfoLog("Filetype Checks: Allowing %s", $safename)
+          MailScanner::Log::InfoLog("Filetype Checks: Allowing %s %s",
+                                    $id, $safename)
             if $LogTypes;
         }
       }


Tony.
--
f.a.n.finch  <dot at dotat.at>  http://dotat.at/
THE WASH TO NORTH FORELAND: NORTHEAST 5 OR 6, PERHAPS INCREASING LOCALLY 7 FOR
A TIME, LATER VEERING EAST AND DECREASING 3 OR 4 OCCASIONALLY 5. RATHER HAZY.
MODERATE OR GOOD. MODERATE BUILDING LOCALLY ROUGH, LATER DECAYING SLIGHT TO
MODERATE.



More information about the MailScanner mailing list