1

Topic: How do you change the primary domain after installation

I have setup a placeholder domain name during installation, now I want to change the domain and use it in production, how do I do this?

2

Re: How do you change the primary domain after installation

Iam now in a similar situation. we setup iredmail 0.7.4 with LDAP and SOGo and DokuWiki on the same Server with our primary domain -> example.com and wanna switch everything to example.de.

is there any help which things need to be done for this?

3

Re: How do you change the primary domain after installation

To @lee_connell, Simply add a new mail domain. That's all.

To @martinseener, Not sure what addition work is required by SOGo and DokuWiki, but add a new mail domain is enough for mail service.

4

Re: How do you change the primary domain after installation

Hi Zhang,

this was also my first idea. Why want to change everything in every config of iredmail - its basically not necassary.
Admin Users like postmaster will easily stay the same.
just adding new maildirs for our users on the new domain and reconfigure the old ones to aliases to send mail to the new domain maildirs, thats all i think. for sogo, sugarcrm and dokuwiki there will me slightly more work for reconfigure the groups in LDAP and of couse the Config in the appropiate external tools, but this isnt that hard i think.

or do i miss anything!?
DKIM SPF and ADSP is already configured in the mailserver and DNS so should work great.

5

Re: How do you change the primary domain after installation

what about those old mails....do i need to copy them over to the new maildirs or is it possible to somehow "rewrite" the old maildirs to the new domain!? if yes, how? (we only have the free version of iredmail/iredadmin/ldap)

6

Re: How do you change the primary domain after installation

martinseener wrote:

what about those old mails....do i need to copy them over to the new maildirs or is it possible to somehow "rewrite" the old maildirs to the new domain!? if yes, how? (we only have the free version of iredmail/iredadmin/ldap)

Adding new mail domain won't migrate mailboxes automatically, so you have to migrate them manually. For example, copy mails in old mailboxes to new mailboxes.

If you have iRedAdmin-Pro installed, you can add an alias domain for old mail domain, then all emails sent to both old and new email domains will be delivered to the same mailboxes. For example, mails sent to user@old_domain.com or user@new_domain.com will be delivered to the mailbox of user@old_domain.com. But i don't think you want to keep seeing old mail domain name. So try to migrate mailboxes manually.

7

Re: How do you change the primary domain after installation

ZhangHuangbin wrote:
martinseener wrote:

what about those old mails....do i need to copy them over to the new maildirs or is it possible to somehow "rewrite" the old maildirs to the new domain!? if yes, how? (we only have the free version of iredmail/iredadmin/ldap)

Adding new mail domain won't migrate mailboxes automatically, so you have to migrate them manually. For example, copy mails in old mailboxes to new mailboxes.

If you have iRedAdmin-Pro installed, you can add an alias domain for old mail domain, then all emails sent to both old and new email domains will be delivered to the same mailboxes. For example, mails sent to user@old_domain.com or user@new_domain.com will be delivered to the mailbox of user@old_domain.com. But i don't think you want to keep seeing old mail domain name. So try to migrate mailboxes manually.

I managed it this way:

created newdomain.com-mailboxes with iredadmin, then changed the MailDir and HomeDir Timestamp in the new LDAP Mail Entries to comply with the Old ones but left the new domainname (just changed the user timestamp there) and then copied over all mails to the new domain using the following command "cp -r /var/vmail/vmail1/olddomain.com /var/vmail/vmail1/newdomain.com"
and "chown -R vmail:vmail /var/vmail/vmail1/newdomain.com"

and set a sieve-rule for all old domains mailboxes to redirect them directly. works great.

but can you tell me what exactly iredadmin-pro does in LDAP and/or postfix to have an alias domain? i dont have iredadmin-pro and at moment not the money to get it (poor student)

Thank you!

8

Re: How do you change the primary domain after installation

martinseener wrote:

but can you tell me what exactly iredadmin-pro does in LDAP and/or postfix to have an alias domain? i dont have iredadmin-pro and at moment not the money to get it (poor student)

iRedMail has alias-domain support by default. For iRedAdmin-Pro, please try our online demo, and check its LDIF data to see what it does. Searching in this forum will give you some early posts about this topic also.