Setting up email for your domain

Setting up a separate mail server while still hosting your platform on Google App Engine

For those trying to host their platform on google app engine you’ll probably have come to the annoying realisation that you need more than the one email address they give you. They allow you as part of Google Apps to buy extra email accounts but in this day and age shouldn’t an email account be free? Well here is how I got around it.

The first thing is to set up a Virtual Private Server (VPS). I set one up with Hetzner and for under €4 a month I have a VPS which hosts multiple websites on multiple multiple domains as well as email accounts for all of them. You have a choice of which OS to install. Ubuntu 14 was the easy choice as it is well supported as a community and there is documentation for just about everything. Once you’ve ordered a VPS from Hetzner they email you the details for you to be able to login.

There is a good blog over at digital ocean for setting up an email server. Postfix seems to be the most popular so I went with that and found the documentation for the postfix configuration files very useful.

It’s important that you have your DNS records set up correctly. Since I use 123-reg there is a useful 123-reg tutorial on pointing your domain to your mail server. The key thing is to have an A record for something like mail.example.com point to the IP address of where your mail server is hosted. Then have various MX records that point to mail.example.com. Once your DNS is configured and your Postfix server is set up correctly you should actually be able to receive mail at someuser@example.com and be able to access this email using the someuser unix account.