Hello Everyone,

I have a fairly complex mail server setup with 
Postfix+Clamav+DSPAM+PPolicy+Dovecot+Virtual users on a single server.

I dealing with a very strange problem

Aliases are not working on my mailing system which are coming from 
proxy:mysql:/etc/postfix/virtual_alias_maps.cf

host mail.company.com[public/dovecot-lmtp] said: 550 5.1.1
    <al...@company.com> User doesn't exist: al...@company.com (in reply to RCPT 
TO command)

But when a message comes in from the outside which goes through dspam/clamav 
then get reinjected on port 10024, which uses the /etc/dspam/dspam.d/mysql.conf 
they work perfectly.

With other words: 

1,

us...@gmail.com -> ali...@company.com

Can send letters to the ali...@company.com, it will be properly resolved to the 
users for that alias from mysql and they will all receive the letter.

2,

us...@company.com -> ali...@company.com

Can not send letters to ali...@company.com, the alias will not be looked up by 
postfix, it will try to pass on the letter to dovecot-lmtp which of course will 
say that there is no such user like "ali...@company.com" so I got the 550. This 
is a postfix problem it is crystal clear.

The SQL connection works in both cases.

When I use:

postmap -q ali...@comapny.com mysql:/etc/postfix/virtual_alias_maps.cf 

That returns the correct list of aliases.


The relevant config section is here from main.cf:

# Virtual users
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_domains = proxy:mysql:/etc/postfix/virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/virtual_mailbox_maps.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/virtual_alias_maps.cf 
proxy:mysql:/etc/postfix/rfc2142_defaults.cf
virtual_transport = lmtp:unix:public/dovecot-lmtp

This makes utterly no fucking sense to me that when a mail from the outside 
comes in to the system and goes through all sort of virus, spam filtering etc 
including the alias check it works but when the mail would go the short way 
(local drop) it doesn't.

I went all the way into tcpdumping the mysql (since we store everything there 
for the mail system (users, domains, quotas, spam training, groupware etc)).

When a mail comes in from an external domain:

1, virtual alias maps query succeeds and returns the number of addresses
2, DSPAM query (select uid from dspam_virtual_uids WHERE 
username='ali...@company.com') returns an id no
3, virtual alias maps query again 

When a mail comes in from an internal domain:

1, virtual alias maps query succeeds and returns the number of addresses

I need to solve this very quickly any help is welcome!

Thank you!

Reply via email to