zimbraMailCatchAllCanonicalAddress outbound rewrite?

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Matt Drown
Posts: 8
Joined: Sat Oct 29, 2016 1:31 pm

zimbraMailCatchAllCanonicalAddress outbound rewrite?

Postby Matt Drown » Wed Oct 03, 2018 9:45 pm

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 mailhub.company.com. Completely independent, accepts email for "user@company.com". Redirects to user@zimbra.company.com and via postfix transport, sends to zimbra.company.com host. Redirects some other other users to "user@host2.company.com" and via postfix transport, sends to zimbra.company.com.

Zimbra Free-Edition running on zimbra.company.com. With a couple domains, "zimbra.company.com" and "host2.company.com".

I ran the following to generat the loop:

Code: Select all

zmprov md zimbra.company.com zimbraMailCatchAllAddress @host2.company.com zimbraMailCatchAllCanonicalAddress @company.com


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 zimbra.company.com domain.

I just undid the above code and instead just ran:

Code: Select all

zmprov md zimbra.company.com zimbraMailCatchAllCanonicalAddress @company.com


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

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.
Last edited by Matt Drown on Sun Oct 14, 2018 12:00 am, edited 1 time in total.


pup_seba
Outstanding Member
Outstanding Member
Posts: 448
Joined: Sat Sep 13, 2014 2:43 am
Location: Tarragona - Spain

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Postby pup_seba » Thu Oct 04, 2018 1:32 pm

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.
Matt Drown
Posts: 8
Joined: Sat Oct 29, 2016 1:31 pm

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Postby Matt Drown » Thu Oct 04, 2018 4:19 pm

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 :)
pup_seba
Outstanding Member
Outstanding Member
Posts: 448
Joined: Sat Sep 13, 2014 2:43 am
Location: Tarragona - Spain

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Postby pup_seba » Thu Oct 04, 2018 5:46 pm

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.

https://wiki.zimbra.com/wiki/Managing_Domains

gl mate!
Matt Drown
Posts: 8
Joined: Sat Oct 29, 2016 1:31 pm

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Postby Matt Drown » Thu Oct 04, 2018 6:35 pm

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 "user@sub.company.com" to "user@company.com". :)
Matt Drown
Posts: 8
Joined: Sat Oct 29, 2016 1:31 pm

Re: zimbraMailCatchAllCanonicalAddress outbound rewrite?

Postby Matt Drown » Mon Oct 08, 2018 4:01 pm

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 user@subdomain.company.com zimbraPrefFromAddress user@company.com


Does anyone have a better way to do this?

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 23 guests