Re: [exim] rewriting headers (add and remove)

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: Michael Johnson
CC: exim-users
Temat: Re: [exim] rewriting headers (add and remove)
On Wed, 22 Jun 2005, Michael Johnson wrote:

> D'oh! It looks like I did add something. In 4.43, it was simply the last
> entry in the routers section. The entire routers section is:
>
> begin routers


<snip various routers>

> #-----------------------------------------------------------------------
> ---------
>   vacation_director:
>           driver = accept
>           domains = ${lookup mysql {SELECT domain from passwd WHERE \
>                         domain='${quote_mysql:$domain}' AND \
>                         user='${quote_mysql:$local_part}' AND \
>                         vacation_start <= curdate() AND \
>                         vacation_end >= curdate()}\
>                 {$value}}
>           no_verify
>           senders = !^.*-request@.* : !^owner-.*@.* : !^postmaster@.* : \
>           ! ^listmaster@.* : !^mailer-daemon@.*
>           transport = vacation_autoreply
>           unseen
> #-----------------------------------------------------------------------
> ---------

>
> mysql_user:
>   driver = accept
>   condition = ${if eq{} {${lookup mysql {SELECT home FROM passwd \
>                 WHERE id='${local_part}@${domain}'}}} {no}{yes}}
>   retry_use_local_part
>   transport=mysql_delivery

>
>   mysql_catchall:
>   driver = redirect
>   allow_fail
>   allow_defer
>   data = ${lookup mysql {SELECT dest FROM aliases \
>             WHERE email='*@${domain}' AND \
>             type="site"}}

>
> # If both Reply-to and List-Post exist, copy original Reply-To
> # If List-Post exists, generate Reply-To from it
> headers_add     = ${if match {$header_list-post:} {\<mailto:(.*)\>} \
>                 {${if def:header_reply-to: \
>                 {X-Orig-reply-to: $header_reply-to:\nReply-To: <$1>} \
>                 {Reply-To: <$1>} }} \
>                 {} }

>
>
> # If both Reply-to and List-Post exist, remove original Reply-To
> headers_remove = ${if and { \
>                 {def:header_reply-to:} {def:header_list-post:}\
>                 } {reply-to} fail }

>
> The only difference I can see between the 4.43 router section and this one is
> the addition of the vacation section. How did adding the vacation section
> change the behavior of the headers_add headers_remove sections?


As I keep saying, there are no "headers_add" or "headers_remove"
sections. Those two option settings are part of the mysql_catchall router.
So you need to be sure that that router is being used in the cases that
are giving you trouble, because they won't apply to any other routers.

Much the best way of debugging this is going to be to run a delivery
with debugging turned on for a failing address, to see what is actually
happening rather than trying to hypothesize.



-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book