Re: Exim re-writing help
*- On 30 Sep, David Kanter wrote about "Exim re-writing help"
> I would like to rewrite my address with exim. (I only send outgoing mail to the Internet; no local mail.) I've read the documentation, but am still a bit confused on exactly how to set up the re-write. I would like david@milwaukee (i.e., user@hostname) to be re-written to pcr387@hecky.acns.nwu.edu (either that or djkanter@nwu.edu, which is easier to read).
>
>>From what I've read, I should do something like:
>
> *@@ $1@$2 then all the flags
This would just give the same address as you started.
>
> But where should I put the $0, $1, and $2 re-write definitions? I'm assuming:
>
> $0=david@milwaukee
> $1=pcr387
> $2=hecky.acns.nwu.edu
>
No you can't define these. They coorespond the the components of the
address coming in.
> But the documentation (Exim manual) implies that:
>
> $0=david@milwaukee
> $1=david
> $2=milwaukee
>
> ...so I'm confused as to which is right.
This one is right.
> How close am I to doing this correctly?
>
I would just do this.
david@* djkanter@nwu.edu Ffsr
I put this rule in my exim.conf to test and this is the result.
# exim -brw david@milwaukee
sender: djkanter@nwu.edu
from: djkanter@nwu.edu
to: david@milwaukee
cc: david@milwaukee
bcc: david@milwaukee
reply-to: djkanter@nwu.edu
env-from: djkanter@nwu.edu
env-to: david@milwaukee
So outbound addresses are rewritten and inbound ones are left alone.
I also set the primary_hostname to my dynamic dns name so that the
Message-Id gets set properly(look in the header of this mail).
HTH,
--
Brian
---------------------------------------------------------------------
Mechanical Engineering servis@purdue.edu
Purdue University http://www.ecn.purdue.edu/~servis
---------------------------------------------------------------------
Reply to: