Postfix, mailwatch and queue IDs (and of course mailscanner:-)

Julian Field mailscanner at ecs.soton.ac.uk
Thu Nov 18 17:46:00 GMT 2004


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

The news was boring, so I wrote a patch for you instead.
Please apply the attached patch to Postfix.pm and then restart MailScanner.
Let me know how you get on.

Julian Field wrote:

> Steen, Glenn wrote:
>
>> Hi all...
>>
>> I gather from the gigantic shrug I'm getting here (how else to interpret
>> ... silence:-) that noone has a good handle on how to "improve" the
>> situation regarding duplicates in sql-logs (and possible quarantine
>> corruption) when using some such log feature with MS, due to postfix
>> reusing queue IDs
>>
> No, sorry, there's not a whole lot that can be easily done here. I guess
> I could tack the time onto the end of the message id when it is used
> inside MailScanner, just for Postfix. Then I could remove the timestamp
> again when the message is written into the outgoing queue (the
> "requeueing" code will probably do thay anyway).
>
> It would have to be a small custom patch just for you, so some payment
> would be appreciated if that's possible.
>
>> Why not ask the postfix people to "fix it"? Well, I'm guessing one will
>> get even less response (if that's possible:-) from then, and then
>> probably just a pointer to amavisd-new.
>>
>>
> A helpful response from the postfix people to a MailScanner question?
> The pigs are taxi-ing to the end of the runway as I type...
>
>> Or has this been discussed in depth already? I couldn't find mention of
>> it in the list archive...
>>
>>
> Interestingly I don't think it has come up before.
>
> --
> Julian Field
> www.MailScanner.info
> Buy the MailScanner book at www.MailScanner.info/store
> Professional Support Services at www.MailScanner.biz
> MailScanner thanks transtec Computers for their support
>
> PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
>
> ------------------------ MailScanner list ------------------------
> To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
> 'leave mailscanner' in the body of the email.
> Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
> the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
>
> Support MailScanner development - buy the book off the website!
>

--
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!

    [ Part 2: "Attached Text" ]

--- Postfix.pm.old      2004-10-14 18:56:53.000000000 +0100
+++ Postfix.pm  2004-11-18 17:43:50.000000000 +0000
@@ -237,6 +237,7 @@
     #$id =~ /^(.)(.)(.+)$/;
     #($dir1, $dir2, $file) = ($1,$2,$3);
     #return "$dir1/$dir2/$file";
+    $id =~ s/\.[^.]+$//;
     return "$id";
   }

@@ -1241,14 +1242,20 @@
           if $MailScanner::SMDiskStore::HashDirDepth == 1 &&
              $file =~ /^(.*)\/(.)\/([^\/]+)$/;
         next unless $file =~ /$mta->{HDFileRegexp}/;
-        $id = $1;
+        # Put the real message id in $idorig and the unique name in $id
+        # JKF Add a dot followed by a random number to try to get a unique
+        # JKF filename, as Postfix re-uses filenames too often.
+        my $idtemp = $1;
+        my $id = $idtemp . sprintf(".%05X", int(rand 1000000)+1);
+        my $idorig = $idtemp;

         #print STDERR "Adding $id to batch\n";

         # Lock and read the qf file. Skip this message if the lock fails.
         $newmessage = MailScanner::Message->new($id, $queuedirname);
         if ($newmessage eq 'INVALID') {
-          $invalidfiles .= "$id ";
+          #$invalidfiles .= "$id ";
+          $invalidfiles .= "$idorig ";
           next;
         }
         next unless $newmessage;

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!



More information about the MailScanner mailing list