I will "quickly" set up my own email π§ server βοΈ
I have always dreamed of having my own email server. Part, because it feels great to can πͺ. Part, because of privacy reasons, unlimited quota, and other unnecessary restrictions that typical email providers impose. Part, because of π°. For a long time, I have been hosting my emails on one.com. Since this year, they charge β¬ 77 per year. That is reasonable, given that they do everything and provide unlimited number of email accounts, but still π€·ββοΈ. Assuming that I will use email for the next 30-50 years, I am looking at costs of a couple of thousands of Euro.
With that motivation in mind, I set out in July 2022 to try it finally. I picked Mailu, because of its out-of-the-box π€ Docker π³ support and support for all advanced security and authentication features. My first configuration worked out quite well. I managed to set up SPF, DKIM, and DMARC through the Google Domains web UI. After small issues in local networking within the Docker π³ network and dumping the Traefik-generated SSL certificate, everything was functional. Sending emails worked to most providers β π.
However, in particular Microsoft is a tough nut π₯. They also require reverse DNS lookup to be configured. That however is something that the ISP has to configure. My provider is PYUR. They are great in general, but over months refused to do this for me. I had already given up on the idea and considered using this email server only for inbound π₯ email. So much to βquickly set up my own email serverβ π€¦ββοΈ.
But then, β¦ π₯, I thought I could use an external email delivery server. As it turns out, there are plenty of them out there! Eventually, I picked sendinblue.com because of their awesome free tier. It allows to send up to 300 mails per day. That will for sure be enough!
Setup was quick and worked almost out of the box. So here is a quick step-by-step guide to configure this:
- Create the account on sendinblue.com.
- Navigate to Senders & IP (in the drop-down of your user icon in the upper right)
>
Domains. - Click Add a new domain and copy the values that shown to your domains records. This is easy with the Google Domains web-UI.
- Get the SMTP credentials from the Transactional tab.
The first launch will already guide you through the setup and show the
Postfix
configuration (3rd tab in the wizard). - Take these values (server and port, username, password) and store them in the environment variables of Mailu.
I chose to only store they server and port in my configuration file:
The username (
RELAYUSER
) and password (RELAYPASSWORD
) are stored in another environment variable file I calledsecrets.env
, which is not added ingit
. I mount it then here: - Rebuild the service with
docker-compose up -d
. Done β .
Also nice to have: use the free blacklist monitor of mxtoolbox.com to check if your domain got listed somewhere. In general, this website has great tools to diagnose problems related to DNS, email delivery and other web protocol things.
I hope π€ this can help you also set up your own email server, hopefully much quicker than me π.