Page 1 of 1

Workaround to rename a domain by domain alias

Posted: Thu Feb 02, 2017 8:03 am
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!

Re: Workaround to rename a domain by domain alias

Posted: Thu Feb 02, 2017 12:04 pm
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.

Re: Workaround to rename a domain by domain alias

Posted: Thu Feb 02, 2017 4:29 pm
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}]

Re: Workaround to rename a domain by domain alias

Posted: Thu Feb 02, 2017 10:43 pm
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

Re: Workaround to rename a domain by domain alias

Posted: Fri Feb 03, 2017 8:06 am
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!

Re: Workaround to rename a domain by domain alias

Posted: Fri Feb 03, 2017 1:27 pm
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?

Re: Workaround to rename a domain by domain alias

Posted: Mon Feb 06, 2017 7:24 am
by sirio81
I have to correct my self: the two server are configured as master-master.

Re: Workaround to rename a domain by domain alias

Posted: Mon Feb 06, 2017 7:35 am
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 ;)

Re: Workaround to rename a domain by domain alias

Posted: Mon Feb 06, 2017 7:42 am
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.

Re: Workaround to rename a domain by domain alias

Posted: Fri Mar 03, 2017 12:18 pm
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