1

In exim4, I have a redirect router which changes some headers, including the From: header.

My SMTP transport will DKIM-sign mail if the dkim_domain, dkim_selector, and dkim_private_key parameters are given. These come from a macros, e.g. in the transport:

dkim_domain = DKIM_DOMAIN

where the DKIM_DOMAIN macro is defined as

DKIM_DOMAIN = ${lc:${domain:$h_from:}}

That's all 'normal'. But the problem is that my router is using headers_add to change the From header, but because of this:

This means that references to header lines in string expansions in the transport’s configuration do not “see” the added header lines.

source - see headers_add

the transport is always looking to the original From header, not the rewritten one.

How can I change the macro to somehow look for the domain in a way that the router could affect? I cannot even set a custom transport in the router because it's a redirect router.

1 Answer 1

0

It appears (still testing) this can be done by adding address_data in the router like:

address_data = foo=bar my_dkim_domain=example.com

Then using a macro for dkim_domain like:

${extract{my_dkim_domain}{$address_data}{$value}{${lc:${domain:$h_from:}}}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .