Unwanted side-effects of address rewriting

Top Page
Delete this message
Reply to this message
Author: John Attwood
Date:  
To: exim-users
CC: john
Subject: Unwanted side-effects of address rewriting

Hi,

I have a single rewriting rule, which recognises addresses of
the form user@host or user@??? and rewrites them
as user@??? with flags bcfrtE. The idea of this was
to suppress the hostname, or fully-qualified domainname, which
is inserted by some mailtools and/or some users. The rule is
presently:-

^(.*)@[^.]+(.gene.ucl.ac.uk)*$ $1@LOCAL_DOMAIN bcfrtE


However, we keep getting undeliverable mail now, and this takes
the form of an unrecognised user in our local mail domain. I am
assuming that this is the result of incoming mail with
user@remotehost in the From:, Reply to: or Cc: headers, which
are being rewritten by my rule to appear to be users here.
Then, when people reply to these messages, they are writing to
an unknown local user (or, worse still, to a local user who
happens to have the same login name).

Any suggestions as to how to cope with this? I definitely need
a rewriting rule along these lines, as both users and mailtools
will attempt to put user@host in some of the headers, but I only
want the rule to be applied to locally-generated or relayed
mail, not in incoming mail from outside. If I don't remove the
hostname and/or FQDN in outgoing messages then replies to them
will bounce, as exim is set to only accept incoming mail from
local machines and our University's main mailhubs.

Here are the headers from a message I received recently, to which
I was unable to reply (names changed to protect the innocent). You
can see that our mail domain (galton.ucl.ac.uk) appears in both the
From: and Cc: headers, despite the fact that the message originated
in the USA:-

>From jsmith@??? Wed Aug 20 10:41:28 1997

Return-path: <jsmith@???>
Envelope-to: john@???
Delivery-date: Wed, 20 Aug 1997 10:41:28 +0100
Received: from mail-b.bcc.ac.uk [144.82.100.22] 
    by ash with smtp (Exim 1.62 #7)
    id 0x17Ga-0002wR-00; Wed, 20 Aug 1997 10:41:28 +0100
Received: from server.nybc.org by mail-b.bcc.ac.uk with SMTP (XT-PP) 
          with ESMTP; Wed, 20 Aug 1997 10:41:36 +0100
Received: from catsun.nybc.org ([192.94.249.34]) 
          by server.nybc.org          (Netscape Mail Server v2.0) with SMTP 
          id AAA1644          
          for <john@???>;
          Wed, 20 Aug 1997 05:32:30 -0400
Received: by catsun.nybc.org (SMI-8.6/SMI-SVR4)    id FAA11067;
          Wed, 20 Aug 1997 05:37:31 -0400
Date: Wed, 20 Aug 1997 05:37:31 -0400
From: jsmith@??? (John Smith)
Message-Id: <199708200937.FAA11067@???>
To: john@???
Cc: jsmith@???
Content-Length: 809
Status: RO

This generated the following lines in our existats report when I replied:-

    2 jsmith@???: unknown local-part "jsmith" in domain
      "galton.ucl.ac.uk"


Any suggestions on how to do this better much appreciated,
Thanks for your time,

John.
-- 
John Attwood,  Computing Officer,     |  Voice +171 387 7050 X5028
MRC Human Biochemical Genetics Unit,  |  Fax   +171 387 3496
University College London,            |  Email john@???
Wolfson House, 4 Stephenson Way,      |
London NW1 2HE, United Kingdom.       |  http://www.gene.ucl.ac.uk/~john