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

Top Page
Delete this message
Reply to this message
Author: Todd Lyons
Date:  
To: exim.ml
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 <exim.ml@???> 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 d.domain_key_id=dk.id \
JOIN email AS e ON e.domain_id=d.id \
WHERE d.name="${quote_mysql:DKIM_DOMAIN}" \
AND e.name="${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.

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