Live data from Hacker News

How to run your own mail server (2017)

c0ffee.net

81–90 of 270 posts

Re: How to run your own mail server (2017)

#81

I'd like to point to another smtp server, which I am using and is much easier to set up than postfix in my opinion, especially for small servers like mine: https://www.opensmtpd.org/ I'm running a personal mailserver (opensmptd, dovecot, dkim, spf, dmarc, spamassassin) for some years now and although I initially had problems with deliverability to google there aren't any (apparent) issues so far. Also I don't underst…

Author here. I actually use OpenSMTPD currently, but I haven't bothered to write a full article about it.

Details of my current setup are here:

https://github.com/cullum/dank-selfhosted

Though this will be out of date soon since I'm moving everything over to Illumos...I have a fondness for dying operating systems I guess!

Re: How to run your own mail server (2017)

#82
post #48
post #20

Although you can run your own mail server, it’s a bit like rolling your own crypto.

It really is not. At most it can be tedious, because it has large surface area of protocols and formats. Most of them other than SMTP and message format are optional. Minimal mail system involves just postfix with config in a bunch of files, delivering mail to a folder on the server, and pretty much everything on top, like SPF,DKIM,DMARC,... is optional. You can ssh to your server from anywhere and run mutt there, or…

Confirming your emails are getting through to providers like gmail is the hard part

Re: How to run your own mail server (2017)

#83
post #22

Then you realize the true pain of having a near-zero reputation when trying to email anything to people on Gmail, Yahoo, Live, etc, etc. Expect to go to spam even if you have DKIM, SPF, and no relaying. If anyone actually knows the secret to not having your own mail-server's mail go to spam on these bigger systems, please tell, I've Googled it for years with no success.

For some reason I never had problems, even after a recent change of my IP address because I moved to a new VPS. Hetzner VPS, proper reverse DNS, SPF, that's all, not even DKIM. The only big ISP that doesn't like my mails is AT&T and I couldn't care less (in Europe, rarely have to deal with people @att.net).

In that case you are very fortunate.

I was running my own mail server for nearly 10 years on Hetzner. Prior to that on other hosts and in the distant past at home. Running mail servers is something I have done professionally and successfully.

The last time I moved boxes as I had many times before. I was on clean IP range but I had no IP reputation at all. In the past this wasn’t such a problem, especially with SPF, DKIM, rDNS, DMARC, server-to-server SSL etc. Around the same time I started having to deal with organisations (legal, etc for a death in the family and later rent) rather my my own circle of friends. It became extremely apparent that my mails weren’t hitting the inbox. But they were being accepted. This was extremely problematic.

I was in the group stating that running your own mail server isn’t hard. I still say that. The hard problem is convincing the big players to let your low volume domains and IPs hit the inbox. I begrudgingly gave up my MX servers last year.

Re: How to run your own mail server (2017)

#84
post #71

The key to get high delivery rates to GMail and Office 365 is to setup DMARC. When you have a proper DMARC configuration (and at least SPF) your delivery problems will suddenly go away. Hosting your own mail server is not rocket science, but you need to have solid sysadmin skills and a good understanding of email as a whole. If anyone is interested in doing this: Start simple with only Postfix and Dovecot, don't use…

DMARC is used for reporting and enforcing SPF/DKIM, I doubt it is used by anything as spam/ham signal.

Re: How to run your own mail server (2017)

#85
post #30

Earlier quoted context omitted.

Agreed! I've been running my own mail server for 20+ years, and I would not recommend that anybody do this on a lark. Deliverability to GMail is a huge problem for me and has been for years. I even asked friends at Google to find out what the story was. All I got back is that the mail group was so careful/paranoid it wouldn't talk to them either. I would long ago have switched over to a vendor, but I use qmail-style…

Funny. I'm somewhat new to the game but my email server has had very few problems delivering anywhere (hosting a small business' email, and personal email for the employees.) I've got spf, dkim, and dmarc. I use tls on everything. Got a static ip (linode) with rdns. I've never had a problem delivering to gmail. For a while i had problems delivering to Hotmail/outlook, but participating in some sort of junk mail repor…

Sounds like you have the same setup I have.

I never get bounces from Google. And after the first day or two of removing yourself from 2 or 3 blacklists, its great.

I use mailcow FWIW

Re: How to run your own mail server (2017)

#88
post #22

Then you realize the true pain of having a near-zero reputation when trying to email anything to people on Gmail, Yahoo, Live, etc, etc. Expect to go to spam even if you have DKIM, SPF, and no relaying. If anyone actually knows the secret to not having your own mail-server's mail go to spam on these bigger systems, please tell, I've Googled it for years with no success.

I run a couple of mail servers and the beginnings are always a bit rough, but then everything works (mostly) fine. I start by asking Microsoft to unban my IP (for some reasons the IP range with my favorite hosting provider are banned by default by MS servers). They lift the ban and since I'm a good netizen and use my servers strictly for the communication with the customers (and never for marketing), I never have any problems with delivering to outlook.com, hotmail.com, etc.

Google is a different beast. Last time I remember I had to do strange things like disabling IPv6 support in my MTA (which is a good idea anyway as I'm not an expert in IPv6) in addition to the usual SPF setup etc. E-mail is delivered in general, but once in a while some letters go into spam for unknown reason. But this happens rarely, maybe a couple a times a year.

Whenever I set up a new server, I have to start from scratch though.

Re: How to run your own mail server (2017)

#89

Kudos to the author for this, this is an endeavor of madness IMHO... The only thing I've ever failed to setup was a functioning mail server using Postfix and Dovecot (it was like ~2007/8). It was a circle of configuration hell I would wish on no one and since then I've never understood why anyone would want to run their own mail server. Pure, unadulterated, hell... I honestly don't even know why we have email at all…

>It was a circle of configuration hell I would wish on no one

>actually sending emails and not being labeled as SPAM is almost impossible

Anecdotal, but I really didn't have any issues with either of the above. Just don't use a tainted IP (protip: basically every cheap VPS provider's IP space is tainted) and set up SPF/DKIM properly. Following a tutorial is probably the way to go if you're not familiar with Postfix/Dovecot. And as you mentioned, once you have it up and running it's basically zero maintenance.

>making sure your service is literally ALWAYS available, is really quite tricky. It's pretty damn easy to miss some emails.

Mail standards actually make it really hard to miss emails. Every mail service will, by default, retry delivering mail for 4 days (!). This is the default in MTAs and the big boys (Gmail, etc) do the same. If you want to be more HA you can set up backup MXes but that's overkill for a personal server.

Re: How to run your own mail server (2017)

#90
post #48
post #20

Although you can run your own mail server, it’s a bit like rolling your own crypto.

It really is not. At most it can be tedious, because it has large surface area of protocols and formats. Most of them other than SMTP and message format are optional. Minimal mail system involves just postfix with config in a bunch of files, delivering mail to a folder on the server, and pretty much everything on top, like SPF,DKIM,DMARC,... is optional. You can ssh to your server from anywhere and run mutt there, or…

> Minimal mail system involves just postfix with config in a bunch of files

Minimal mail system involves just OpenSMTPD with a few lines of config in a single file.

Post reply on HN