Re: [exim] help with redirect router and filter after header…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Bogdan Roman
Data:  
Para: exim-users
Asunto: Re: [exim] help with redirect router and filter after header rewrite
On 4-Jul-13 12:06 pm, Alex Roman wrote:
> On 4-Jul-13 10:26 am, John Burnham wrote:
>> Off the top of my head and untested - how about getting rid of the
>> rewrite rule in the rewrite section, have a router with unseen set
>> that checks for this particular pattern in your address, delivers it
>> to the address you want these mails copied to, then have another
>> router matching on that pattern that uses a particular transport that
>> has headers_rewrite set up (see
>> http://www.exim.org/exim-html-current/doc/html/spec_html/ch-generic_options_for_transports.html
>> for details) and delivers the mail to gmail ?
>
> That's what I tried first actually but for the life of me I could not
> get headers_rewrite to work. It was ignored no matter what I try. I'm
> using Debian wheezy and Exim 4.80.1 and I tried both using a Debian
> macro REMOTE_SMTP_HEADERS_REWRITE and also manually adding the
> headers_rewrite under the remote_smtp transport. That's why I resorted
> to a global rewrite.
>
> Any hints about debugging this?


Slightly related, Yahoo and Gmail classed as spam some messages which
had a different envelope-to than to, or envelope-from and from. The
headers_rewrite can't rewrite envelopes IIRC, but a global rewrite does.

Here are some details about headers_rewrite being ignored completely. I
tried numerous patterns, including very simple ones. Below is the one
which works fine as a global rewrite:

headers_rewrite = \N^([^+]+)\+([^+]+)\+onbehalf@???$\N $1@$2

It does take it into account (complains if it's invalid) but then fails
when I test with:

mail -s test SNIPPED+gmail.com+onbehalf@??? -- -froot@???

Debug shows no header is rewritten and the error message is:

   SNIPPED+gmail.com+onbehalf@???
     Unrouteable address


------ This is a copy of the message, including all the headers. ------

Return-path: <root@???>
Received: from root by iniz.mydomain.com with local (Exim 4.80)
    (envelope-from <root@???>)
    id 1UuhXk-0007U8-0H
    for SNIPPED+gmail.com+onbehalf@???; Thu, 04 Jul 2013 13:17:44 
+0200
To: SNIPPED+gmail.com+onbehalf@???
Subject: test routing
Message-Id: <E1UuhXk-0007U8-0H@???>
From: root@???
Date: Thu, 04 Jul 2013 13:17:44 +0200


Alex.