Zarafa4UCS - Forward email to an external address

I have a UCS4.1 with Zarafa4UCS installed as a member server in a Windows AD domain. I am looking for a way to forward mail for a given user to an external address. I have read in other places that this is possible in a variety of ways (either via MTA configuration, or LDAP configuration), but thought I would post here to see if there is a “best practice” way of accomplishing this in Zarafa4UCS ?

Hey,

LDAP: as far as I know there’s no out-of-the-box method of storing an external email address in the LDAP so that mails sent to the user’s primary address will be forwarded to that external address.

I usually use postfix’s virtual_alias_maps feature if the number of addresses to forward is low. Any other solution, especially ones involving LDAP; therefore I only chose that method for administrators averse to editing text files or if the number of users is high.

Using the virtual feature is easy enough. Just add an entry like “address-to-forward@mydomain external-address@external-domain” to /etc/postfix/virtual and re-build the mapping file with “postmap /etc/postfix/virtual”. Also make sure the baseconfig variable “mail/postfix/virtual/enabled” is set to “yes”.

Kind regards,
mosu

Thank you Moritz.(and apologies for the slow response)

Just to clarify, will configuring postfix in this way leave a copy of the forwarded message in the Zarafa mailbox or not ? (I suspect that Zarafa will never see the message when postfix is configured this way ?)

Yes, thats definitely the case.

Hey,

it depends on whether or not you specify the original recipient as a new recipient or not. This will forward a copy to an external address and keep a local copy:

address-to-forward@mydomain   address-to-forward@mydomain, external-address@other-domain

Even though this seems to create a loop it doesn’t as Postfix interprets this just as you want it to: “keep and forward”.

The following won’t keep a local copy, though:

address-to-forward@mydomain   external-address@other-domain

Note that there are multiple ways to achieve “keep and forward”. One often suggested is to use “recipient_bcc_maps”. It works just fine but requires some more effort to set up properly on a UCS system as the “main.cf” is generated from templates, and those templates don’t provide “recipient_bcc_maps” yet. We’d have to create our own template snippet, register it with the Univention config registry and re-build the “main.cf” file. Definitely not a lot of work, but still more than simply using the already provided “virtual” way.

Kind regards,
mosu

Thank you both Felix & Moritz. Plenty of food for thought there. One other thing that never occurred to me when 1st thinking about this was the Mail Filter rules within Webapp itself. More for user control than administration at the server level, but another option to achieve the same end nonetheless.

Mastodon