MailScanner+Postfix virtual_maps support

Drew Marshall drew at
Fri Jul 21 20:58:50 IST 2006

On 19 Jul 2006, at 22:59, Juan Pablo Abuyeres wrote:

> I use postfix + MailScanner. My postfix configuration includes these
> lines:
> virtual_mailbox_domains = mysql:/etc/postfix/
> virtual_mailbox_base = /
> virtual_mailbox_maps = mysql:/etc/postfix/
> virtual_minimum_uid = 500
> virtual_uid_maps = mysql:/etc/postfix/
> virtual_gid_maps = mysql:/etc/postfix/
> virtual_maps = mysql:/etc/postfix/
> transport_maps = mysql:/etc/postfix/
> My MailScanner.conf file contains this line:
> Required SpamAssassin Score
> = /etc/MailScanner/rules/Tpanel.spamassassin.score.rules
> and that file contains:
> To: acct1 at 5
> To: acct2 at 4
> To: acct3 at 6
> To: everyone at 1
> To: acct4 at 4
> FromOrTo: default 6
> everyone at is really only an "alias".. it's a forward to
> other accounts like "acct1 at", "acct2 at", and
> others.
> The problem is when an email is sent to everyone at, the  
> Score
> assigned to everyone at in the ruleset is not correctly
> grabbed by MailScanner, because virtual_maps rewrites the queue files
> and replaces the destination with each email address listed in
> everyone at before MailScanner processes the queue file.
> (
> I can't use alias_maps because it's only for local transport, and I  
> need
> to use virtual.
> I was trying a 2-postfix approach, one not using virtual_maps, just to
> enqueue mails -> MailScanner -> another postfix... but it's just a  
> big-
> mess solution. I didn't like it at all.
> So, what I think would be a good solution is an option in  
> MailScanner to
> either take options from rulesets for destinations just like it is  
> doing
> now, or instead take options from rulesets taking in account  
> _original_
> destinations.
> Can anyone please give me advice on this?

Sadly there isn't really any advice to give. This is a 'design  
feature' of Postfix's virtual alias expansion. The only work round is  
to make everyone a local alias, which expands to the virtual aliases  
later e.g. everyone at => everyone at and then  
in aliases you then have everyone:	acct1 acct2 etc. You then set your  
score.rules file acordingly.

Not ideal but less messy than 2 Postfix instances.


In line with our policy, this message has 
been scanned for viruses and dangerous 
content by MailScanner, and is believed to be clean.

More information about the MailScanner mailing list