Working up to a Zimbra migration...

I would like to keep my mail gateway as the primary relay smarthost for zimbra and other domains in use. The gateway runs postifx.

I figure in addition to static maps for other domains, I can point the gateway's relay_recipient_maps at LDAP on the Zimbra server for a dynamic map. Or I could regularly export all valid recipients on the zimbra machine and place it in a map on the gateway.

I think the export is probably the way to go. It would allow the Zimbra server to go down without bouncing any mails.

It looks like the config for such a map is fortunately in /opt/zimbra/conf/

server_host = ldap://
server_port = 389
search_base =
query_filter = (&(|(zimbraMailDeliveryAddress=%s)(zimbraMailAlias=%s)(zimbraMailCatchAllAddress=%s))(zimbraMailStatus=enabled))
result_attribute = zimbraMailDeliveryAddress,zimbraMailForwardingAddress,zimbraPrefMailForwardingAddress,zimbraMailCatchAllForwardingAddress
version = 3
bind = no
timeout = 30

Which for my gateway would look something like
relay_recipient_maps = 
But to do a full recipient extract, is the following the best way to do that?

ldapsearch -H 'ldap://' -x '(&(|(zimbraMailDeliveryAddress=*)(zimbraMailAlias =*)(zimbraMailCatchAllAddress=*))(zimbraMailStatus =enabled))'