Re: [exim] Rewrite FROM address

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Luke Sheldrick
Data:  
Para: exim-users@exim.org
Asunto: Re: [exim] Rewrite FROM address
Hi again Phil,

Getting closer, :)

Howrver have changed $1 for $local_part, and it does work, however there are a couple of glitches.

For some reason it isnt picking up the @an0key.co.uk on the domain when it's rewriting the headers, instead it is rewriting just with the new local part. If I put the full email in txt file it does work.

Well kind of, I tested a mail, and got the below headers

From: "Luke Sheldrick" <Luke@???>
To: <luke.sheldrick@???>
Return-Path: luke+forntttest@???

So the return path is working, just not the from.

Also if exim cannot find the txt file for a user in the subaddress folder (or redir as I called it) it is failing the messages.. Is there a way to get around this, i.e. If there is now file, to keep it as it were?

And one more :P could we rewrite the script slightly, so it rewrites the complete email address? As at the moment will only do it for an0key.co.uk, and whilst there is only three domains on this setup (i.e. My home / test env) would be good if in the redir folder I could put luke@??? for example?

Really appreciate your help..

On 06/03/2008 09:36, "Phil Pennock" <exim-users@???> wrote:

On 2008-03-05 at 12:06 +0000, Luke Sheldrick wrote:
> So I did, sorry..
>
> Try http://luke.sheldrick.co.uk/Files/exim/exim.conf.rewrite.txt


Okay, my untested example had a bug. This is what I get for only ever
seeing your mails after 1am ;^) -- it's embarrassing that I didn't spot
this before now.

In fact, the second error message was even clear about the fact that the
problem was in the return_path now and that the headers_rewrite problem
from your transcription mishap had been solved.

return_path = ${lookup{$local_part@$domain}lsearch{/etc/mail/subaddress-maps/$1}{$value}fail}

There is no $1 because there is no comparison setting it because this
isn't a rewrite, it's a straight-forward string expansion.

Change the $1 for $local_part instead.

You can also safely make the same change in the headers_rewrite, for
consistency, if you like.

Bah, I had a nagging feeling that it might be better to switch from $1
to $local_part but couldn't see a reason to switch so told myself I was
being silly, it was fine. :^( Apparently my subconscious was more
awake than I was.

Sorry,
-Phil