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:

  1. Create the account on sendinblue.com.
  2. Navigate to Senders & IP (in the drop-down of your user icon in the upper right) > Domains.
  3. Click Add a new domain and copy the values that shown to your domains records. This is easy with the Google Domains web-UI.
  4. 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).
  5. 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 called secrets.env, which is not added in git. I mount it then here:
  6. 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 πŸ˜‰.

Written on October 3, 2022