[exim] headers_add

Page principale
Supprimer ce message
Répondre à ce message
Auteur: jesk
Date:  
À: exim-users
Sujet: [exim] headers_add
Hello,

i want that the X-Envelope-To header is added. The value for this should be
taken out of Rcpt-to.


The problem is that when inserting it into one of my routers that the
X-Envelope-To line will only be created when a router matchs,
so i have to insert it into every router. when inserting it into every
router the X-Envelope-To value wont be the value that i want, because
the recipient will sometimes be rewritten inside of my routers and then its
not the original rcpt-to which i want to have.
so my first router append the right value, but the second router create it
again an append the new value taken out of the new $local_part and $domain.

the only idea i have is to check if a router has already created the
X-Envelope-To and then decide to not create it again.
for this i have the following set up which seems not to work (the header is
always added twice):
----
subdomain_router:
driver = redirect
allow_fail
domains = *.testdomain.de
headers_add = "X-Envelope-To: $local_part@$domain"
data = ${lookup mysql{select login from blablub where login =
'${sg{$domain}{(.*?)\.testdomain\.de}{\$1}}'}{$value@???}}

localpart_router:
driver = accept
headers_add = ${if !def:h_X-Envelope-To: {X-Envelope-To:
$local_part@$domain} {} }
condition = ${lookup mysql{select login from blablub where login =
'$local_part'}}
transport = local_delivery
cannot_route_message = Unknown user
----

how can i get this to work or how can i do this better?


regards,
christian