Canonical address configuration in multi-server Zimbra

The Zimbra environment we’ve put together looks like this:
1 LDAP master
3 MTAs
6 stores

We initially installed with only mta instances on the mtas and all hosts pointing to the LDAP master.
This was of course lacking ldap consumers on the MTAs.

So a few weeks ago we upgraded to Zimbra 4.5.6 and added LDAP consumers to the MTAs. This was messy but reliable once you take your lumps and jump through the hoops in the right order. I owe a post on this topic.

Our Zimbra environment is not in production yet, it’s officially pre-production, so we use canonical addresses to make our pre-production users’ mail look to come from instead of

Immediately after adding LDAP consumers to the MTAs our pre-prod users began to complain that their mail was coming from This was prematurely releasing our fancy new which is supposed to be a surprise for some time in the fall.

So.. Zimbra uses canonical maps for the canonical address setting:

$ grep canonical /opt/zimbra/postfix/conf/
sender_canonical_maps = ldap:/opt/zimbra/conf/
$ cat /opt/zimbra/conf/
server_host = ldap://
server_port = 389
search_base = 
query_filter = (&(|(zimbraMailDeliveryAddress=%s)(zimbraMailAlias=%s)
result_attribute = zimbraMailCanonicalAddress,
version = 3
bind = no
timeout = 30

You should immediately notice that postfix is looking to the master for Canonical address rewriting. This may be a side effect of adding an LDAP consumer after the MTA was installed. Either way it’s wrong. It easily tested:

$ ldapsearch -x -h -b '' 
(zimbraMailStatus=enabled))' zimbraMailCanonicalAddress 

You should get nothing. Repeat the command with -h and you should get the canonical address you set in the admin gui.

The solution is to edit /opt/zimbra/conf/ and change
server_host to ldap://

If you tried it and it still doesn’t seem to be working, you might have zimbraPrefFromAddress set. On one of the stores:

$  zmprov ga|grep -i zimbraPrefFromAddress

Fix it by unsetting the attribute:

zmprov ma zimbraPrefFromAddress ''

It seems to take a few minutes to take effect.

This entry was posted in Messaging, Zimbra on by .

About morgan

Morgan is a freelance IT consultant living in Philadelphia. He lives with his girlfriend in an old house in Fishtown that they may never finish renovating. His focus is enterprise Messaging (think email) and Directory. Many of his customers are education, school districts and Universities. He also gets involved with most aspects of enterprise Linux and UNIX (mostly Solaris) administration, Perl, hopefully Ruby, PHP, some Java and C programming. He holds a romantic attachment to software development though he spends most of his time making software work rather than making software. He rides motorcycles both on and off the track, reads literature with vague thoughts of giving up IT to teach English literature.

Leave a Reply

Your email address will not be published. Required fields are marked *