-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[TODO]: Consider rspamd DKIM config to use selector_map #3778
Copy link
Copy link
Open
Labels
area/configuration (file)area/scriptskind/improvementImprove an existing feature, configuration file or the documentationImprove an existing feature, configuration file or the documentationmeta/help wantedThe OP requests help from others - chime in! :DThe OP requests help from others - chime in! :Dservice/security/dkim-dmarc-spfservice/security/rspamdstale-bot/ignoreIndicates that this issue / PR shall not be closed by our stale-checking CIIndicates that this issue / PR shall not be closed by our stale-checking CI
Metadata
Metadata
Assignees
Labels
area/configuration (file)area/scriptskind/improvementImprove an existing feature, configuration file or the documentationImprove an existing feature, configuration file or the documentationmeta/help wantedThe OP requests help from others - chime in! :DThe OP requests help from others - chime in! :Dservice/security/dkim-dmarc-spfservice/security/rspamdstale-bot/ignoreIndicates that this issue / PR shall not be closed by our stale-checking CIIndicates that this issue / PR shall not be closed by our stale-checking CI
Description
Referencing my review comment here,
selector_mapmight be a good approach for automating generation of multiple DKIM selectors when necessary. It's unlikely our path convention would change, and as per the PR contribution, a standard path convention / template can use variables for the selector (with a default fallback) and domain.try_fallback = true;AFAIK is to permit fallback to that defaultselectorvariable.pathis the template used, where$domainis the domain being handled (defaults to MIMEFrom(message header), not SMTPFrommail header (envelope sender) although you can configure for that), and$selectorwill either bemailfrom above, or changed to a matching selector if found inselector_map.A
selector_mapis just a key/value pair per line delimiting key/values by white-space. If a domain matches, it'll use that selector:Additional Notes
I'm not 100% sure how that works for domains with multiple selectors available. Such as to support both RSA and ECC DKIM keys.
The
pathexample uses the Docker config volume directly, but would probably be an internal location that the files are copied to. It's ideally unified with OpenDKIM config to share a common location for keys as these should technically be no different. It's a question raised by users several times about migrating to rspamd if they need to generate keys again or can use the same ones created for OpenDKIM without much friction.$domainis additionally derived fromuse_domain(what part of the mail to source the domain from, or a fixed domain)use_esld = true(_normalize domains to eSLD (effective second-level domain))use_domainanduse_esldcontribute to defining the$domainvariable:pathsetting #3702 (comment)pathsetting #3702 (comment)The unified DKIM path and generation is related to #3630
UPDATE: Sep 2025 example reference (easy to adapt to using
selector_map). I provide some useful insights there for reproduction/testing, along with noting thatuse_esldis specifically for domains in the public suffix list (PSL), which excludes.test.