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 =
virtual_mailbox_maps = ldap:/etc/postfix/
virtual_alias_maps = ldap:/etc/postfix/, ldap:/etc/postfix/, ldap:/etc/postfix/
virtual_transport = lmtp:

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.

My goal:

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.

Hello @fbartels

do you mean with the parameter transport_maps in I tried it on my test environment yesterday but postfix is ignoring that although the parameter is set in the



Hi @FoxholeCommander,

what exactly did you set in your Because its more than just a one line change.

Something like the following should do the trick for you:

Add transport_maps = hash:/etc/postfix/transport to you and create the file with the following content: smtp:[] smtp:[]

With every modification of the transport file you have to call postmap /etc/postfix/transport.

Hello FBartels,

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:/…



I’ve a similar problem: Many users are maintained by our local Kopano server, but as many users will be maintained by an external mailserver. I don’t know all of the external users, but all of my local users are listed in ldap.
How can I configure this?

My setup: the local Kopano server maintains three domains:, and must be splited into local users (from ldap) and all other unknown users to external

Fortunately, the MX record for points to the external server, I use fetchmail to get the mails for my local users.
I removed from virtual_mailbox_domains in my postifx config, so every mail to an user * will be delieverd to the external server. Is it possible to filter the local users?

virtual_mailbox_domains =,
virtual_mailbox_maps = ldap:/etc/postfix/,hash:/etc/postfix/virtual/addresses
virtual_alias_maps = ldap:/etc/postfix/,hash:/etc/postfix/virtual/addresses
virtual_transport = lmtp:
transport_maps = ldap:/etc/postfix/,hash:/etc/postfix/transport

This does not work: /etc/postfix/

server_host = localhost 
search_base = ou=Users,dc=customerxyz,dc=local
version = 3
scope = sub
query_filter = (&(mail=%s)(kopanoAliases=%s)) 
result_attribute = mail
result_format = kopano

and /etc/postfix/transport