[exim] Re: Rewriting: Usage of $1 if used match_domain?

Top Page
Delete this message
Reply to this message
Author: Heiko Schlittermann
Date:  
To: 'Exim-users'
Subject: [exim] Re: Rewriting: Usage of $1 if used match_domain?
Hello experts,

thank you for thinking. I'm sooo clever ;-), even more clever than
myself - I found a (the?) solution:


>     *@* "${lookup {$1}lsearch{/etc/exim/uid2mailPrimaryAddress}'

>
>     # rewrite only if domain is one of our local domains
>     *@* "${if match_domain{$2}{+local_domains}{...the query from above...}{$0}}


For better understanding w/ two macros:

IS_OUR = ${if match_domain{$2}{+local_domains}}
LOOKUP = ${lookup {$1}lsearch{/etc/exim/uid2mailPrimaryAddress}{$value}{$0}}


begin rewrite:

*@* "${if eq{IS_OUR}{true} {LOOKUP}{$0}"


From specs.txt: (freely from my mind) If in some ${if ..} a match sets
$1, $2... these variables are set to their previus values after end of
the condition.

I love these specs, since I've the feeling that *every* piece of
information is there, if I read carefully. :-)


Again thank your for reading.


    Best regards from Dresden
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann HS12-RIPE -----------------------------------------
 gnupg encrypted messages are welcome - key ID: 48D0359B ---------------
 gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B -