Re: [Exim] [possible faq] how do modify headers in a ~/.forw…

Top Page
Delete this message
Reply to this message
Author: exim-users
Date:  
To: exim-users
Subject: Re: [Exim] [possible faq] how do modify headers in a ~/.forward?
Marc Haber wrote:
> I would like to modify the subject of incoming messages depending on
> some conditions. For example, I would like to change the subject to
> "[bugtraq] $subject" if the message comes in for the recipient
> mh+bugtraq@???.
>
> As I don't like to modify my exim configuration for things that I
> would want my users to configure themselves, I'd like to do that in my
> exim filter file ~/.forward.


As it shows that this is not possible, you might change your mind to
implement it in your exim configuration as it is not too hard. For me, the
following router seems to work:

tagging:
driver = redirect
require_files = /server/exim/tagging/$local_part
condition = ${if match{$header_subject:}{(?im)${rxquote:${readfile{/server/exim/tagging/$local_part}{}}}}{no}{yes}}
headers_add = "Subject: ${readfile{/server/exim/tagging/$local_part}{}}$rheader_subject:"
headers_remove = subject
data = $local_part@$domain

The redirection to the same address does not cause a loop as exim is smart
enough to recognize it. Anyhow in my configuration I use
redirect_router = ... to the following router to increase performance.

Create /server/exim/tagging/mh+bugtraq with the content "[bugtraq]" should
start the tagging. Probably it is necessary to adapt the path to your
installation assuming it is not in /server/exim/...

Improvement suggestions are welcome.

Heiko

Heiko Schlichting        | Freie Universität Berlin
heiko@???       | Zentraleinrichtung für Datenverarbeitung (ZEDAT)
Telefon +49 30 838-54327 | Fabeckstraße 32
Telefax +49 30 838454327 | 14195 Berlin