Postfix Message Size Wrong

--[ UxBoD ]-- uxbod at
Mon Oct 17 12:07:01 IST 2011


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 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 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 

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the MailScanner mailing list