Postfix Message Size Wrong

Glenn Steen glenn.steen at gmail.com
Tue Oct 18 09:15:34 IST 2011


Yep.
Den 18 okt 2011 09:44 skrev "--[ UxBoD ]--" <uxbod at splatnix.net>:

> Though that will also set it to zero if null though will it not Glenn ?
> --
> Thanks, Phil
>
> ----- Original Message -----
>
> > The num+0 thing is to "trick" perl to always treat imthe scalar as a
> > number.
> > I have close to no free time to look at this, but ... will try as
> > best as I can to check this over.
> > Cheers
> > --
> > -- Glenn
> > Den 17 okt 2011 18:37 skrev "--[ UxBoD ]--" < uxbod at splatnix.net >:
>
> > > >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!
> >
> > > --
> >
> > > 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!
> >
>
> > --
> > 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!
> --
> 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!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20111018/024950fc/attachment.html


More information about the MailScanner mailing list