Page 1 of 1

Sender address rewrite from internal to external domains (Zimbra 8.7)

Posted: Fri Dec 08, 2017 1:04 am
by opsystem
Hi all,

I’ve one of those situations where mailboxes are @localdomain and users should be able to send messages outside via external relay as, let’s say, externaluser@realdomain.com.

So the goal here is:
sender user@localdomain -> *anyuser*@localdomain ----> no rewrite
sender user@localdomain -> rest of the world ----> sender rewrite as externaluser@realdomain.com -> external relay

Postfix has a parameter for this: smtp_generic_maps (zimbraMtaSmtpGenericMaps), this works but problem is that senders are rewritten when recipients are internal too – and that's quite strange (as Postfix guide says "It does not happen when you send mail between addresses on the local machine").
Any suggestions?
Thanks

P.S. I'm already using Personas as external accounts, the issue here is when using internal accounts only.

Re: Sender address rewrite from internal to external domains (Zimbra 8.7)

Posted: Thu Mar 15, 2018 5:32 am
by AcidVenom
Same situation. I think need a feature request.

Re: Sender address rewrite from internal to external domains (Zimbra 8.7)

Posted: Fri Jun 15, 2018 2:45 pm
by oetiker
hi

does this not work with a sender_canonical map. I could not found a who to about that but since zimbra is using postfix it should
be done by a sender_canonical_map

somthing like this https://wiki.zimbra.com/wiki/How_to_red ... o_one_user example just with an other map
on that page https://wiki.zimbra.com/wiki/Postconf_keys I found the key zimbraMtaSenderCanonicalMaps

Code: Select all

zmprov mcf zimbraMtaSenderCanonicalMaps 'pcre:/opt/zimbra/conf/postfix_sender_canonical'
cat /opt/zimbra/conf/postfix_sender_canonical

Code: Select all

@localdomain    @realdomain.com
has anybody done this?

cheers Manuel

Re: Sender address rewrite from internal to external domains (Zimbra 8.7)

Posted: Sat Jun 16, 2018 12:42 pm
by gek
opsystem wrote:Hi all,

I’ve one of those situations where mailboxes are @localdomain and users should be able to send messages outside via external relay as, let’s say, externaluser@realdomain.com.

So the goal here is:
sender user@localdomain -> *anyuser*@localdomain ----> no rewrite
sender user@localdomain -> rest of the world ----> sender rewrite as externaluser@realdomain.com -> external relay

Postfix has a parameter for this: smtp_generic_maps (zimbraMtaSmtpGenericMaps), this works but problem is that senders are rewritten when recipients are internal too – and that's quite strange (as Postfix guide says "It does not happen when you send mail between addresses on the local machine").
Any suggestions?
Thanks

P.S. I'm already using Personas as external accounts, the issue here is when using internal accounts only.
Hello! Could you explain, before adding persona's external email, did you created domain alias for that external mail?
By your example:
you have user@localdomain mailbox -> but you need to send a message from user@realdomain -> do you create @realdomain alias to @localdomain ? Or just create a persona and allow user's persona send mail from user@realdomain in
"admin console-> edit the account (or COS)-> select the 'Preferences' tab -> Allow sending mail only from these addresses: " ?

OH, +1 to the topic question!

upd. i've found that solution. I think it's very similar to.

Re: Sender address rewrite from internal to external domains (Zimbra 8.7)

Posted: Wed Oct 24, 2018 1:15 pm
by secathor
oetiker wrote:hi

does this not work with a sender_canonical map. I could not found a who to about that but since zimbra is using postfix it should
be done by a sender_canonical_map

somthing like this https://wiki.zimbra.com/wiki/How_to_red ... o_one_user example just with an other map
on that page https://wiki.zimbra.com/wiki/Postconf_keys I found the key zimbraMtaSenderCanonicalMaps

Code: Select all

zmprov mcf zimbraMtaSenderCanonicalMaps 'pcre:/opt/zimbra/conf/postfix_sender_canonical'
cat /opt/zimbra/conf/postfix_sender_canonical

Code: Select all

@localdomain    @realdomain.com
has anybody done this?

cheers Manuel
Just a little information about this solution, the file /opt/zimbra/conf/postfix_sender_canonical need to be in regular expresion, like

Code: Select all

/^(.*@)localdomain$/     ${1}realdomain.com
Thank you

Re: Sender address rewrite from internal to external domains (Zimbra 8.7)

Posted: Wed Feb 07, 2024 7:36 pm
by dac29
Hi opsystem, did you resolve your issue? Is it a bug ? Thanks a lot !