Workaround to rename a domain by domain alias

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Workaround to rename a domain by domain alias

Post by sirio81 »

Hi all, I have @mydomain.it with about 30 email accounts.
I wish to change the domain to @newdomain.com.
Creating a new domain and 30 new mail is problematic because users have all their mail on the old domain.
The best and quick thing is to create a domain alias.
Doing so, user@mydomain.it can log in as user@newdomain.com right away and start receiving mail for the new domain.
There's only one thing i need: all users have to send new mail as user@newdomain.com instead of user@mydomain.it.
Is there a way to achieve that in one step?

Thank you!
User avatar
ExTechOp
Posts: 27
Joined: Wed Jan 25, 2017 2:17 pm

Re: Workaround to rename a domain by domain alias

Post by ExTechOp »

sirio81 wrote:There's only one thing i need: all users have to send new mail as user@newdomain.com instead of user@mydomain.it.
Is there a way to achieve that in one step?
At least from the command line, you could do for each account

Code: Select all

zmprov mailbox "$account" zimbraPrefFromAddress "$account@newdomain.com"
which sets the preferred email From-field for the account.
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Re: Workaround to rename a domain by domain alias

Post by sirio81 »

It seems I'm not using the right syntax because it prints zmprov help.
Notice I'm writing mydomain.it

Code: Select all

zmprov mailbox "$account@mydomain.it" zimbraPrefFromAddress "$account@newdomain.com"
because the main account is $account@mydomain.it

Are you sure the syntax you wrote is for zimbra 8?

Code: Select all

zmprov help mailbox

  getMailboxInfo(gmi) {account}

  getQuotaUsage(gqu) {server}

  recalculateMailboxCounts(rmc) {name@domain|id}

  reIndexMailbox(rim) {name@domain|id} {start|status|cancel} [{types|ids} {type or id} [,type or id...]]

  compactIndexMailbox(cim) {name@domain|id} {start|status}

  verifyIndex(vi) {name@domain|id}

  getIndexStats(gis) {name@domain|id}

  selectMailbox(sm) {account-name} [{zmmailbox commands}]
User avatar
vavai
Advanced member
Advanced member
Posts: 174
Joined: Thu Nov 14, 2013 2:41 pm
Location: Indonesia
ZCS/ZD Version: 0
Contact:

Re: Workaround to rename a domain by domain alias

Post by vavai »

Hi,

1. Backup all Zimbra data
2. Use "rename domain" feature on Zimbra : https://wiki.zimbra.com/wiki/How_to_rename_a_domain
3. Set old domain name as an alias for current (new) domain to prevent any emails probably sent to previous name
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Re: Workaround to rename a domain by domain alias

Post by sirio81 »

Great Vavai! That's exactly what I was looking for!
Just a note: my zimbra 8 is synced with a second zimbra (master - slave).
May This procedure encounter any issue in such scenario?

Thank you!
User avatar
vavai
Advanced member
Advanced member
Posts: 174
Joined: Thu Nov 14, 2013 2:41 pm
Location: Indonesia
ZCS/ZD Version: 0
Contact:

Re: Workaround to rename a domain by domain alias

Post by vavai »

Hi,
sirio81 wrote:Great Vavai! That's exactly what I was looking for!
Just a note: my zimbra 8 is synced with a second zimbra (master - slave).
May This procedure encounter any issue in such scenario?

Thank you!

What is sync method on your scenario. Does it using multi server scenario or simply using domain forward or something else?
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Re: Workaround to rename a domain by domain alias

Post by sirio81 »

I have to correct my self: the two server are configured as master-master.
User avatar
vavai
Advanced member
Advanced member
Posts: 174
Joined: Thu Nov 14, 2013 2:41 pm
Location: Indonesia
ZCS/ZD Version: 0
Contact:

Re: Workaround to rename a domain by domain alias

Post by vavai »

Hi
sirio81 wrote:I have to correct my self: the two server are configured as master-master.
Did you mean LDAP master-master? AFAIK, as long as your related config has been updated (both old and new name on /etc/hosts, dns etc) it should not encounter any problem to your ldap-master-master, but backup first highly recommended to prevent any unexpected process ;)
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Re: Workaround to rename a domain by domain alias

Post by sirio81 »

Did you mean LDAP master-master?
Yes, I meant LDAP master-master.
Thank you.
I'll report backup if it works or not.
User avatar
ExTechOp
Posts: 27
Joined: Wed Jan 25, 2017 2:17 pm

Re: Workaround to rename a domain by domain alias

Post by ExTechOp »

sirio81 wrote:It seems I'm not using the right syntax because it prints zmprov help. [...] Are you sure the syntax you wrote is for zimbra 8?
I see you've already solved this another way. Sorry about getting the syntax wrong (I don't know how that happened :oops:), in case it helps someone at this point the correct form is:

Code: Select all

zmprov ma "$account" zimbraPrefFromAddress "$account@newdomain.com"
The first "$account" is just how the the account in question is identified, and the "$account@newdomain.com" is an actual email address which will appear in the email "From" field. You can check what the account has for its current zimbraPrefFromAddress setting with:

Code: Select all

zmprov ga "$account" zimbraPrefFromAddress
Post Reply