selecting message that should go into MailScanner

Martin Hepworth maxsec at
Thu Feb 12 10:55:31 GMT 2009

2009/2/12 Alessandro Dentella <sandro at>:
> Hi,
>  I need to setup one postfix + mailscanner bos so that from certain domains
>  that send massive newsletter mails are not checked: there would be no
>  point.
>  I thought to go in header_checks and change the regexp something as:
>    /^From: .*  OK
>    /^Subject: dabluff5/  OK
>    /^Received:/ HOLD
>  but I can't see any differences. I tryed it also with other patterns but it
>  seems it never gets into the first line rule (it goes of course into the
>  last: 'Received'). I wandered if the second overwrites the first as it
>  comes later in parsing the header messages.
>  Convinced to simplify my tests I used test on Subject that I can change
>  simply but I believe that that should work. Am I wrong?
>  As a second attempt I tried a recepe [1] from Hugo Vanderkooij that I
>  found in the archives thet suggests to go with the filter in the
>  smtpd_client_restrictions with a check_recipient_access, but again I can't
>  make messages go into HOLD with a rule on Subject
>  Any hints?
>  thanks
>  sandro
>  *:-)
> [1]
> --
> Sandro Dentella  *:-)
>        SQLkit home page - PyGTK/python/sqlalchemy
> --
> MailScanner mailing list
> mailscanner at
> Before posting, read
> Support MailScanner development - buy the book off the website!

Another alternative is to put this in the "Is Definitely not Spam" ruleset

That way it still gets virus/phishing/etc checked, and these are much
much less heavy than Spam Scanning.

If you divert via Postfix you're creating quite a hole in the setup
and therefore increasing the likelihood of nasty stuff getting in and
thereby increasing the risk of email that you've mitigated by putting
MailScanner in.

Martin Hepworth
Oxford, UK

More information about the MailScanner mailing list