Page 1 of 1

zimbraMailCatchAllCanonicalAddress outbound rewrite?

Posted: Wed Oct 03, 2018 9:45 pm
by Matt Drown
awhile back I asked a question about domain rewrites for outbound when i did 8.6->8.7, and discovered that i had to do per-account modifications for outbound rewrites to work properly. Just yesterday I had to add a different domain to a FOSS/OSE zimbra install and created the looping email setup again, because I followed the documentation I found on the zimbra wiki.

My setup:
postfix MTA on Completely independent, accepts email for "". Redirects to and via postfix transport, sends to host. Redirects some other other users to "" and via postfix transport, sends to

Zimbra Free-Edition running on With a couple domains, "" and "".

I ran the following to generat the loop:

Code: Select all

zmprov md zimbraMailCatchAllAddress zimbraMailCatchAllCanonicalAddress

mail would loop between my external MTA and the zimbra server.

Previously I solved this for a handful of accounts by modifying each account and manually setting the "zimbraPrefFromAddress" for each one in the domain.

I just undid the above code and instead just ran:

Code: Select all

zmprov md zimbraMailCatchAllCanonicalAddress

This appears to have done the right thing, inbound mail is delivered, and outbound mail appears to have the from address rewritten from "" to "".

My question, what exactly is this command doing/modifying? I can't find documentation on either of these settings to read, and I'm wary of just running random re-write commands and hoping they work. So any help, or pointers to documents would be greatly appreciated.

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Posted: Thu Oct 04, 2018 1:32 pm
by pup_seba
I would not expect to find proper documentation about this...I think there is still no replacement for the previous knowledge base person :/

From running "zmprov desc -a zimbraMailCatchAllCanonicalAddress" it looks that it just rewrites all headers, but if you really need to be sure, I'm thinking the only way is to access the code itself, strating with zmprov which will lead you to .jar files which you'll have to decode and try to find out from there.

You could also try to see if by anychance this command creates the map files for canonicals that used to be necessary...but maybe it does that and more, so best way I think would be to look into the code itself.

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Posted: Thu Oct 04, 2018 4:19 pm
by Matt Drown
Thanks for the help, I didn't know about the "zmprov desc" option, so that's at least a small start :)

In re-testing, what i thought worked, does not. I'm going to go in and modify all the user prefs to fix the from address, but it seems odd that there isn't a way to do this at the domain level. Or at least odd that there isn't some documentation about it :)

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Posted: Thu Oct 04, 2018 5:46 pm
by pup_seba
Have you tried the "domain masquerade" thing? It looks like outdated documentation but maybe it helps? i think you are missing at least one command there to achieve a proper configuration.

gl mate!

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Posted: Thu Oct 04, 2018 6:35 pm
by Matt Drown
yea, that's the document that i used that resulted in a loop being created. Inbound is working fine, I'm just trying to get outbound. I just discovered that zimbraPrefFromAddress on an account doesn't seem to work for some reason unless the COS associated with the account allows you to modify from the send address.

Maybe I could have done this in reverse and setup the zimbra domain to be the addresses I wanted people to use, and set up aliases for the inbound address routing.

All I want to do is rewrite ALL accounts in a particular zimbra domain outbound from "" to "". :)

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Posted: Mon Oct 08, 2018 4:01 pm
by Matt Drown
So I just scripted the setting up of each user to have preffromaddress, and set up the class of service for the users to allow sending from any address, otherwise the preffromaddress wouldn't work:

Code: Select all

zmprov mc subdomaindefault zimbraAllowAnyFromAddress TRUE
zmprov ma zimbraPrefFromAddress

Does anyone have a better way to do this?