Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I followed these instructions to setup OpenDKIM with Postfix, and it works as advertised. My outgoing mails have the DKIM-Signature header added, for example:

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=example.com; s=mail;
t=1398638300; bh=mk/7yYUxFCWz+ZHB0opJIA/S3J5ELoPZPfAO0KQdVg4=;
h=Date:From:To:Subject:From;
b=fPPfUliJUgA0re38nkJ2R18TeFgbamOv1U8nDb9958eTeAT6Mp7oq4WGrHPiPmc+b
mrLu9RuW0/S4d0ipkilNZDxgecwl7qttrDbTEkWxdhwwTSe5FL3OBaUoUxJFrMGjmY
RdBjY5ZWtvk29+gXZ+af5Of9OrY7COLlqGkFXRXw=

My question is about the d= parameter above. In cases where one mailserver handles the outgoing mail of multiple virtual domains, should the d= contain the mailserver sending the message? Or should it be the domain that appears in the From: address?

I have tried to read RFC 6376 about this subject, but the only relevant bit I found was:

  d= The SDID claiming responsibility for an introduction of a message
  into the mail stream [...]  The conventions and semantics used by a Signer to
  create and use a specific SDID are outside the scope of this specification

I'm hoping someone here knows how the d= parameter is used in practice.

share|improve this question

5 Answers 5

up vote 2 down vote accepted

A DKIM signature from the sender's domain is most reliable, and may be required by the sender's email policies. With the introduction of DMARC it is now possible for domains to publish a policy with desired actions for email which does not meet the policy.

DKIM is intended to match the sender from the header, which may not be the envelope sender. SPF validates the permission of the envelope sender to send mail for the domain using the sending server. DMARC ties the two together, to provide a better policy framework.

All three mechanisms require data to be published in the DNS tree of the domain involved.

DKIM from a third party merely indicates whether or not the signed content has been modified after signing by that domains. This may be useful for repudiation, but not for sender reputation.

share|improve this answer

You are looking at the question from the wrong point of view - that of the sender. You should be looking it from the point of view of the receiver.

So let's say we have a person@foo.com sending a message to us via mailserver random.com. We know nothing about either domain. Does a signature from foo.com on an email coming from person@foo.com tell you anything? Clearly it does, as foo.com is in a position to say something about email accounts it controls. What does a signature from random.com on an email from person@foo.com tell you? Very little. random.com could be controlled by a spammer, sending spam that claim to be from person@foo.com to get past your filters. So if you know nothing about random.com it's signature also means nothing.

Also, remember permissible for a email to contain multiple DKIM signatures. So if you run a mailing list, a message sent to the list might contain a signature from the domain in the From header. The mailing list might them also sign it, using the list's domain as it appears in the envelope. Both give useful information to the receiver in helping them to decide whether to trust the message.

share|improve this answer
    
Well, if the sender's domain MX records point to random.com, then I could easily verify that the sender allows random.com to take care of his mail, right? –  hedgie Apr 28 at 6:21
    
@hedgie MX is only relevant for mail delivery to that domain. It says nothing regarding who is allowed to send mail. –  Håkan Lindqvist Apr 28 at 12:09

In DKIM there is no requirement for the d= value (or the related i= value) to match any other headers in the message. DKIM in itself only authenticates the signer, not the sender, leaving it to the recipient to implement some policy to make this information useful.

DMARC allows the sender domain to specify policies for DKIM, making a DKIM signature much more useful for the recipient. With DMARC the d= and the From: headers must match (either exactly or allowing subdomains, depending on the specified strictness).

For OpenDKIM you will want to look at the SigningTable and KeyTable configuration directives to properly deal with multiple domains.

share|improve this answer

Looking at a few mails from Gmail, I found the d parameter to contain the domain of the envelope sender. So, the address used in the MAIL From SMTP command, is the one being used in the d parameter.

I can't think of any other way of deciding the domain, which would make more sense, than using the envelope sender.

share|improve this answer

DKIM is domain based. It only tells about the signing domain of an email. If you use d=esp.com that is the domain of Email Service Provider, then receiving mail system will use the reputation of esp.com to decide about the email. And if d=customer.com (e.g. domain for From: address) is used then customer.com's reputation score will be used. So if esp.com has high reputation, then it would be wise to use d=esp.com. Otherwise stick with d=customer.com

From RFC 8376 standard:

Once the signature has been verified, that information MUST be conveyed to the Identity Assessor (such as an explicit allow/ whitelist and reputation system) and/or to the end user. If the SDID is not the same as the address in the From: header field, the mail system SHOULD take pains to ensure that the actual SDID is clear to the reader.

SDID : Signing Domain Identifier (=d)

UPDATE:

More on Author based signature vs Third party signature from dkim.org spec:

A signature whose domain does not match the domain of the RFC5322.From address is sometimes referred to as a third party signature. ... Although there is often heated debate about the value of third party signatures...

For some, a signature unrelated to the author domain (the domain in the RFC5322.From address) is less valuable because there is an assumption that the presence of an author signature guarantees that the use of the address in the RFC5322.From header is authorized.

For others, that relevance is tied strictly to the recorded behavioral data assigned to the identity in question, i.e. its trust assessment or reputation...It is therefore low risk to facilitate the delivery of messages that contain a valid signature of a domain with a strong positive reputation, independent of whether or not that domain is associated with the address in the RFC5322.From header field of the message.

share|improve this answer

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.