Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

Is it OK if I sign a subset of domain emails, or is this an all-or-nothing game?

We use Amazon's Simple-Email-Service for sending e-commerce emails.

We would like to sign these with DKIM.

This same domain is also used for all email addresses for the corporation behind this e-commerce operation.

Due to some IT constraints, it does not look like we'll be able to sign the employee emails for many months to come.

Do spam protection servers look at the domain and see a DKIM public key and say, "OK, all emails must be signed", or do they look email-by-email and, if a signature is found, then they go looking for the public key?

share|improve this question
2  
Without directly knowing the answer to this question, you could always use a simple workaround: make Amazon SES send mail from something@e.yourdomain.com, and then only use DKIM on e.yourdomain.com. –  ZiggyTheHamster Apr 26 '12 at 21:42
add comment

migrated from stackoverflow.com Apr 30 '12 at 19:41

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 8 down vote accepted
+50

DKIM doesn't tell you anything about whether a message is spam or not (although it's a bit more work to set up, there's plenty of spam that is signed with a valid DKIM signature). DKIM is all about identity - do I know that this message is from the specified sender (and that it hasn't been altered in any meaningful way)?

No good anti-spam service will reject a message solely based on a lack of a DKIM signature. If there is an invalid signature, then that's something to consider (i.e. maybe this is phishing); however, it's risky to reject in this case (because signatures can get broken in transit), and most anti-spam filters will not do that (at least by default).

The use of DKIM (without anything else) is to allow the mail client to indicate to the user that the message sender is verified (much as browsers indicate to the user that traffic is sent over SSL, or that a certificate is trusted).

So, the simple answer is yes, it is useful to sign messages, even if you cannot sign them all. You can't tell your users that they should only trust messages that are signed, but they can at least trust some of them. (Unfortunately, not a lot of mail clients yet expose this information, and users aren't yet trained to look for it, so the benefits aren't large - yet).

The simple answer to the second question is no, any decent spam filter will ignore the lack of a DKIM signature.

Further to this, there are two ways you can extend your use of DKIM, that do have an impact when only some messages are signed.

Author Domain Signing Practices (ADSP) is an optional extension to DKIM where you specify what should happen to unsigned messages. Specifically, you can select from three choices:

  • unknown (this the behaviour you get if you don't use ADSP) - the domain signs some or all mail (or none, I suppose, although it would be then odd to have the record set up)
  • all - the domain signs all mail. The recipient (or their anti-spam filter) gets to choose what to do with messages that don't have a valid signature; commonly these would be put into some sort of quarantine or flagged in some way so that the user is aware that they are probably fraudulent.
  • discardable - the domain signs all mail, and is instructing the recipient (or their anti-spam filter) to silently discard any messages that don't have a valid signature. This is the same as "all", except that the sender, rather than the recipient, makes the decision about what to do with messages without a valid signature. Anti-spam (or anti-phishing, in this case) filters don't have to obey an ADSP instruction, but they are likely to.

So right now, you should either ensure that you don't have an ADSP record, or that if you do it is set to "unknown". Once you are able to sign all messages, you could move to "all" or "discardable", depending on what behaviour you would like.

Similar (but newer) to ADSP is Domain-based Message Authentication, Reporting & Conformance (DMARC). DMARC incorporates policies for both SPF failures and DKIM failures, and incorporates information about providing feedback (to the supposed sender domain) about failures. You've got basically the same choices as with ADSP, but more flexibility about how to work. The example the specification provides as to how you'd start using DKIM/SPF is roughly this:

  1. Deploy DKIM and SPF.
  2. Publish a DMARC policy of "none" with a feedback reporting address (this is like ADSP's "unknown", except that you also state that you want feedback about failures, so if they are really from you, you can figure out how to fix the problem).
  3. Tune your DKIM/SPF use until the feedback reports indicate that all your mail is appropriately authenticated.
  4. Increase the DMARC policy strength to "quarantine" for a small percentage (this instructs the receiver to quarantine any messages that don't meet the policy, but only for a randomly selected percentage of mail).
  5. Gradually increase the percentage (to 100%) as you get more confident that all mail is appropriately authenticated.
  6. Set a DMARC policy of "reject" (again with a small percentage to start with, building over time to 100%), so that rather than quarantining, messages that don't meet the policy are simply rejected.

DMARC is new, so only a few anti-spam filters are using it at present, but that will (probably) increase over time, and there's little cost in adopting it now.

If you choose to use DMARC, then right now you could get to step 2, and then continue through the steps as you manage to get all mail signed.

share|improve this answer
add comment

I don't think there's a definite answer to this question. There are so many spam filters and they all work differently, so it's hard to predict how they would treat this condition.

My gut feeling is that you're definitely increasing the chances of your corporate mail getting blocked if your DNS indicates that it supports DKIM, yet the message does not bear any DKIM signatures. For example, Gmail appear to check this for ebay and paypal. This is however a rather specific case, and I can't imagine that Google can apply this to any domain, given that not all domains can guarantee all emails are DKIM signed.

RFC 4870 states that the signing domain (you) can specify an Outbound Signing Policy for your emails via DNS, specifically:

o = Outbound Signing policy ("-" means that this domain signs all email; "~" is the default and means that this domain may sign some email with DomainKeys).

So in theory, spam filters should honour this, if you specify that not all emails are signed.

However, this RFC has been superseded by RFC 4871 - in which I couldn't find a similar section...

I think this just illustrates how vague the situation might be, and how one spam filter might decide to take completely different actions from another...

share|improve this answer
    
Other than ADSP and DMARC, there are "backchannel" discussions among mail providers and companies that provide filtering services, and so it's fairly simple to arrange the same outcomes outside of ADSP/DMARC if necessary (if you're part of this industry, then you probably know someone that can invite you into these discussions). That doesn't scale as well as ADSP/DMARC, of course (and for the case of PayPal, owned by eBay, there is an ADSP "discardable" record). –  Tony Meyer May 1 '12 at 0:45
    
RFC 4870 is "DomainKeys", which is completely deprecated now, in favour of DKIM (which is not the same thing: it's a merger of DomainKeys and Identified Internet Mail). The signing policy parts for DKIM are in RFC 5617 (ADSP). –  Tony Meyer May 1 '12 at 0:47
    
Thanks @TonyMeyer. I think this just illustrates my point. There is so much stuff out there, and it's so confusing, it's really hard to know what a spam filter author chooses to implement and what interpretations they might apply to (the existence or lack of) DKIM signatures. –  Yoav Aner May 1 '12 at 8:48
    
For the little filters or the DIY ones, sure. Anyone that works on a filter that handles any significant volume of mail will deal with this properly (which means not discarding unsigned mail, unless there is a policy that requests that behaviour). Developers of filters play close attention to what's required, and also communicate a lot with each other. –  Tony Meyer May 2 '12 at 10:50
    
I wasn't suggesting that filters necessarily discard unsigned email, that's highly unlikely. But since most filters calculate some score based on multiple factors, it's entirely possible, and in my opinion even likely that it negatively impacts an email's score if the domain specified a DKIM key yet the email isn't signed. At least with some filters, or based on how they might be configured. –  Yoav Aner May 2 '12 at 12:38
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.