215 points · by h0r14 · 8y ago · 136 comments
I do something similar, but when I send an email to a person for the first time, it always ends up in the spam folder by GMail.
By the way, give a look at mail-in-a-box, another cool project that implements a ready to use mail server with great functionalities.
I'm surprised how easy it is, and having fun with sieve scripts :)
Good luck with your endeavour, it is if nothing else a learning experience. But it's important to keep in mind that if email is a critical tool for you (it is for many people, ymmv), toying with it may not be the best idea.
So, without any means to control it myself I'm now in the mercy of fastmail support unless I set up my own postfix/dovecot in the meantime. I guess it goes both ways.
I get the best of both worlds; I don't have to worry about being blocked when I send things, and if I ever have issue with gmail, I can stop using them without losing my email address.
Once that single server goes down it’s suddenly the biggest issue currently keeping us from doing anything. Whether it’s because of something I did or an upstream outage doesn’t matter, I’ve still got to troubleshoot it and try to work around it.
For $5/m you could have FastMail do it for you, or for free you could have Google do it. Yes there are trade offs, but they also have more infrastructure than you do for the same price.
Email is just one of those things I would rather outsource.
However I would advise using dedicated hardware for the server instead for improved privacy. There are two possible routes:
1) Rent a cheap dedicated server such as the Kimsufi line by OVH or the Personal line by Online.net. These cost below 10€ a month.
2) Run the email service on your box at home and use the cheapest VPS you can find just to tunnel a non-dialup IP address to that box using OpenVPN. The cheap VPS usually costs less than $10 per year.
For example, Vultr offers $2.5/mo servers from two locations and they are proven, to be trusted hosting company. In case your IP has a bad reputation (you can test it right after spinning an Instance), you can just shut the server down and create a new one with fresh IP.
Problem with both Kimsufi and Online.net is that if you will get a bad reputation IP it is quite hard to get a new one. I have dealt with OVH and a blacklisted IP I have got on a new server and they were expecting me to contact blacklist providers and request whitelisting, which took time and resources.
For privacy, I think user encrypted email messages provide the best option.
At home self-hosting through VPN is a good idea. It would involve maintaining hardware, which I traded for low cost VPS. With a replica backup MX, I am not married to any hosting provider, and can hop without downtime.
There's a rule in security that anyone in physical possession of your device should be assumed to have access to it. The host has the server whether physical or virtual. You're not safe from them. Trusting them is the tradeoff made for the cheap, hosted server.
" I look at dedicated box more as an upgrade from VPS."
Multiple VPS's share a physical box. A malicious VPS can look for secrets in another VPS using side channels. This isn't possible on bare metal: they have to compromise an app or get a shell first. The next concern would be endpoint security. OpenBSD covers that well. Then, there's host or peripheral firmware which is almost always a risk if a 3rd party is hosting things. Your attack surface does go down, though, when you're not sharing a box with an attacker. There's also the performance benefits.
Virtual machine are secured by the shared host. I don't really expect top security from this end. A replica backup MX enables me to safely change hosts, if they behave badly.
OpenBSD defaults are what I base my endpoint security on, and keeping this updated is super easy.
But some VPS providers allow you to have a reserved IP that you can use as your SMTP IP, keeping it independent of your server instance. I'm about to switch to vultr.com for this feature, which means cleaning another IP but hopefully the last one for a long time.
I know that for many people here DSL does not provide sufficient bandwidth to suffice as the primary home internet connection, and $60/month is pricey if you only plan on using the connection for email, especially compared to a VPS. It is much less expensive than paying for a business account with any of the other ISPs, though.
PTR records are updated from the VPS provider web interface, it takes a few seconds to activate.
Until I did this, my deliverability, especially to GMail, was awful.
ezmlm, for example, will not let you subscribe/unsubscribe
I set up my mailserver, sent a testmail to Google, no spam or other stuff. I don't know if SPF or DKIM was even configured. (It now is of course)
I've been administering mail servers going back over 20 years and I wouldn't recommend it to anyone. The last 4 years or so, things have gotten a lot worse. Google and Microsoft are actively and deliberately making it harder for people to run their own mail servers.
Sure, setting up DKIM and SPF and whatnot isn't hard. But blackholing legitimate mail without any reason, without any form of notification or any possible appeal, well that's just appalling. And sure, Google & MS have tools to debug a subset of mail issues, but those don't even work unless your MTA is sending boatloads of mail to their servers.
If people want to create their own mail service, more power to them - this is supposed to be HACKER news!
And this is precisely why walled gardens are attractive. Because when you realize the work that you have to put in to make federation work you give up and go running back into your walled garden.
But please, don't get me wrong. We need more decentralized email again. But what we need even more than that is less hotmail and less gmail. I feel much better telling someone to pay some $company a small fee for email hosting than I would telling them to suck it up and embrace the pain.
Of course, it's more work than having Google or Fastmail do it, but so what? I'm sure a significant majority of HN readers already have a VPS and domain name of some kind. Setting aside a few hours to set up a mail server on it isn't the indentured servitude many of y'all make it out to be.
If you're worried about monitoring it for operation, make sure there is at least one automated email that passes in each direction once daily. Use pingdom free to check for basic up/down. That should suffice for a personal email system. Email senders will retry for days before giving up.
I say this as someone who has been hosting his own email on his own hardware on his own ISP connection (on OpenBSD no less!) for over a decade, and have never had a delivery issue
Only if you limit your email messages to parties that also use your personal email service.
OpenBSD is a fascinating project, but it is _decades_ behind the state of the art in security.
http://niels.xtdnet.nl/papers/privsep.pdf
http://www.citi.umich.edu/u/provos/ssh/privsep.html
I would have much greater confidence in an OpenBSD project that included lomac or capsicum.
As a concrete example: my personal mail server (on a modern operating system) has its SMTP handling in a separate process from mailbox serving. If the SMTP process is compromised, and the attacker reaches uid=0, it doesn't matter -- no data from the mailboxes can be exfiltrated.
Only SMTP is broken, because mandatory access control prevents the SMTP "root" from doing anything the SMTP daemon would not ordinarily be permitted to do. The SMTP daemon is not empowered to read mailboxes, even if its uid is 0.