How to set up a mail server with EasyEngine

Setting up mail server with EasyEngine is as easy as it gets. In this post I will explain step by step how to get a mail server working with EasyEngine, in other words you will be able to receive and send emails from a free web-based email software called RoundCube.

You will need to have EasyEngine installed, you can install EasyEngine on these operating systems: Debian 7, 8, Ubuntu 12.04, 14.04 or 16.04. Use this command to install.

wget -qO ee rt.cx/ee && sudo bash ee

We will start by installing the mail packages that comes with EasyEngine.

ee stack install --mail

When you use this command, EasyEngine will also install mailscanner if you have at least 512MB of RAM. MailScanner is a open source security email gateway for filtering out spam, so I really recommend installing this too. If everything has been installed you will get a Security Salt that you have to copy and paste to your ViMbAdmin control panel that you will find here: https://example.com:22222/vimbadmin

When logged in you will be able to create a mailbox and add a domain. If you have added your desired domain and created a mailbox, it is time to do some changes in your DNS settings.
In this example I will be using Amazon AWS as a DNS provider. Here is a list of the records you should add.

Type: A  Name: webmail.example.com Value: ip address to your server
Type: MX Name: example.com Value: 0 webmail.example.com

You could also add a SPF record, this will make our server an authorized mail server to this domain.

Type: spf Name: example.com Value: “v=spf1 ip4:your-server-ip-address/16-all”

If you have a firewall, it is important to open the required ports to receive and send email. Here is all the required ports you have to allow:

SMTP – 25 (465 with SSL, 587 with TLS)
POP3 – 110 (995 for SSL)
IMAP – 143 (993 for SSL)
ViMbAdmin – 22222

You can now check if you can send and receive email, so go to your roundcube email client by typing webmail.example.com and log in with your newly created credentials.
You should now be able to send and receive emails, please leave a comment below or go to my forum if you have any problems!

Leave a Reply