[exim] help with this kind of condition

Top Page
Delete this message
Reply to this message
Author: jesk
Date:  
To: exim-users
Subject: [exim] help with this kind of condition
Hello,

i want that the X-Envelope-To header is added. The value for this should be
taken out of Rcpt-to.
Can i create a router exactly and only for this work or have i to construct
the headers_add line into one/all of my routers?

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
----

maybe there are better solutions as to trust a header line, because the
X-Envelope-To could exist from a previous smtp server, and the first router
wouldnt match and the second which should always match doesnt create the
X-Envelope-To because its already existing from a previous bad smtp server
or spammer...


please gimme me your light ane help me :)

regards,
christian