Moving email domain

Discussion in 'Installation/Configuration' started by electronico_nc, Apr 6, 2020.

  1. Hi all,

    standalone server

    Company name change makes company1 becomes company2.
    So IMAP emails from company1.tld have to be transfered to company2.tld
    There are only 30 email adresses on [email protected]

    Is there an easy way doing this with ISPConfig ?

    I first think to :
    copy /var/vmail/company1.tld to /var/vmail/company2.tld
    create a light script that copies
    Code:
    SELECT * FROM `mail_user` WHERE `email`LIKE '%comany1.tld'
    and insert new values using @company2.tld
    Then create emails aliases from [email protected] to [email protected]

    Can it go through MySQL commands or should it be done via API ?

    Thanks for your thoughts !
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Rather create alias e-mail domain, that is one operation so no need to do mailbox by mailbox.
    There are oodles of discussions about copying mailboxes on this forum. Try Internet Search Engines with for example
    Code:
    site:howtoforge.com copy mailbox
     
    electronico_nc likes this.
  3. nhybgtvfr

    nhybgtvfr Active Member

    you don't need to copy, or transfer any emails.
    in the control panel, just go to each mailbox, change the company name in the *email dropdown, and change the domainname in the login part, and ispconfig will handle all the rest.
    once all the mailboxes are done, create the domain alias as taleman suggests.

    you could change the domains with a single MySQL command, but even with a re-sync, i'm not sure that will actually change the files/domains or just create a new set..
     
    electronico_nc likes this.
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    It's even easier yet, you simply change the domain name under Email > Domains, and all mailboxes, aliases, etc. will be updated. Note if you have mail forwards, the destination of those will not change, you'll have to catch those manually. Then if you still need company1.tld for something, add it as a domain (or domain alias) again (after having renamed it to company2.tld).
     
  5. Thanks @Taleman @nhybgtvfr @Jesse Norell !

    I first copied /var/vmail/company1.tld to /var/vmail/company2.tld.
    Then as you told :
    - Changed email domain name to company2.tld
    - Created email domain : company2.tld
    - Setup Email alias company1.tld to company2.tld

    Thanks for your quick and reliable answers !
     
    Last edited: Oct 18, 2020
  6. Hello,
    If using plugin like roundcube one, you have to login with
    [email protected]
    to use features like autoresponder.
    (using [email protected] will show a SOAP error sysuser not found while setting up autoresponder)
     
  7. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    There may be some database table(s) that need updated, try searching for company1 using phpmyadmin.
     

Share This Page