Re: [Exim] Rewriting addresses

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: John Koenig
CC: exim-users
Subject: Re: [Exim] Rewriting addresses
On Wed, 3 Apr 2002, John Koenig wrote:

> Can someone post a URL or refer to an example of effecting a re-write
> at transport time?


Well, it's not a very big example, but the manual does have this:

headers_rewrite                  Type: string                   Default: unset


    This option allows addresses in header lines to be rewritten at transport
    time, that is, as the message is being copied to its destination. The
    contents of the option are a colon-separated list of rewriting rules. Each
    rule is in exactly the same form as one of the general rewriting rules
    that are applied when a message is received. These are described in
    chapter 30. For example,


      headers_rewrite = a@b c@d f : \
                        x@y w@z


    changes "a@b" into "c@d" in From: header lines, and "x@y" into "w@z" in
    all address-bearing header lines. The rules are applied to the header
    lines just before they are written out at transport time, so they affect
    only those copies of the message that pass through the transport. However,
    only the message's original header lines, and any that were added by a
    system filter, are rewritten. If a router or transport adds header lines,
    they are not affected by this option. These rewriting rules are not
    applied to the envelope. You can change the return path using
    "return_path", but you cannot change envelope recipients at this time.


And in the aforementioned chapter 30 (this is the Exim 4 manual), there
are some other examples of rewriting rules.


--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.