I am looking for recommendations on how to host my own email server. I have been watching this video, but wonder if there is something better. TIA
I have recently (around 2 weeks ago) made the switch from provider-hosted email to self-hosted email. I have put that off for a long time, but since the provider (Servercow) drastically increased prices at the end of last year, I decided to migrate.
I am now running mailcow: dockerized, which is the same software that is powering the provider I switched from. So far it’s working great on a VPS with 4GB of RAM and 2 vCores and I am very happy with it. Mailcow appears to include a spam filtering solution (rspamd), but I’ve not yet looked into that. I plan to do that in the future.
Pros:
- Open source
- IPv6 capable
- DKIM support
- FIDO2 U2F and passwordless authentication
- Unlimited number of domains and mailboxes
- Clear instructions how to set up DNS records, with automated verification
- Ability to transport mail through third-party SMTP server (like AWS SES, mailgun, sendgrid, etc.)
- Built-in support for incremental backups
- Ability to enforce transport encryption (per domain or per mailbox)
- Nice, modern admin UI
Cons:
- No high availibity or at least load-balancing of SMTP service
- No automatic DNS server configuration
As long as you dedicate a server to running mailcow and don’t stray too far from their defaults, it’s surprisingly easy and fast to setup. I found the documentation to be quite comprehensive and didn’t need any further resources to set it up.
What’s come in particularly handy for me is the ability to use a third-party SMTP relay service for outgoing mail. My VPS provider (Hetzner) blocks outgoing traffic on TCP port 25, as many providers do, in order to combat spam. Although you can apply to lift this restriction with some providers, you might still end up with an IP address that is on a blocklist. So instead I signed up with Amazon Simple Email Service which includes 50k emails per day for free. That should be more than enough if you’re not sending marketing emails like newsletters.
I’ve been running mail servers for 25 years. Sendmail, postfix, dovecot, courier imap, squirrelmail, roundcube, etc. I now moved my customers to either Gmail or MS 365 because it became too much of a battle maintaining a good DNS MX reputation, even with proper SPF, DKIM, and DMARC records setup. Many mainstream mail servers are starting to reject mail if it did not originate from another mainstream provider. It became just to much to stay on top of. That being said, I switched personal, family, and friend’s domains to Mailcow on Debian about 2 years ago. I don’t particularly like Docker but I sucked it up to install Mailcow. It was the best thing I ever did. I can do everything needed through the Mailcow GUI now that used to require configuring many different .conf files.
I am running my own mail server for many years.
The last years mainly based off this tutorial:
https://workaround.org/
As someone who manages email servers daily. I would strongly suggest you use a smart host for your outgoing mail. It eliminates the problem of IP reputation that others have mentioned here. Mailcow is great as is Poste.io, both are docker based. Docker makes it easier to update, backup and migrate to another server should the need arise.
I like seeing people host their own mail, it gets you out of google/MS harvesting your inbox metadata for advertising.
Can you elaborate a little more about smart host?
A smart host or SMTP relay is a service that is used as the outgoing email server. The idea is that they take care of maintaining good reputation for you.
I should add a little as a reply to this post before I have another stroke & the knowledge is lost to the self hosting community forever
I started writing C on mark sense cards on unix ( Linux didn’t exist ) 50 years ago & while working for IBM in Canberra I bought a couple of EOL servers that had a license for a Email / Web server license & used the C API to dev. an app. I now call No Spam Accepted & it uses a technique called dedicated email addressing & I haven’t had a spam message in > 20 years.
The web sites on my servers have never been hacked as they are pure HTML,CSS,JS & I use no .php as I worked for an ISP in Canberra & their Wordpress , Joomla , Drupal sites were defaced on a daily basis.
I have been writing HTML etc. since early '90s & worked for a team that manged the most popular web site in the southern hemisphere so I have a lot of experience with port 80.
I have never used IPV6, but do use round robin DNS & have deved a DNS resolver as we have a list of Australian only domains that don’t have DNS entries.
This is considerable experience & I have been to Uni. 4 times most recently in 2003, so self hosting is a lot of fun for me, but if you cant code in 3GLs & don’t have a through understanding of IP self hosting may not be for you.
Having said all of this I recently designed a results engin for a startup called Ogle & have found Google Inc. ( GI ) very unhelpful in disabling https on new sites in chrome for the past 12 months so not all my projects run smoothly, maybe GI is no longer in the ‘Do no evil bus.’ & have followed all the rest of BUG Tech USA down the road of believing their own marketing hype ???
This startup leverages Google Business Profiles (BGP), Google Maps Directions (GMD) & Google Street View (GSV) to help Australians arrive at their destination using a technology called Go Pages all without server side scripting or a database to generate pages on the fly so our configs are very ‘compact’ & easily distributed.
BTW I was an Infrastructure Architect in a team of the largest Windows Client / server installation in southern hemi. so not just a Unix/Linux guy
I looked into mailcow and it is a complex jungle of containers which refused to work on my setup. Probably my fault, but two people couldn’t get it to run.
Since them I am using Docker Mail Server, which is just 1 all-in-one container. It lacks the admin GUI that mailcow has, but features everything else you need - if you want a web mail UI i suggest you add the roundcube container.
Although configuration happens in files it is sufficiently easy to do. The documentation is a bit quirky in some parts, but I was able to get everything to work the way I wanted. It is running very stable. I am using my own local mail server for submission, even for external email accounts such as with Gmail. The external mail provider is then used as smart host. I love it.
I don’t see the need for containers when hardware is so cheap, the 1st PC I sold was $13,000.00AUD & it was so slow it was unusable.
Plus there is a hugh advantage to having the web server & mail server inside the same instance
This is interesting, I tried a few years back to get gmail to receive emails from our domains & even using DMARC Record Wizard - dmarcian gave up as this seemed so complicated.
Plus Google produces some outstanding BUGs this is my personnel favourite !!!
We found out 25 years ago that due to the only effort by spammers to guess mailbox name left of ‘@’, if you have sub-domains down a few levels then no spam accepted ( NSA ) because they never even try to guess the right hand side of the ‘@’
For this scheme to work, you need an intelligent ‘Contact Us’ form
There doesn’t seem to be much interest in self hosting, I would have though I would have got a lot of questions about my 25+ years experience & I have got NULL very strange, maybe this highlights my lack of knowledge of the surface web ! TOR
I am guessing here but maybe ITs because of the Fear Uncertainty Doubt ( FUD ) from hosting companies like this SH1TE → https://www.eurodns.com/blog/understanding-wildcard-ssl-certificates-a-guide
Let me give you the heads up since this is probably going to my last post here wildcard SSLs have their limits & they are ! highlighted in this post, so US BUG tech want you to waste you precious time, money & get frustrated & give up, self hosting is your one big chance at freedom.
- How do you know there are 8 billion ppl in the world ?
- How do you know that the oceans are rising ?
- How do you know that US BUG Pharma tested their COVID injections ?
If you are interested in scientific investigation & communication of vetted results you should consider we are offering sub-domains for free on self hosted servers in Oz hoping we can use round robin to propagate them around the world as they are ‘flat’ only need a very small amount of disk space, no database server, no IP sprayers, no F5 BIG-IP tin just incredibly cheap instances that cannot be controlled by the criminal elite who think it should be illegal for us to grow our own food & collect our own water.
Any1 interested in freedom of self hosting ?
smartermail for email server. Works on win or Linux, excellent web interface.
Use smtp2go.com for outgoing spam protection