Using multiple domains in Luke Smith's emailwiz

Article is work-in-progress. published on oct 24 2022

Emailwiz is a script that automatically sets up a simple email server. I have personally used this script to set up my email, because setting up an email server manually is a big pain. However, a friend of mine recently asked me whether he could have his own email server, with his own domain name, home directory etc. Now I thought that that is probably very easy to do, and it is, but it isn't very well docummented anywhere other then the postfix manual and some people explaining it on luke smith's github. In this guide I will show you step-by-step how to do that without the pain.

This guide assumes that you have your own email server set up using emailwiz, and at least two domains. If you don't yet have an e-mail server and want to learn how to set-up one, you can see this guide.

First, create a user on your server that is a part of the mail group. In this example it will be steve , and he will be using the other domain.

useradd -G mail steve

passwd steve

Now go to /etc/postfix/virtual, and here you will have to specify which user is using which domain. Meaning every user you create you must specify the domain to in this file. In this example, gus will be the user using the first domain.

gus@domainone.com
steve@domaintwo.com

Now go to /etc/postfix/dkim/keytable

and add following lines:

mail._domainkey.gus@domainone.com domainone.com:mail:/etc/postfix/dkim/mail.private
mail._domainkey.steve@domaintwo.com domaintwo.com:mail/etc/postfix/dkim/mail.private
Important!

You will want to set TXT records for the second domain the same way you did for the first one. Go to your domain registrar and put them in. Of course I hope I don't need to mention that you set up the second domain exactly like you would for the first one.


Copyright © 2022 Jakub Bidžan
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. Source code: https://git.drgnz.club/jacob/main