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

Top Pagina
Delete this message
Reply to this message
Auteur: Heiko Schlittermann
Datum:  
Aan: 'Exim-users'
Onderwerp: [exim] Rewriting: Usage of $1 if used match_domain?
Hello experts,

I suppose, I'm too stupid to solve following challenge, so if some of you
is more clever than me (probably about every body of you:-)), please tell
me...


A file (in real life it's ldap, but here it doesn't matter) contains
lines like

# uid: mailPrimaryAddress lines.
heiko: hs@???


The config is about that:

    domain_list local_domains = a.domain.de : b.domain.de : c.otherdomain.de
    ...


    begin rewrite


    # rewrite to 'mailPrimaryAddress' if local_part is known uid
    *@* "${lookup {$1}lsearch{/etc/exim/uid2mailPrimaryAddress}'



... that works, but if fed with heiko@??? the replacement is done as
well. It's wrong. So I thought to be clever:

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


It doesn't work, because $1,... are reset in the 'match_domain'
operator. I had several attempts now, including 'reexpanding' and such
nasty games, but found no solution.

Thank you in advance.

    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 -