Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How can I automatically forward outgoing emails to a different domain?

As an example, a user sends an email to 1234564@fax.mydomain.com and I want the exact email forwarded outside mydomain.com to 1234564@example.com.

Note There are no accounts on the local Zimbra server under the fax.mydomain.com subdomain and the prefix 123456 will not be constant, e.g. it will change depending on fax recipient's number.

I know that the easy thing would be to have users send the emails directly to the @example.com domain, but I'd rather have them use the local fax.mydomain.com domain and have the email forwarded/ redirected.

I don't know whether to use postfix transports, procmail or something within zimbra.

I think that postfix transports requires that I specify a different SMTP server, e.g. otherdomain.com :[smtp.otherdomain.com]

With procmail I think I would need to use a pipe, but I've never used procmail.

I've tried to find a feature within Zimbra and I tried to zmprov md fax.mydomain.com zimbraMailCatchAllForwardingAddress @example.com but the emails bounced.

How do I best achieve this?

share|improve this question

1 Answer 1

Only forwarding is probably not enough, you also have to masquerade the domain name, otherwise the example.com mail server probably rejects the mail and this is what you see as bounces.

For us it works like this:

zmprov md fax.mydomain.org zimbraMailCatchAllAddress @example.com
zmprov md fax.mydomain.org zimbraMailCatchAllForwardingAddres @example.com
zmprov md fax.mydomain.org zimbraMailCatchAllForwardingAddress @example.com
zmprov md fax.mydomain.org zimbraMailTransport smtp:mail.example.com
zmprov md fax.mydomain.org zimbraMailCatchAllAddress @fax.mydomain.org zimbraMailCatchAllCanonicalAddress @example.com

Mails arriving at example will still have the To:- field as xx@fax.mydomain.org but the envelope is correct.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.