Chaning Mail Domain

I made this mistake of setting up my mail server with the domain, but let’s me honest, who wants to email someone who has an extra, unnecessary subdomain?

So I want to move it, so I can still have mail coming from, still have all the accounts, but slowly move everything so I can just be I know there is a way to add domains, and I wanted to ask about that.

I also have been wanting to get around to running redundant servers, in case one goes down. Does Mail-in-a-box support mail server redundancy? I’ve never really tried.

Also, @alento or @murgero, could I PM you guys my real domain so you can check my DNS records to make sure everything look right?


Of course you may! If only a 20 character response wasn’t required! :stuck_out_tongue:

Not many people, really … which is why I personally ONLY use that one email address that is created for admin purposes. All others are created as john,

It is absolutely necessary to have a hostname which is a subdomain of a domain name to configure and set up a mail server. But beyond that one set-up step (due to the way this project is configured) it is not necessary to do so.

There are a couple of ways to easily fix this … I will come back tomorrow with more information. It has been a long day …

This is not always a mistake, just add a new domain to the server (EG:, and make (or depending on your hostname for MIAB server) your nameserver at your registrar for

Just add user to add the new domain. MIAB will automatically create the DNS records, configurations, etc.

This is possible using two servers, load balancing and shared storage. HOWEVER is not recommended as MIAB does not natively support this and can cause corruption issues. I would recommend a different mail solution if you want true redundant mail servers.

As @murgero indicated all that is necessary to add a domain is to add an email account in the admin area under Mail>Users. When you add all the necessary changes will be done for you IF it is the same domain as your MiaB is. iow your MiaB has the host name and you add an email user for there is nothing more to do ASSUMING MiaB is handling your DNS, however if you add an email user for a different domain such as you ALSO need to change the MX entry in DNS wherever it is hosted to MiaB makes this quite simple by design! :slight_smile:

So now, I presume that you are currently using the email account and would rather use as your email address that you give people based on your OP. You have two options here.

  1. You can create the email user as mentioned above.

  2. Or you can add an alias of which forwards all mail to your existing user

Now doing the first, you may actually want to carry this a step further … you may want to have all of your old email in the account of to be moved to the new account of You can do this from the command line by moving (or copying) the directory /home/user-data/mail/mailboxes/ to /home/user-data/mail/mailboxes/

If you copy, then the old mail will be accessible at both places vs. move where it will be only accessible from If you do this, it should be done IMMEDIATELY after creating the new user account in the admin area.

It would be safer to use to sync the two accounts and then add a forwarding (or alias) for ->

BUT copying should work here.

1 Like

I do agree here as it is indeed safer. There is also an online imapsync tool that can be used rather than installing the client. I recommend it unless you are a power user.

Please define “power user”. I go through Ubuntu Linux like it was a dance on my keyboard (most days). Also, I do not like the idea of some random stranger on the internet getting my email credentials to magically fix all my problems, when there is a solution I can use on my own local box.

EDIT: THERE ARE NO INSTALL INSTRUCTIONS! :weary: I don’t know what I’m doing.

I think you hit upon one of the definitions already:

That is the reason that I do not have imapsync installed anywhere and don’t usually recommend it. Although it is absolutely the BEST tool available for the job!

When I use imapsync online I always change both email account passwords before doing so. Email addresses and mail servers are basically public information. The password is the one unknown that should always be an unknown.

Actually there are in the directory INSTALL.d on the GitHub page for imapsync. I also believe that the project developer has them on his website at:

1 Like

Yea any quick google search will find instructions from all over. Very simple to use :slight_smile: