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^([^+]+)\+([^+]+)\[email protected]$\N $1@$2
It does take it into account (complains if it's invalid) but then fails
when I test with:
mail -s test [email protected] -- [email protected]
Debug shows no header is rewritten and the error message is:
[email protected]
Unrouteable address
------ This is a copy of the message, including all the headers. ------
Return-path: <[email protected]>
Received: from root by iniz.mydomain.com with local (Exim 4.80)
(envelope-from <[email protected]>)
id 1UuhXk-0007U8-0H
for [email protected]; Thu, 04 Jul 2013 13:17:44
+0200
To: [email protected]
Subject: test routing
Message-Id: <[email protected]>
From: [email protected]
Date: Thu, 04 Jul 2013 13:17:44 +0200
Alex.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/