[exim] Return key from db lookup

Inizio della pagina
Delete this message
Reply to this message
Autore: Slavko
Data:  
To: exim-users
Oggetto: [exim] Return key from db lookup
Hi all,

i have working multidomain DKIM signing, which is based on DB (lsearch),
where i have exact (sub) domains listed with appropriate selectors.

Recently i want to extend (improve) it to use default DKIM domain for
subdomains not exactly mentioned in DB. My main goal is to use common
DKIM keys/selectors for subdomains, to simplify DNS settings, as my
provider doesn't provide any API to automate it.

Thus i start to play with partial lsearch, which perfectly works for selectors,
but i am not able to get matching key from DB. I tried to use ret=key, but
that returns looked key (the FROM_DOMAIN contains original):

    dkim_domain = ${lookup{FROM_DOMAIN} partial()lsearch,ret=key{some/file}}


In some/file i have eg.:

    example.org: selector
    sub.example.org: other_selector


And i want/need these results (FROM_DOMAIN -> dkim_domain):

    example.org -> example.org (works)
    sub.example.org -> sub.example.org (works)
    subother.example.org -> example.org (returns subother.example.org)


I want to avoid regex manipulation of lookup result as not enough uneversal
(thu number of name labels is variable) and i would preffer to avoid duplication
of domain name in DB value.

Please, is here way to achieve desired result?

regards

--
Slavko
https://www.slavino.sk/

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/