Re: [Exim] how to rewrite

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Fred Viles
Data:  
Para: Exim-users
Asunto: Re: [Exim] how to rewrite
On 10 Feb 2004 at 0:00, Fred Viles wrote about
    "Re: [Exim] how to rewrite":


| On 10 Feb 2004 at 20:10, Michael Johnson wrote about
|     "[Exim] how to rewrite":

|
| |...
| | I want to take a header from an incoming message, and copy the header
| | to a different header with a different name. For example, take the
| | "List-Post: address@???" header and copy the entry to give me
| | "Reply-To: address@???". I suppose the rewrite should also
| | check to see if there's already a Reply-To header. I suppose that part
| | could get to be quite tricky.

|
| How about this (untested), added to the appropriate router(s):

|
|   headers_add    = ${if and { \
|             { !def:header_Reply-to: } \
|             { def:header_List-Post: } \
|               }    { Reply-To: $header_List-Post: } {} }


Tested now, not quite right. Leading space in expansion string was
included, and List-Post: gives a mailto: URL, not a simple address.
Second try:

  headers_add    = ${if and { \
            {!def:header_Reply-to:} \
            {match {$header_List-Post:} {\<mailto:(.*)\>} } \
              }    {Reply-To: <$1>} {} }


Yes, that seems to work!

- Fred