Imagine going out of town for like a week and the moment you leave your self-hosted mail server goes down and you can't send or receive emails the entire time
post
If my understanding is correct, reputation building would be nigh impossible for a self-hosted server.
I host my own email and reputation has been a huge problem. I don’t send spam, but they just block whole subnets. When I fill out the appeal form, I never hear back and nothing ever happens. It is very frustrating. I’m using DKIM, SPF, and all the other stuff. Still having problems. :(
Depending what you find acceptable there are things you can do. For example at work we proxy through a mailgun account to do simple smtp notifications from bash scripts and webapps.I would imagine you could also proxy from an email server.
And you can at least manage your own email domain accounts via various webhosts. This may not meet your criteria for self hosted but its more independent then using gmail.
So it boils down to it's doable but it requires a lot of effort and dedication.
Instead of trying to build reputation, you can buy it. Pick a reputable spam solution that offers accounts for like $3-5/m and route all mail through it.
Still your server, your mail, but you're buying their business reputation, and getting some spam filtering back. Plus you might get some protection from outages or maintenance windows if they can cache some mail for delivery for you
You can just use a relay for your first hop that's what I do since my ISP finally got round to adding my IP to the PBL. There are some that have a more reasonable amount of deliveries in their free tier than others.
I host my mail server on a VPS.
I suggest making sure you get DMARC / DKIM / SPF working, and having an anti-spam strategy (greylisting helps, but there are a few ASNs that just exist to send spam). Also make sure your IP is not on any public spam list.
The next problem you might face is that Microsoft and especially Google like to make it hard for anyone not using their services. With Microsoft, you fill in a form and jump through some hoops and they'll start accepting your email enough to land it in spam. Unless you are regularly sending to Microsoft, it is hard to keep them accepting mail, but just sending to a free Hotmail address (owned and occasionally marked as read and deleted by you!) on cron is enough to keep occasional mail deliverable as long as none of your mail ever gets marked as spam. Google can be more of a pain to small email servers in terms of not landing in spam, but I think occasional reports of not spam will help you.
In terms of keeping down spam:
- postgrey or similar for greylisting keeps out the least serious spammers.
- The notorious spammers / bulletproof hosting is best blocked by ASN since they regularly shift IP addresses. Try a script like this on daily cron (assuming you jump to the custom BAD_AS table from your INPUT iptables rule) - please don't run it too often since routeviews is a free public service and you should be respectful of them:
#!/bin/bash -e
TEMPDIR=$(mktemp -d)
trap 'rm -r "$TEMPDIR"' EXIT
curl https://archive.routeviews.org/oix-route-views/oix-full-snapshot-latest.dat.bz2 -Lo "$TEMPDIR/snapshot.bz2"
bzgrep -e " (15828|213035|400377|399471|210654|46573|211252|62904|135542|132372|36352|209641|7552|36352|12876|53667|138608|150393|60781|138607) i" $TEMPDIR/snapshot.bz2 | cut -d" " -f 3 | sort | uniq > $TEMPDIR/badranges
iptables -N BAD_AS || true
iptables -D INPUT -j BAD_AS || true
iptables -A INPUT -j BAD_AS
iptables -F BAD_AS
for ROUTE in $(cat "$TEMPDIR/badranges"); do
iptables -A BAD_AS -s $ROUTE -j DROP;
done
- Despite Google being so hostile to very infrequent emails from IPs that have years of never sending spam, just because they are small, Gmail and Firebase are one of the most significant spam sources. I find client-side filtering works best for things like that which get through your other defences.
- Another spam source is Docusign. These types of companies tend to shut down individual scammer / spammer accounts, but then allow them back in for the same scam with another account.
Note that of the spam that gets through if you have the basic defences, it's probably a similar level to big corporate hosted mail, so don't let this deter you (I just hate spammers).
What about purely receiving emails? Receiving them isn't anywhere near as bad as sending. My friend uses his own server/domain for his "spam mail"/dgaf accounts. He can use whatever address he wants and it goes into a catch all bucket. It makes it easy to track when your email is sold/leaked, but none of the finickyness of like plus tags in gmail
I selfhost mail and have no problem receiving. The only problem is spam. However I've found that just dropping anything that isn't over TLS and passes SPF is fine. I don't use a spam filter.
Not if you want your emails to be reliably delivered. Even if you set up all of the right things and follow all of the rules, you will probably always be fighting to stay out of the spam folder.
I self host mine and it works. It is quite hard to set up at first but once you have configured it correctly it is satisfying.
It really depends on what you want to accomplish, your priorities, the amount of time and effort you are willing/able to put into it, and your risk appetite (not just privacy but also availability of your mail server).
It is for sure one of the more challenging services to self-host, and IMO doesn’t offer a huge improvement over a hosted solution with your own domain from an actual security and privacy standards point since email is inherently insecure and non-privacy protecting without adding additional not-always-standard layers on top like PGP/GPG, SMIME, one-time passcode escrow systems, etc. that all have their own huge trade offs.
Your self-hosted server will have downtime as well, some planned but also some unplanned. If your server is down, it can’t accept or send mail obviously which can be an issue (many services will try to deliver again after a back off period, but won’t try forever). Enterprises work around this with load balanced servers and running different services on fault tolerant infrastructure. That increases complexity quickly though and isn't what most self hosters do AFAIK.
Depending on how you define "self-hosting", I may qualify at that.
I've hosted my email on a remote VPS myself. I have not hosted the machine in my apartment.
I used postfix + dovecot + mysql stack, I have to admit it was the hardest thing I've ever configured and I've hosted a lot of services in my life.
In the end I ended up switching to the free service that came with the domain became no matter what I did and how compliant I was to dkim and SMARC and tkip (I'm probably butchering the name here, it's been a long time) outlook accounts kept sending my emails to spam, everything else worked fine, even gmail, but DAMN Microsoft and how much I hate that company managed to fuck over me one final time even after years after I switch to Linux. I tried everything even the form to remove my email from spam.
Tl;Dr hosted email on a vps but couldn't get past outlook spam filters
I THINK im aware of the technicalities
Not to promote the service (they've stopped accepting new users anyway) but here's a overview of what you'd have to take on. He'a a professional who runs his thing as a hobby.
Well, i guess a lot of them are merely nice-to-have's.
I do it with mailcow. AFAIK gmail is the only provider still sending me directly to spam, which isn't a problem for me. I probably send less than 10 emails per month total though. My ISP also hasn't ever changed my public IP, so thats something to consider if your ISP does.
gmail is the only provider still sending me directly to spam
Do you have a gMail account? Start a convo with yourself by sending from the gMail account first. Also add your other eMail to the gMail address book.
It’s been about two decades since I had to do this for myself, but it worked well at the time.
If you have a relay or SEG it’s not to hard. Dealing with spam can be a problem.
Availability can be an issue, and creating an HA email server starts to get pricy.
There’s a reason email administration can be a full time job.
There’s a good write up on grc.com about it, or maybe security now ep.
You can do it for sure, but it’s a fight.
I've hosted mine for decades. Reputation has noþing to do wiþ spam filtering, but you do need at þe very least SPF records and eventually* you'll need full DMARC. Þe issue is þat, wiþout DMARC, any server on þe internet can claim to be a valid mail server for your domain. DMARC lets you restrict it to your own servers.
Self hosting email isn't hard; properly securing and protecting it is more work. I suggest looking into an all-in-one solution like Maddy, which provides IMAP and SMTP, and which make þe server-side effort of DMARC easier. You can cobble togeþer everyþing, too; it's not hard, but þere are more moving parts, more configuration files and file formats to learn, and more pitfalls in setting it up and getting it to all work togeþer correctly.
- Like, soon. Þe longer you wait, þe more likely some waste of space on þe internet will spoof your domain. Get it set up and working first, þen do DMARC þe next day. Or do it all in one go, it's just a bigger bite to take all at once, and it isn't strictly necessary: you can do it in steps, as long as you don't delay DMARC by too much.
Just to emphasize it is the reputation problem and getting common mail providers the accept. You'll need to get a well known domain like a .net or .com domain. You probably need to have a web site too on the domain. Then let that stuff age. You'll also need to get a static IP for the VPS your using that has a good reputation and your hosting provider will have to allow you to send email which means you'll have to talk with them to make sure everything it setup. You'll also probably want certs both for the website, and for your SMTP server. Then there are SPF, DKIM, DMARK, and DNS configuration you'll have to make too. Optional other configs like MTA-STS, or DANE. Just a lot of detail. Once your setup, there are testing sites you can go to test or SMTP server.
Another issue is you want email to be full time. So I think that probably means 2 incoming mail servers on two different VPS systems maybe in two different data centers. Then you need IMAP, and maybe a webmail system. I guess these last two could be one one of the VPS systems hosting one of the SMTP servers. Lot of components.
I don't actually using my own VPS based mail system for my main email addresses. Instead we use a shared hosting plan and our own domain instead. You might want to look at is Namecheap CPanel Email that Comes with their Stellar Hosting plan. That is what we use. You can use up to 30 addresses on their base plan and maybe unlimited on the next level up. It is less then $100 per year after you add all you need, the hosting plan, a domain, and certs (maybe more in the $60 range?). The advantage of this, the hosting provider takes care of the infrastructure, and it is cheaper and lest time consuming then two VPS systems and all the work to maintain them.
About getting other providers to accept your mail, I've found Yahoo and the domains they serve to be one of the worst offenders.
top 29 comments