BETA: Max SpamAssassin Size for sendmail and Postfix

Anthony Peacock a.peacock at
Mon Sep 11 09:26:27 IST 2006

Hi Julian,

I think this is a good solution to the issues we had been discussing. 
It allows people to leave things as they until they hit the problems 
with truncated images, and then they can look at the more sophisticated 

One typo in the comments.  In the list of options you have "truncate", 
but in the text you have "trackback".

Julian Field wrote:
> I have added the new logic to the Max SpamAssassin Size configuration 
> option, with just about all the extra features everyone wanted in here.
> # SpamAssassin is not very fast when scanning huge messages, so messages
> # bigger than this value will be truncated to this length for SpamAssassin
> # testing. The original message will not be affected by this. This value
> # is a good compromise as very few spam messages are bigger than this.
> #
> # Now for the options:
> # 1) <length of data in bytes>
> # 2) <length of data in bytes> truncate
> # 3) <length of data in bytes> continue <extra bytes allowed>
> #
> # 1) Put in a simple number.
> #    This will be the simple cut-off point for messages that are larger 
> than
> #    this number.
> # 2) Put in a number followed by 'trackback'.
> #    Once the size limit is reached, MailScanner reverses towards the start
> #    of the message, until it hits a line that is blank. The message passed
> #    to SpamAssassin is truncated there. This stops any part-images being
> #    passed to SpamAssassin, and so avoids rules which trigger on this.
> # 3) Put in a number followed by 'continue' followed by another number.
> #    Once the size limit is reached, MailScanner continues adding to the 
> data
> #    passed to SpamAssassin, until at most the 2nd number of bytes have 
> been
> #    added looking for a blank line. This tries to complete the image data
> #    that has been started when the 1st number of bytes has been reached,
> #    while imposing a limit on the amount that can be added (to avoid 
> attacks).
> #
> # If all this confuses you, just leave it alone at "40k" as that is good.
> Max SpamAssassin Size = 40k
> I have only added the logic to the sendmail and Postfix versions so far, 
> as I want to be sure it works before I give it out to everyone.
> It's on as usual.
> *Please* can you test this out for me. If you think I have gone over the 
> top, and just produced a system that no-one can work out how to use, 
> then please do tell me and I will remove bits of it again. Personally I 
> think it will only be used by 1% of users at most, which leads me to 
> think I should remove the whole thing and go back to something much 
> simpler again.
> Your thoughts?

Anthony Peacock
CHIME, Royal Free & University College Medical School
"If you have an apple and I have  an apple and we  exchange apples
then you and I will still each have  one apple. But  if you have an
idea and I have an idea and we exchange these ideas, then each of us
will have two ideas." -- George Bernard Shaw

More information about the MailScanner mailing list