Attachment stripping - wrong postfix message size

Glenn Steen glenn.steen at gmail.com
Wed Mar 24 08:58:39 GMT 2010


On 23 March 2010 17:07, Markus Nilsson <markus at markusoft.se> wrote:
> Hi again,
>
> I've done a little bit of searching around in the source, enabled some debug prints etc, and can't find anywhere that the C-record metadata read from the original queuefile is edited. Am I missing something here, or is MailScanner ignoring any changes made to the mail in respect to size, and just lets the queue file keep its original C record?
>
> I would really need my postfix instance to give a correct estimation of the message size to the receiving mailserver when starting delivert since I am stripping away any large attachments, and the mails are quite smaller after being processed by MS!
>
>
> /BR
> Markus

Hej Markus,

Well... you might be right about the size thing, I haven't revisited
that part in a while (and don't really have time to do so either,
sorry).
The thing that stikes me as somewhat odd though ... is why you would
want to do anything like this...? I've alwasy kept my "max sizes" in
sync, to the best of my ability. That way I never _need_ anything like
that, since I've already rejected any message violating the message
size limit.

That being said, it'd be a Good Thing if Jules could be persuaded to
take a look at the relevant code, or point you in the correct
direction (ie where the update of the C record is "hidden":-).

Cheers
-- 
-- Glenn

> ----- Original Message -----
> From: "Markus Nilsson" <markus at markusoft.se>
> To: mailscanner at lists.mailscanner.info
> Sent: tisdag, 23 mar 2010 10:53:07
> Subject: Attachment stripping - wrong postfix message size
>
> Hi,
>
> I'm having a problem with a custom function for attachment stripping based on total attachment size. The custom function is made for
>
> Maximum Attachment Size =
>
> I successfully return 1 if the summed size of all attachments are larger than my configured value, and -1 otherwise. The custom function also stores the attachments in a safe place for later retrieval. I then want MailScanner/postifx to deliver the stripped mail to the recipient(s). MailScanner seems to do it right, but for some reason when postfix delivers the mail to the receiving mail server, it reports the message size as it was before the stripping, so that server might reject the mail even though it really isn't that big.
>
> If I configure the mailserver to accept larger sizes, the received mail has the correct size (small, all attachments stripped), so the reported size by postfix is not correct!
>
> Does postfix somehow approximate the message size?
> If so, is it possible to help postifix with this approximization?
> Or am I completely missing something else out?
>
> Any help greatly appreciated!
>
> BR
> Markus
>
>
> --
> 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!
>



-- 
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se


More information about the MailScanner mailing list