I'm using Postfix as a main MX server, connected to internet. On LAN I have MS Exchange, not accessible from internet.
Postfix works fine with virtual mailboxes, Dovecot for POP3/IMAP etc. I'm using catch-all virtual_alias_maps
- have @mydomain.cz
-> [email protected].
I want to forward mails for specific recipient addresses to Exchange server. Normally it's done with transport_maps
, but when I use catch-all virtual alias, mail is sent to [email protected] and not processed with transport_maps
.
Is it possible to use transport_maps
with catch-all virtual_alias_maps
?
Interesting parts of Postfix configuration:
transport_maps = mysql:/etc/postfix/mysql-virtual-transports.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
MySQL .cf files:
query = SELECT password FROM virtual_users WHERE email='%u' LIMIT 1
query = SELECT destination FROM virtual_aliases WHERE source='%s'
query = SELECT 1 FROM virtual_domains WHERE name='%s'
query = SELECT 1 FROM virtual_users WHERE email='%s'
table = transport
select_field = transport
where_field = domain
additional_conditions = and active = '1'
0 Answers