Chaning Mail Domain

Hello,
I made this mistake of setting up my mail server with the domain mail.example.com, 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 mail.example.com, still have all the accounts, but slowly move everything so I can just be john.doe@example.com. 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?

Thanks!

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,doe@example.com.

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: example.com, and make mail.example.com (or box.example.com depending on your hostname for MIAB server) your nameserver at your registrar for example.com+

Just add username@example.com 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 john.doe@example.com 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 mail.example.com and you add an email user for someuser@example.com 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 newdomain.com you ALSO need to change the MX entry in DNS wherever it is hosted to mail.example.com. MiaB makes this quite simple by design! :slight_smile:

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

  1. You can create the email user john.doe@example.com as mentioned above.

  2. Or you can add an alias of john.doe@example.com which forwards all mail to your existing user john.doe@mail.example.com.

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 john.doe@mail.example.com to be moved to the new account of john.doe@example.com. You can do this from the command line by moving (or copying) the directory /home/user-data/mail/mailboxes/mail.example.com/john.doe/ to /home/user-data/mail/mailboxes/example.com/john.doe/

If you copy, then the old mail will be accessible at both places vs. move where it will be only accessible from john.doe@example.com. 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 GitHub - imapsync/imapsync: Imapsync is an IMAP transfers tool. The purpose of imapsync is to migrate IMAP accounts or to backup IMAP accounts. IMAP is one of the three current standard protocols to access mailboxes, the two others are POP3 and HTTP with webmails, webmails are often tied to an IMAP server. Upstream website is to sync the two accounts and then add a forwarding (or alias) for john.doe@mail.example.comjohn.doe@example.com

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.

https://i005.lamiral.info/X/

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: http://imapsync.lamiral.info/

1 Like

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