[Exim] Address Re-writing

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Phil White
Date:  
À: exim-users
Sujet: [Exim] Address Re-writing
Hi All.

Just a short comment/query regarding address rewriting; not of the
recipient, but for the sender.

I was trying to set up a rewrite rule for a virtual domain along the lines of

*@freeport.itmagic.ltd.uk $1@??? T

which, of course, works fine. However, for users sending to this domain, I
also want to rewrite their address. So, I tried prefixing this rule with

*@freeport.itmagic.ltd.uk ${lookup{$sender_address}lsearch*{/tmp/users}\
        {$value}fail}@??? Ffrs


where the /tmp/users file is
    chemist@???:    localusername
    *:                                        postmaster


This doesn't work, on 2 counts.

1) The $sender_address is not being found in the user file, and defaults to
postmaster each time.

2) exim -brw root@??? correctly reports the rewritten
headers (from, sender & reply). BUT, exim -d9 -bs ... gives the debug info

root@??? in *@freeport.itmagic.ltd.uk? yes
(*@freeport.itmagic.ltd.uk)
"root@???" rewritten as "root@???"
chemist@??? in *@freeport.itmagic.ltd.uk? no (end of
list)
rewritten sender = chemist@???

which ain't what I want. Now, I could change the header rewrite rule to *@*,
but then that would rewrite for all domains, not just the virtual one. (Except
this doesnt seem to work as expected either)

Question: Am I being stupid? AFAICS, this ought to work.

So, instead, I try a smartuser director with
headers_remove = From:Reply-to
headers_add = <lookup_value>

but this doesn't do it either! Arghhh!

Any ideas? I am obviously missing something here.

Regards,

    Phil