What the hell is going on?
You have some website that serves customers via email or you have mass mailing service or your customers send emails through your service in their names or ... you got it. But wait, some of these emails got into the spam folders. Or in worst scenarios didn't reach targets at all. Me and my clients being there.
There were no problems years ago, but last times web services and users are getting more and more error mails or their client complaining "there is no your email in my box". Taking provider's imago to the lowest place on earth.
So why this happening and why some developers are frustrated about it? Maybe they don't know how to set their dns or don't know how others' dns settings affect on their services.
I try to explain this problem shortly.
Once upon a time there was a spammer. He likes to sell v.i.a.g.r.a very much. Spending hundreds of hours collecting thousands and thousands email addresses from websites. Maybe he just paid 5€ for million of email addresses. And send them all an enlightening information about those blue pills. But
insert harsh word here, most emails are filtered as a spam. Luckily the spammer was clever one and start sending mails in others' names using others' email addresses as a sender. The spammer was at the seventh heaven.
Until the monster has been born. The monster likes to eat emails, a lot of emails. Best sweeties are those emails that are pretending to be sent by another person. This monster does not separate systems into good and bad ones. It will burn every system that tries to intrude the owners property. Only some magical words like simsalabim will get you safely through.
So why on earth recipient's monsters think that you are a spammer? For the most situations the reason is using 3rd party mass mailing services. They run on different domain than the domain in sender address you are using. This is like holding huge poster saying i'm your sugar frosted enemy and you'll be sure about getting some flames.
But yes, there are these simsalabims, the magic words. We call it SPF - Sender Policy Framework. Correctly used SPF words are the only method to get your message through. The twist is to declare to the monster that the mailing system is admitted by the domain in sender's email address.
So you really have the powers to keep these monsters calm!
You have to put these magic words into your domain's DNS records. The words sounds like - spiff, this sender server is authorized, but others are not
But technically this goes like this:
SPF is added to DNS as a TXT record. You can specify authorized servers in several ways. By referring to domain's current data, as an IP address or as a server domain.
your.net. TXT "v=spf1 mx a:massmailing.system.com -all"
You are telling with
a:massmailing.system.com that the server on massmailing.system.com is authorized to send an email with
your.net domain in the sender's email address, like firstname.lastname@example.org. And with
-all you declare that all other are not authorized. And obviously with
mx you authorize servers in MX records to use your domain, otherwise your emails will not reach the most of your recipients :)
Good luck and have fun with a legal mass mailing!