Dkim Selector per user/domain

anas_xrt

Verified User
Joined
Aug 5, 2017
Messages
27
Hi,

Currently I multiple subdomain (as domain on nginx) created on the same host, I can see that the DKIM gernerate with public key for each domain difference, but the problem is the Selector both are the same.

I read on this tutorial on https://bynicolas.com/server/exim-multi-domain-dkim-custom-selector/ and I think Directadmin should be able to do is as well. I am not sure can we modify exim base on the same concept to create selector difference for the 2 or more sub domain.

This could be nice to have in future feature for DA as well

Cheers!
 
Sure, you could do it. You'd edit /etc/exim.dkim.conf and take this line:

dkim_selector = x

And you'd replace it with what you want. Based on that tutorial I suppose you'd replace x with:

Code:
${extract{selector}{${lookup{$sender_address_domain}partial-lsearch*{/etc/exim4/dkim/KeyTable}}}{$value}fail}

This looks like the logic they're writing to that KeyTable file:

Code:
echo "${DOMAIN} domain=${DOMAIN} selector=${SELECTOR} privkey=/etc/exim4/dkim/keys/$DOMAIN/${SELECTOR}-${DOMAIN}.privkey" >> /etc/exim4/dkim/KeyTable

You obviously wouldn't need the privkey part there unless you wanted to change dkim_private_key as well in /etc/exim.dkim.conf, but that part really doesn't need modifying to reach your goal.

Though if it's me, personally, I'd suggest that if "x" is causing users to overlap with other systems they send mail from which may require them to use a different selector at one of them, I'd just change "x" to something more unique for my DA servers, for everyone, instead of going unique per domain.
 
Back
Top