Relaying mails for recipients which are not known
I have setup a Kopano server like described in the Administration Manual. We are using Active Directory for user management and Postfix for mail delivery.
The Postfix configuration looks like:
virtual_mailbox_domains = example.com
virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf, ldap:/etc/postfix/ldap-groups.cf, ldap:/etc/postfix/ldap-groups-expand.cf
virtual_transport = lmtp:127.0.0.1:2003
Now we have some users with the same domain(virtual_mailbox_domains) which are not maintained by Kopano but a other mail system on another place.
I want to to relay all mails to these users to a specific host. Does anybody know how to setup postfix for that purpose.
Hello @FoxholeCommander ,
such a configuration can be achieved with transport maps in Postfix (either queried from ldap/ad or with a static map). You basically have to map the external addresses to the external mailserver.
what exactly did you set in your main.cf? Because its more than just a one line change.
Something like the following should do the trick for you:
transport_maps = hash:/etc/postfix/transportto you main.cf and create the file with the following content:
firstname.lastname@example.org smtp:[external.mx.de] email@example.com smtp:[external.mx.de]
With every modification of the transport file you have to call
in my config it wasn`t that simple and the transport_maps parameter was just a part of the solution. Additionally I had to make a hash table in the config line virtual_mailbox_maps. So now it looks like:
virtual_mailbox_maps = ldap:/…, has:/…