Live data from Hacker News

How to Run Your Own Mail Server (2017)

c0ffee.net

111–120 of 339 posts

Re: How to Run Your Own Mail Server (2017)

#111
post #23

Icing on the cake: Sprinkle a little Let's Encrypt in there to cover SSL. It doesn't take much to have a cron make a new cert and restart dovecot and postfix. My setup is similar, but it uses MySQL instead of LDAP. I love being able to make aliases and even better - deleting them when I'm done with them.

Author here - I plan on switching to Let’s Encrypt once they support ECC certificates.

While I share your ECC preference, for today I see no reason to refuse free, reasonably secure LE support by default. ECDSA signing with LE's RSA intermediates is supported from Feb 2016, and full ECDSA cert chain will be added on July 2018[1].

[1] https://letsencrypt.org/upcoming-features/

Re: How to Run Your Own Mail Server (2017)

#113
This is a very good guide.

One nice thing about the programs he chose is that their config options are fairly stable (can't vouch for Solr). That many moving pieces would be absolutely unmanageable if the options changed frequently. Been using a similar setup for years without difficulties.

Adding something like fail2ban into the mix wouldn't hurt.

If you're going to do this, first check that your VPS / ISP allow inbound traffic to port 25/tcp. AWS allows it upon special request. GCE doesn't. Don't know about the others. In the US, most residential ISPs block 25/tcp inbound.

Re: How to Run Your Own Mail Server (2017)

#114
post #43

I'd like to run a mail server on a jailbroken iPhone. The use case is to transfer arbitrary files over a local hotspot. I tried installing from the Apple TV tutorial, but it put my iPhone in a boot loop. http://ios-webstack.tk/imap Just a chance, but are there any iOS jailbreakers here who could advise?

What do you mean with 'mail server'? Postfix? Dovecot? Running a Postfix on anything else than a dedicated server with a static IP is a pretty bad idea (half the internet will reject the emails you send). And to do all that just to transfer some files is probably like using an iPhone as a fly swatter.

I don't know why there's so many downvotes and patronising "fly swatter" remarks. There is a use case for this.

For example, sharing a photo album with many pictures. Or a mixtape. Or some song lyrics. I can't upload those to the cloud for copyright reasons.

Or if I want to make the transfer while away from Internet e.g. skiing, hiking, waterfall trip, etc. - there's no access to Internet services, so iCloud/Dropbox/Google Drive just won't do.

I can use lighttpd to serve the folder, but then the user has to hold down and "Save to Camera Roll" for each picture separately.

If both phones have Airdrop, then that's fine. But many phones are not iPhones. We could both install a special app for Bluetooth transfers, but we don't have Internet access, remember? So no app store.

There's a Mail client on every phone, however locked-down it is. If I can serve a collection of files over a local network and send those directly, not one at a time, then that would be very useful to me.

I think a mail server is one solution. If you can propose another flyswatter that meets my requirements, go ahead. Otherwise I still want to find a way to code a mail server, and the parent article is helpful for that.

Re: How to Run Your Own Mail Server (2017)

#115

I've run my own mail server ever since I got something resembling broadband internet in 1996. Back then spam was non-existent, Sendmail was the emperor without clothes about to be dethroned and I hacked sendmail.cf without needing to look at the the bible [1]. I've never regretted running my own server, nor have I ever contemplated moving to a hosted solution. Spam is not a problem either, Spamassassin in combination…

What do you estimate has been your total investment of time in running your own mail server?

Initial setup took a few days of experimenting, that was back in the days of Sendmail. After that is ran fine for a while until spam starting becoming a problem. I eventually implemented a spam filter with Spamassasim with a nightly cron job to train it with spam which made it past the filter. After a few years I added greylisting to the mix which ended up complicating matters a bit due to some common mail hosts (Google and Microsoft being the biggest culprits) breaking the concept of greylisting by using different mail hosts for resend attempts. I made a script to add all SPF-allowed IP ranges for a domain to the whitelist which solved that problem.

Total time spent on the mail infrastructure over these 22 years is negligible, probably ~8 hours per year.

Re: How to Run Your Own Mail Server (2017)

#117

> Before we dive in, an important caveat: You will become a sysadmin of your own mail server. This for me is the deal breaker. I say this as a sysadmin. It's all well and good running a single server but if that shits the bed then you have to deal with it immediately. So to run something that doesn't require 24/7 support I now have to run a cluster of servers. I'll also need something to manage those servers like sal…

You only have to deal with old blacklist entries once when you start your using server. Not a big problem.

Re: How to Run Your Own Mail Server (2017)

#118
post #25

> on FreeBSD using Postfix, Dovecot, Rspamd, and LDAP. That seems like an awful amount of work / overkill. This is not a good introduction for a normal geek, and die-hard open source fans will figure it out without too much trouble anyway. Postfix is not the best choice for novices, FreeBSD is not the most well-supported/documented system just because it's not as popular as some others, and a directory service should…

FreeBSD isn't that bad, but it is different than Linux and the community is smaller. There are some things that the Linux world does better (installing updates), but there are also some things that FreeBSD does better (ZFS, I prefer the split between base and 3rd-party software, etc). The documentation for the base system, however, is very good. The man pages are complete and well-written, and the handbook[0] is a gr…

> FreeBSD isn't that bad, but it is different than Linux and the community is smaller.

Which was my point. I know it's better integrated and has better documentation (some coworkers were fans, plus what I read online about it), but I still think going with mainstream is the better choice when writing a general post like "how to run your own mail server".

Not that guides for "how to run a mail server on FreeBSD" shouldn't exist. Just that then it should be called that, and not be general advice to anyone who might be googling the general title. There's so much bad press for running your own mail server, while really it's not that hard with the right tools and explanations.

Re: How to Run Your Own Mail Server (2017)

#119
post #53

> Before we dive in, an important caveat: You will become a sysadmin of your own mail server. This for me is the deal breaker. I say this as a sysadmin. It's all well and good running a single server but if that shits the bed then you have to deal with it immediately. So to run something that doesn't require 24/7 support I now have to run a cluster of servers. I'll also need something to manage those servers like sal…

I've been running my own mail servers since the mid-90s, and always only a single server. SMTP keeps retrying, so you can be offline. The transport layer was designed to deliver mail to servers even if those servers only dialled in to one of the "internets" once per day, so it's fine to have some downtime. It's totally up to you how you prioritise getting a server back up again, and frankly if the message can't handl…

caveat:

keep your DNS up always - so have a backup if this is running DNS - many mailing list programs and other things will drop a mail immediately if the destination cant be resolved..

Re: How to Run Your Own Mail Server (2017)

#120
post #96
post #25

> on FreeBSD using Postfix, Dovecot, Rspamd, and LDAP. That seems like an awful amount of work / overkill. This is not a good introduction for a normal geek, and die-hard open source fans will figure it out without too much trouble anyway. Postfix is not the best choice for novices, FreeBSD is not the most well-supported/documented system just because it's not as popular as some others, and a directory service should…

Sounds like you did the SNE master. Is it so?

That was creepy. But yes :)
Post reply on HN