I've set up DKIM wit exim4 on my debian server. Everything is working correctly with one fixed domain, e.g. the following works perfectly fine.
DKIM_DOMAIN = example.com
Now I'm trying to change this to work with multi-domains. So I've changed this to
DKIM_DOMAIN = ${lc:${domain:$h_from}}
(other changes as well as required) - however this breaks because the actual emails are being sent from various *.example.com
. So, I thought I'd use `${sg...} to strip the first part, however I'm having problem getting it right. Whatever I try results in exim spitting out this in the log:
failed to expand dkim_domain: missing } at end of string - could be header name not terminated by colon
The things are made more complicated by the fact that some of the domains are ".com" and others are ".co.uk". As a minimum, I need to cater for example.org
, example.com
and example.co.uk
.
This is what I've got so far:
${sg{${lc:${domain:$h_from}}}{\N^.+\.(example\.(co\.uk|org|com))\$\N}{\$1}}
This again results in the above error message. Can someone please help me resolve this?