Basic Postfix/MS question: avoid scanning mail for invalid recipients

Mauricio Tavares raubvogel at
Sat Aug 2 19:12:46 IST 2008

Dave Jenkins wrote:
> Hi,
> We have Postfix/MS/SA running on our main & backup mail servers. The
> main server is both incoming MX and outgoing, auth required. We'd like
> every mail to a valid recipient to be scanned, but don't want to waste
> CPU scanning mail to invalid recipients.
> Main MX: am I right in thinking Postfix will remove mail to invalid
> recipients before it gets to MS & so that setting MS to scan
> everything will achieve what we want?
	By default it will reject emails directed to non existent local or 
virtual users. I found that to take place quite quickly and using very 
low cpu time. You can also play with smtpd_recipient_restrictions (in to reject improperly formatted emails, which should eliminate a 
lot of spam before mailscanner is even called into action.

> Backup MX: I've written a script to turn /etc/postfix/virtusertable
> from the main MX into a valid rules file to be rsync'd to the backup
> MX's rules directory, is that a sensible approach? Does MS need to be
> restarted when the rules files are updated?
	From what I gathered, postfix first gets the mails, do whatever 
checking you tell it to do, and then makes the emails that passed those 
tests available to mailscanner, which then does its magic. So, 
virtualusertable (using virtual domains?) is internal to postfix.

> Thanks and sorry for the basic nature of the question,
	No worries. If you think yours was basic, you have not seen *mine* 
questions. ;)

> Dave
> CentOS 5.2
> postfix-2.3.3-2
> mailscanner-4.69.8-1
> spamassassin-3.1.9-1.el5

More information about the MailScanner mailing list