On Tue, 9 Aug 2022, Olaf Hopp (SCC) via Exim-users wrote:

Dear collegues,
we moved some internal domains from "olddomain.org" to "newdomain.org"
we have internal routing for the new and old domain
Now we want to get rid of the routing for "olddomain.org"
and I want to rewrite "olddomain.org" to "newdomain.org"
so "f...@sub.olddomain.org" should become "f...@sub.newdomain.org"
In my rewrite section of exim I use

        ^(.*)@(.*)\.olddomain\.org $1@$2.newdomain.org TS

which seems to run fine:

# exim -brw f...@sub.olddomain.org
2022-08-09 16:18:28 "f...@sub.olddomain.org" from smtp sender rewritten as "f...@sub.newdomain.org" by rule 1
   SMTP: f...@sub.newdomain.org
 sender: f...@sub.olddomain.org
   from: f...@sub.olddomain.org
     to: f...@sub.olddomain.org
     cc: f...@sub.olddomain.org
    bcc: f...@sub.olddomain.org
reply-to: f...@sub.olddomain.org
env-from: f...@sub.olddomain.org
2022-08-09 16:18:28 "f...@sub.olddomain.org" from env-to rewritten as "f...@sub.newdomain.org" by rule 1
 env-to: f...@sub.newdomain.org

However, when I activate this, I see the following in my logs:
2022-08-09 15:59:22 Rewrite of <f...@sub.olddomain.org> yielded unparseable address: '>' missing at end of address in address <f...@sub.newdomain.org
and my routing fails since I have removed the routing for "olddomain.org"

So I modified my rewriting rule to
^(.*)@(.*)\.olddomain\.org $1@$2.newdomain.org> TS
(note the '>') Now it works as expected !?

Anyway with this, I'll get
# exim -brw f...@sub.olddomain.org
2022-08-09 16:24:33 Rewrite of f...@sub.olddomain.org yielded unparseable address: malformed address: > may not follow f...@sub.newdomain.org in address f...@sub.newdomain.org>
 sender: f...@sub.olddomain.org
   from: f...@sub.olddomain.org
     to: f...@sub.olddomain.org
     cc: f...@sub.olddomain.org
    bcc: f...@sub.olddomain.org
reply-to: f...@sub.olddomain.org
env-from: f...@sub.olddomain.org
2022-08-09 16:24:33 Rewrite of f...@sub.olddomain.org yielded unparseable address: malformed address: > may not follow f...@sub.newdomain.org in address f...@sub.newdomain.org>
 env-to: f...@sub.olddomain.org

What is going wrong here ?
Exim version 4.94.2 under Debian 11 (Bullseye)

You have:
       ^(.*)@(.*)\.olddomain\.org $1@$2.newdomain.org TS

The examples suggest that:

        *@*olddomain.org $1@$2.newdomain.org TS

would be sufficient.
In particular I doubt that you need the anchoring "^".
Perhaps the extending patterns are forcing $1 to include
the opening "<", so that the matching ">" is never removed ?

This does seem like a bug though.

--
Andrew C. Aitchison                      Kendal, UK
                   and...@aitchison.me.uk

--
## 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/

Reply via email to