[exim] Creating a sed filter

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Edward Harvey
Date:  
À: exim-users
Sujet: [exim] Creating a sed filter
Is there some reasonably easy way to tell my exim to apply something
like sed against all incoming messages? I'm guessing this can somehow
be done via transports or routers... But I don't really know what
those are intended for, or how they're used.... I'll go read manuals
if I have a clue what direction I want to go....

For example:
Server#1 may send mail from me, From: edward.harvey_at_lyricsemi.com
or From: eharvey_at_lyricsemi.com
Server#2 receives the message via exim, and I want Server#2 to do
something like sed 's/edward.harvey@/eharvey@/g' before routing the
message.
The reason I want this is to improve support of my company mailing
list system (mailman). All my users send mail from multiple clients
(outlook, apple, webmail, etc) and their clients aren't necessarily
all configured to send From: the same address. Some users have as
many as 6 aliases, which I don't mind entering into my exim server. I
would love to make the receiving MTA itself modify the message upon
receipt, before passing the message to mailman. That way, mailman
always sees the same From: alias, and users never get confused about
what address they've registered.

Thanks for any ideas...  Feel free to tell me to RTFM, if that's the  
appropriate direction to go....From exim-users@??? Thu Sep 25 02:25:18 2008
Envelope-to: exim-users@???
Received: from smtp.spodhuis.org ([2001:980:fff:31::a]:62837
    helo=mx.spodhuis.org) by tahini.csx.cam.ac.uk with esmtp (Exim 4.69)
    (envelope-from <exim-users@???>) id 1KifbS-0006eB-MC
    for exim-users@???; Thu, 25 Sep 2008 02:25:18 +0100
Received: by smtp.spodhuis.org with local 
    id 1KifbS-000FbF-3v; Thu, 25 Sep 2008 01:25:10 +0000
Date: Wed, 24 Sep 2008 18:25:10 -0700
From: Phil Pennock <exim-users@???>
To: Edward Harvey <eharvey@???>
Message-ID: <20080925012509.GA59909@???>
Mail-Followup-To: Edward Harvey <eharvey@???>,
    exim-users@???
References: <D4B502A4-41A1-484B-BDA4-89EA06E515BB@???>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <D4B502A4-41A1-484B-BDA4-89EA06E515BB@???>
X-Spam-Score: -1.9 (-) 
X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL=-0.360, BAYES_00=-1.5,
    NO_RELAYS=-0.001 autolearn=no version=3.1.8
Cc: exim-users@???
Subject: Re: [exim] Creating a sed filter
X-BeenThere: exim-users@???
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: exim-users@???
List-Id: A user list for the exim MTA <exim-users.exim.org>
List-Unsubscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subject=unsubscribe>
List-Archive: <http://lists.exim.org/lurker/list/exim-users.html>
List-Post: <mailto:exim-users@exim.org>
List-Help: <mailto:exim-users-request@exim.org?subject=help>
List-Subscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subject=subscribe>
X-List-Received-Date: Thu, 25 Sep 2008 01:25:19 -0000


On 2008-09-24 at 19:58 -0400, Edward Harvey wrote:
> Is there some reasonably easy way to tell my exim to apply something
> like sed against all incoming messages?

[ snip explanation that this applies to addresses in headers ]

"begin rewrites", it's a section of the config.

> be done via transports or routers... But I don't really know what
> those are intended for, or how they're used.... I'll go read manuals
> if I have a clue what direction I want to go....


spec.txt: 31. Address rewriting
online HTML version:
http://www.exim.org/exim-html-4.69/doc/html/spec_html/ch31.html

Explanations of the options available, various examples with
explanations of what happens with each example, etc.

Just remember that the Exim way is not to do routing with rewrites, only
clean-ups and normalisations.

-Phil