![]() |
| Email Tips: Spoofing, SPF, and DomainKeys |
|
jamie
HostMySite Sales Rep
![]()
|
This article is meant to help email users with questions on email spoofing and how to prevent it.
First of all, email spoofing is defined as email that fakes its FROM address. In practice, this is VERY easy to do, and anyone that tells you it can be prevented is technically lying. I can create a script or mailing domain on ANY of the HostMySite webservers or mailservers right now that sends mail as if it were from someuser@hotmail.com even though our servers are NOT the hotmail servers. The reason for this is quite simple - one can create an outbound email message and define all of its characteristics, including the FROM field, using any number of scripting languages or email progams. This particular functionality is due to the inherent insecurity in the SMTP protocol - a set of standards that was created over 20 years ago and its creators never imagined that it would achieve such longevity. In recent years this protocol has been expanded upon in an effort to prevent spammers from creating misleading emails, i.e. messages that 'spoof' the FROM address in their header and claim to be from somewhere they aren't. Two major efforts in this direction are SPF records and DomainKeys/DKIM. More information on these two anti-spoofing techniques can be found at the following websites: http://www.openspf.org/ (SPF Records) http://www.dkim.org/ (DomainKeys or DKIM - DomainKeys Identified Mail) In addition, I would recommend looking up both protocols in Wikipedia. Here's a short summary of both for fans of brevity: SPF Records: Uses a unique TXT record in the sending domain's DNS Zone to identify the mailservers that are allowed to send mail for a given domain. DomainKeys: (From Wikipedia, since I'm not as familiar with this technology) DKIM adds a header named "DKIM-Signature" that contains a digital signature of the contents (headers and body) of the mail message. The receiving SMTP server then uses the name of the domain from which the mail originated, the string _domainkey, and a selector from the header to perform a DNS lookup. The returned data includes the domain's public key. The receiver can then decrypt the hash value in the header field and at the same time recalculate the hash value for the mail message (headers and body) that was received. If the two values match, this cryptographically proves that the mail originated at the purported domain and has not been tampered with in transit. In short, both use DNS to verify that a message comes from the domain that it states in the FROM field of the message header. So, why doesn't this prevent spoofing completely? 1. Because the recipient mailserver still has to check for the existence of the anti-spoofing elements. If it's not checking, the message will still go through as normal. 2. Because the existence of anti-spoofing technology does NOT prevent the spammer from sending mail, it just provides the recipient a way to verify the mail. This means that EVEN IF you add anti-spoofing technology to your domain name, that does not prevent spammers from spoofing your domain! However, it DOES give recipients a method in which to validate your mail. If they aren't validating, there is nothing you can do to prevent others from 'faking' your domain name though. As of this post, most if not all major commercial email providers have SPF or DomainKeys technology implemented, and all anti-spam agencies (i.e., Postini) most certainly do. So, if you have a Yahoo, MSN, Gmail, etc account then your mail is most certainly filtered in this manner. If your email accounts are on a private commercial webhost (HostMySite, 1and1, GoDaddy, Rackspace, etc.) then such technology may exist but it may not be enabled by default. So, as you can see using SPF/DomainKeys on the domains that you control will help your messages deliver, and also help prevent others from spoofing your domain, however in practice there may be some implementation that needs to be done in order to make this happen. HostMySite, for example, offers the ability to create SPF records or DomainKeys for any of the domains hosted on it's network, however due to the nature of said records they cannot be created automatically and must instead be specifically requested from Support, since our technicians would need to know exactly where you are sending mail from in order to properly configure these technologies. As an important side note, many times you will recieve a message from user@domain.xyz, where user@domain.xyz is YOUR EMAIL address. This is a VERY common practice by spammers, but it doesn't mean that they are sending out thousands (or millions) of messages with your address as the FROM address. What is happening here is the spammer is using a script that dynamically changes the FROM address to match whatever address the message is delivering to. So, in my case my address is jamie@hostmysite.com so the message will appear to be from jamie@hostmysite.com. If your address is joe@smith.com, you could be on the SAME spammer's mailing list and the message would appear to come from joe@smith.com, NOT jamie@hostmysite.com. The lesson here: if you recieve such a message the best way to prevent it is to make sure your domain is configured with DomainKeys or SPF (or in a perfect world, both) then make sure your mailserver is configured to REJECT all messages that don't conform to these anti-spoofing technologies. The good news is that EVERY mailserver that can be configured for DomainKeys/SPF also has the ability to allow messages in which the domain that the message appears to be from doesn't have DomainKeys/SPF enabled. In other words, if someone is sending you a message and does not have anti-spoofing technology in place, the message will still deliver. However, if they are sending you a message and they DO have anti-spoofing technology in place, your mailserver will validate the message and make certain that it is coming from where it claims to be coming from. |
||||||||||||
|
|
|||||||||||||
|
Jason101
Forum Regular
|
Thanks for the tips Jamie. A whle back my clients were having a problem getting mail through to Yahoo. Yahoo was bouncing all email from our server. We wrote yahoo and they replied stating that the mail coming from our server could not be verified. So we then implemented Domain Keys in SmarterMail 5, as well as SPF records, and ever since then there has not been a single problem with yahoo rejection mail from our servers.
|
||||||||||||
|
|
|||||||||||||
|
jamie
HostMySite Sales Rep
![]()
|
Yahoo is notoriously difficult to deliver to - I think they take pride in the obscure nature of their SMTP error messages.
|
||||||||||||
|
|
|||||||||||||
|
EricBourland
|
Jamie, this is a great recapitulation. Thanks for this.
Eric |
||||||||||||
|
|
|||||||||||||
|
jamie
HostMySite Sales Rep
![]()
|
Thanks, even though I had to look up the word 'recapitulation' to find out what you just said.
|
||||||||||||
|
|
|||||||||||||
|
whitesites
Forum Regular
|
Nice Article Jamie,
I personally might write a little how to article that takes users step by step though setting up SmarterMail 5.x with DomainKeys, SPF, RDNS, RBLs, ext... I have all these setup on my VPS and I get maybe 2 Spam emails / day. And of course they end up in my spam folder. Used to get hundreds everyday. Also If you are really serious about killing spam, enable Grey Listing. This seems to kill most spam. I Wish HMS would add some of the more popular RBLs to their shared mail servers. |
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
I agree... Greylisting is a Godsend for the time being. Do you have problems with gmail/yahoo/hotmail users not being able to reach your clients, though? I do, so I've began matching class c masks vs class d, and the problems pretty much cleared up and there hasn't been any influx of spam making its way to the inbox.
As far as RBL's, Barracude, Zen(Spamhaus), NJABL, SpamCop, and SURBL (in that order) are all I keep running, and those handle most of anything else that gets thru. Although I must admit that Barracuda handles >99% of anything caught... the others seem just to be for good measure. |
||||||||||||
|
|
|||||||||||||
| instructions |
|
kurt
|
If anyone's looking for the instructions to install DomainKey, I found them here:
http://www.hostmysite.com/support/smartermail5/domainkey/ |
||||||||||||
|
|
|||||||||||||
|
funkthis
|
Great -- this is very helpful. Now if we create a key for DKIM using SmarterMail5 and e-mail it to Support, will every e-mail originating from our mail server be automatically signed with the key? I'm assuming that's the case, even though we are creating the key in SmarterMail.
Also, has anyone had luck adding Gmail's mail servers/IPs to their SPF Records? We have several users that send e-mail from our domain using Gmail. Thanks! |
||||||||||||
|
|
|||||||||||||
|
kurt
|
After support installed it, I found a website to test it. I used outlook to send an email and it passed their DKIM test.
|
||||||||||||
|
|
|||||||||||||
|
rmathus
|
If you generate the domainkey and send it to us, all outgoing mail will be signed with the key. Also, you can use http://www.mailradar.com/domainkeys/ to test the domainkey after it's added. Basically you send an email to the randomly generated email on that site, wait a few minutes, test it, and you should see "PASSED" as the result.
|
||||||||||||
|
|
|||||||||||||
| Email Tips: Spoofing, SPF, and DomainKeys |
|
||
|



