Postfix Message Size Wrong
--[ UxBoD ]--
uxbod at splatnix.net
Mon Oct 17 17:18:28 IST 2011
>From what I can see it is a trivial fix. In PFDiskStore.pm around line 359 it has:
printf $Tf "%15ld %15ld %15ld", $HeaderLength, $HeaderStartPos, $recipcounter;
printf $Tf " %15ld", $message->{PostfixQmgrOpts}
if $message->{PostfixQmgrOpts} ne "";
seek $Tf, 0, 0;
I believe this needs to become:
printf $Tf "%15ld %15ld %15ld", $HeaderLength, $HeaderStartPos, $recipcounter;
printf $Tf " %15ld", $message->{PostfixQmgrOpts}
if $message->{PostfixQmgrOpts} ne "";
printf $Tf " %15ld", $HeaderLength;
seek $Tf, 0, 0;
This then sets the actual content length in field 5 of the queue file. I am not sure why the line above is there though as Postfix.pm always appears to set PostfixQmgrOpts to at least zero:
if (defined $numbers[3]) {
$MailScanner::Postfix::DataStructure = 1;
$message->{PostfixQmgrOpts} = $numbers[3]+0;
}
I have tested this and it appears to work fine. Thoughts Jules or anybody else ?
--
Thanks, Phil
----- Original Message -----
> Hello,
> I am working on the MailScanner and ZendTo integration and have hit
> the same problem that Markus had with respect to setting the true
> message size when the content has been changed. Within
> PFDiskStore.pm I see that the message size is being written plus the
> data offset:
> printf $Tf "%15ld %15ld %15ld", $HeaderLength, $HeaderStartPos,
> $recipcounter;
> printf $Tf " %15ld", $message->{PostfixQmgrOpts}
> if $message->{PostfixQmgrOpts} ne "";
> seek $Tf, 0, 0;
> now to check these figures I stopped MailScanner, and only started up
> Postfix, and then sent a message with an attachment. If the queue
> file one saw:
> *** ENVELOPE RECORDS 247A13580015 ***
> message_size: 21966 613 1 0 21966
> message_arrival_time: Mon Oct 17 10:30:47 2011
> create_time: Mon Oct 17 10:30:47 2011
> named_attribute: rewrite_context=local
> and after the file has been stripped:
> *** ENVELOPE RECORDS 30E7C358026F ***
> message_size: 2283 613 1 0 21966
> message_arrival_time: Mon Oct 17 10:33:23 2011
> create_time: Mon Oct 17 10:33:23 2011
> named_attribute: rewrite_context=local
> Note that the first field in message_size has been correctly reduced.
> When this message then hits the remote MTA it is still being
> rejected due to the size, even though we have stripped the
> attachment. I believe the problem is that the final field in
> message_size part of the envelope is not being updated as-well. Any
> ideas what the field is ? I am struggling to find it in the Postfix
> source code; and on checking Postfix.pm I see the following code has
> been hashed out:
> # If $5 is set then we have a new data structure in the file
> $MailScanner::Postfix::DataStructure = 0;
> #if ($5 ne "") {
> # $MailScanner::Postfix::DataStructure = 1;
> # $message->{PostfixQmgrOpts} = $5+0;
> #}
> Any thoughts please ?
> --
> Thanks, Phil
> --
> MailScanner mailing list
> mailscanner at lists.mailscanner.info
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
> Before posting, read http://wiki.mailscanner.info/posting
> Support MailScanner development - buy the book off the website!
More information about the MailScanner
mailing list