<p>The num+0 thing is to "trick" perl to always treat imthe scalar as a number.</p>
<p>I have close to no free time to look at this, but ... will try as best as I can to check this over.</p>
<p>Cheers<br>
-- <br>
-- Glenn</p>
<div class="gmail_quote">Den 17 okt 2011 18:37 skrev "--[ UxBoD ]--" <<a href="mailto:uxbod@splatnix.net">uxbod@splatnix.net</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>From what I can see it is a trivial fix. In PFDiskStore.pm around line 359 it has:<br>
<br>
printf $Tf "%15ld %15ld %15ld", $HeaderLength, $HeaderStartPos, $recipcounter;<br>
printf $Tf " %15ld", $message->{PostfixQmgrOpts}<br>
if $message->{PostfixQmgrOpts} ne "";<br>
seek $Tf, 0, 0;<br>
<br>
I believe this needs to become:<br>
<br>
printf $Tf "%15ld %15ld %15ld", $HeaderLength, $HeaderStartPos, $recipcounter;<br>
printf $Tf " %15ld", $message->{PostfixQmgrOpts}<br>
if $message->{PostfixQmgrOpts} ne "";<br>
printf $Tf " %15ld", $HeaderLength;<br>
seek $Tf, 0, 0;<br>
<br>
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:<br>
<br>
if (defined $numbers[3]) {<br>
$MailScanner::Postfix::DataStructure = 1;<br>
$message->{PostfixQmgrOpts} = $numbers[3]+0;<br>
}<br>
<br>
I have tested this and it appears to work fine. Thoughts Jules or anybody else ?<br>
--<br>
Thanks, Phil<br>
<br>
----- Original Message -----<br>
<br>
> Hello,<br>
<br>
> I am working on the MailScanner and ZendTo integration and have hit<br>
> the same problem that Markus had with respect to setting the true<br>
> message size when the content has been changed. Within<br>
> PFDiskStore.pm I see that the message size is being written plus the<br>
> data offset:<br>
<br>
> printf $Tf "%15ld %15ld %15ld", $HeaderLength, $HeaderStartPos,<br>
> $recipcounter;<br>
> printf $Tf " %15ld", $message->{PostfixQmgrOpts}<br>
> if $message->{PostfixQmgrOpts} ne "";<br>
> seek $Tf, 0, 0;<br>
<br>
> now to check these figures I stopped MailScanner, and only started up<br>
> Postfix, and then sent a message with an attachment. If the queue<br>
> file one saw:<br>
<br>
> *** ENVELOPE RECORDS 247A13580015 ***<br>
> message_size: <a href="tel:21966%20613%201%200" value="+12196661310">21966 613 1 0</a> 21966<br>
> message_arrival_time: Mon Oct 17 10:30:47 2011<br>
> create_time: Mon Oct 17 10:30:47 2011<br>
> named_attribute: rewrite_context=local<br>
<br>
> and after the file has been stripped:<br>
<br>
> *** ENVELOPE RECORDS 30E7C358026F ***<br>
> message_size: 2283 613 1 0 21966<br>
> message_arrival_time: Mon Oct 17 10:33:23 2011<br>
> create_time: Mon Oct 17 10:33:23 2011<br>
> named_attribute: rewrite_context=local<br>
<br>
> Note that the first field in message_size has been correctly reduced.<br>
> When this message then hits the remote MTA it is still being<br>
> rejected due to the size, even though we have stripped the<br>
> attachment. I believe the problem is that the final field in<br>
> message_size part of the envelope is not being updated as-well. Any<br>
> ideas what the field is ? I am struggling to find it in the Postfix<br>
> source code; and on checking Postfix.pm I see the following code has<br>
> been hashed out:<br>
<br>
> # If $5 is set then we have a new data structure in the file<br>
> $MailScanner::Postfix::DataStructure = 0;<br>
> #if ($5 ne "") {<br>
> # $MailScanner::Postfix::DataStructure = 1;<br>
> # $message->{PostfixQmgrOpts} = $5+0;<br>
> #}<br>
<br>
> Any thoughts please ?<br>
> --<br>
> Thanks, Phil<br>
<br>
> --<br>
> MailScanner mailing list<br>
> <a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a><br>
> <a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" target="_blank">http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>
<br>
> Before posting, read <a href="http://wiki.mailscanner.info/posting" target="_blank">http://wiki.mailscanner.info/posting</a><br>
<br>
> Support MailScanner development - buy the book off the website!<br>
--<br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" target="_blank">http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>
<br>
Before posting, read <a href="http://wiki.mailscanner.info/posting" target="_blank">http://wiki.mailscanner.info/posting</a><br>
<br>
Support MailScanner development - buy the book off the website!<br>
</blockquote></div>