For many years, I hosted my email here on my own server, but it was far from ideal. I used Postfix to run the server. I forwarded the email to my Gmail account using Procmail recipes. I read my email on Gmail, and sent email from there too.
That worked most of the time, but if an email had any kind of domain protection such as DKIM or SPF then Gmail was likely to reject the email and unless I was looking at /var/log/mail.log I probably wouldn’t notice. To combat that, I left a copy of every email on this server. Once I knew that email from a domain could get through to Gmail, I added a Procmail rule that forwarded it without backing it up (hint: the vast majority of domains do not have this protection). I installed mutt and learned how to use that through an ssh connection to my server, and I read those emails in a text mode application like some sort of 90’s retro hacker man. Queue up the GIF, please..
I had Postgrey installed to weed out silly attempts at spamming me, and SpamAssassin to stop everything else. It did a good job until it didn’t, and let through too many spams. Various RBLs helped, until they shut down. Then Gmail got pissed and would reject my emails until I put in place Procmail rules to filter out persistent spammers. So, I got pretty good at Procmail too. 🙂
Anyway. After all that I couldn’t send an email from any of my domains without tricking my free Gmail account into accepting email from them, but not really doing it. The details are hazy, but I was able to send from an user@example.com address. A single one per domain. That wasn’t very useful.
So, this summer, I moved my email domains over to Fastmail. The domain hosting this blog hasn’t been moved over, but the email from this server gets sent through there. It works quite well too! I can even send email from any of my wildcard email addresses. It feels wild that I can do that!
There are pretty good filtering rules that let you do all sorts of things. You can even do regular expression matching, which is handy for wildcard addresses containing a specific string. One of my domains gets a TON of spam. I used it in years past to comment on blogs, sign up on various services, and ask for feedback on websites, so it’s been indexed to death by spammers. I still use it though, and with a prefix string, it’s still useful.
In Fastmail, go to Settings->Mail rules->Create rule and then click on “Switch to no-preview rules”. I was able to set up a rule there that matched my prefix string at my domain (for example: john..*@example.com) and labelled any matching emails the way I wanted.
I created another rule using “The spam score” “is at least” 5 (which puts in the spam folder) from that domain to mark those emails read, but that didn’t work. I’ll get in touch with support and ask them about it. It seems that if an email is spammy, then no rules run on it. Boo.
Setting up DKIM and SPF records was simple. I’m thrilled with it and paid up for the next year. Imagine that, paying for email! It’s so nice that Google doesn’t know when I’m going travelling, too.
I discovered today, while digging around in the filtering rules, they have a referral program. If you join up through this Fastmail link you’ll get 10% off your first year. I should have asked someone at work for their referral link. A few people there already use them!
Edit: I contacted support about marking spam as read, for one domain, and they replied overnight. There’s a default setting to enable spam detection. You have to set that to custom, and then add a rule wherever you want spam email to be dealt with. So, if I want email from a certain domain, with a spam score higher than 5 to be marked read before marking it as spam, I can do that now, and it works nicely! Here’s what they said:
This is a result of the order in which Spam filtering and rule application is executed in. You’ll note that in the Settings ? Mail rules menu screen, from top to bottom it reads “Blocked senders, Spam protection, Rules”. This is the same order in which these checks are applied. Spam filtering is applied before mailing rules, and mailing rules are only applied to messages that are being delivered into the Inbox (and so not those marked as Spam).
That said, I can suggest a workaround that will allow you to choose when spam filtering is done. Instead of using the standard spam filter, you can convert the spam filter itself into a rule. That way you can manage it like any other rule moving it to your desired position to execute before or after or in between your rules. You can use the combination of custom spam protection and the filter rules to achieve this:
- Go to the Settings ? Spam Protection? screen to change your Spam Protection level to “Custom”.
- Turn off the “Move messages with a score of X or higher to Spam”.
- Create a new rule in the Settings ? Filters & Rules? screen:
- Click on Create Rule button.
- Switch to no-preview rules.
- Select The spam score (is at least) from the options and put in the number 5 (or whatever other cut-off score you desire).
- Click Add Condition and make it A header called
X-Spam-known-sender
does not match glob patternyes*
.- Click Continue.
- Set the action to Send to spam.
- Give it a Name “Spam filtering” (or anything of your choice to easily identify).
- Save.
After following these steps, your Spam filter will now just be treated like another rule. The rules in your list are again executed in the order they’re presented, from top first to bottom last, so you can drag and drop this new spam rule to control which rules execute before and after it.
Fastmail support