Setting up Postfix + Mailgun for multiple outgoing domains

For quite some time I’ve been having trouble with Gmail categorically classifying most of my outgoing mail as spam purely on the basis of my SMTP host being on a Linode VPS. No matter how much care and feeding went into my SPF+DKIM configuration, the Almighty Google would just arbitrarily decide that no, my email is not to be trusted after all. (This is pretty much the biggest reason why email is bad.)

After a brief kvetch about this with David, he pointed me at Mailgun, an enterprise-level SMTP relay (among other things). I’d looked at SMTP relays in the past but most of them are ridiculously expensive, but Mailgun has one very compelling feature:

It costs 80 cents per 1000 outgoing emails.

I send about 50 emails per month, so that means Mailgun will cost me a whopping… 4 cents per month.

I think I can afford that.

Read more…