email

I’ve been meaning to attempt to create an email server on my domain for some time. Some time ago I decided to finally spend some time and do exactly that.

I used a premade configuration script I found called Bullmail. It automatically setup up a SMTP server, an IMAP server, spam filtering, signs emails with DKIM.

Here’s the link: Bullmail Repo

Screenshot of Bullmail's git repository.
A screenshot of the repository which configurations I followed to get my server up and running.

I ended up needing to modify a lot of the script because even though it was recent it was built by someone using old software. But this was fine, the main changes were in the dovecot and the postfix configuration, which are the SMTP and IMAP servers.

I spent some time around this but it was not as hard as I thought it would be, the syntax for the configuration files is pretty weird.

When I got the email setup I finally added the entry in my DNS records for my domain. And I could receive emails but I couldn’t send any to other email providers, some mentioned my IP was banned for being a commercial IP, however, by appealing manually on the website that finally subsided.

Now the problems were that I was still missing the DKIM, the DMARC and the SPF records. I finally added them in my domain records and the email was finally received on the commercial email. But it was still in SPAM.

Why is it in SPAM? Well, because my IP is a commercial IP and as such the PTR address on the provider side is not pointing at my domain, it is instead pointing to a domain belonging to my ISP. While I could ask them to change the PTR to go to my domain, I don’t think they will want to abide.

Email Deliverability Report
All 3 DNS records are created and working correctly. The best possible deliverability is achieved.

Which brings me to the sad conclusion that nowadays it is impossible to create your own email server at home using commercial IPs, it makes much more sense to simply buy a service that provides the email server for you for a certain monthly fee. That’s because there’s a polipoly on the email industry. My email server works fine, my emails are not spam, they are clearly written by a human and yet they are sent to spam. The problem is that everyone is using commercial emails so you will be automatically shunned out for not using them. There is no commercial benefit for the email providers to accept that people can have their own emails, they would rather ban them and as such impulse their business even more.

Cron Emails
What a cron looks like when receiving it in the email.

There are, however, nice developments in having an email server. It is great to receive information about what is happening in the server. For example, for the Trading Bot I added the email server as the alerting for alert manager. Now I receive alerts when the system goes down, when the CPU usage is too much, when RAM usage is getting high, etc… The server also defauts to return cron job output to the default email server, as such, all cron tasks send me an email with their output once they are finished. Which goes great with the backup server task as I can see in the morning how it went.

Alerting Emails
What an alert looks like when receiving it in the email.