Re: [exim] OT: DKIM - but nothing to do with Exim!

Top Page

Reply to this message
Author: Todd Lyons
CC: exim-users
Subject: Re: [exim] OT: DKIM - but nothing to do with Exim!
On Sat, Mar 31, 2012 at 2:05 AM, Ron White <> wrote:
> Now, another domain comes on stream with this shared MTA - say
> 'anotherdomain.null'. How can this ever send mail that is DKIM signed
> when the private key is for somehosting.null?
> Obviously I'm missing something really obvious here in my understanding.
> Can anyone put me out of my misery?

The value for the dkim key is an expanded value, so you can do like
Luca said and create paths with the key files, or you can perform a
lookup and the data returned from that lookup will be what is used. I
do the lookups from a database. Mine is kinda weird and has a bunch
of macros, but basically in the transport, it does this:
dkim_domain = DKIM_DOMAIN
dkim_selector = DKIM_SELECTOR
dkim_private_key = DKIM_PRIVATE_KEY

And the macros it uses are:
(DKIM_DOMAIN is a long ugly complicated macro that I won't post
because it's site specific. In your case, the example posted by Luca
is likely to fit your needs, same for DKIM_LOCAL_PART)

DKIM_DOMAIN = $sender_address_domain
DKIM_LOCAL_PART = $sender_address_local_part
DKIM_DATA = ${lookup mysql {SELECT dk.selector, dk.private_key \
FROM domain_key AS dk \
JOIN domain AS d ON \
JOIN email AS e ON \
WHERE"${quote_mysql:DKIM_DOMAIN}" \
AND"${quote_mysql:DKIM_LOCAL_PART}" }}
DKIM_PRIVATE_KEY = ${extract{private_key}{DKIM_DATA}{$value}{}}
DKIM_SELECTOR = ${extract{selector}{DKIM_DATA}{$value}{}}

I hope this helps to clarify a little bit.

Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. -- Martin Golding