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