Re: [Exim] Rewriting incoming message subject line

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Phil Pennock
Fecha:  
A: Richard P. Groenewegen
Cc: Exim Users
Asunto: Re: [Exim] Rewriting incoming message subject line
Typing away merrily, Richard P. Groenewegen produced the immortal words:
> I'm on the Ruby mailing list and they send subject lines in the
> following format:
>
> Subject: [ruby-talk:03200] Re: Ruby Tutorial? URLS please.
>
> I want to set up a filter to remove the [...] part from the subject.
> (Come to think of it, I also might want this for the exim mailing
> list's [exim]). Can anyone say how to do this?


Use procmail in your account, not a system MTA.

In your .procmailrc, something like:

:0 fhw
* RUBYLISTPATTERN(see below)
* ^Subject: \[ruby-talk:[0-9]+\] \/.*
| formail -I "Subject: $MATCH"


where the second line, after the '* ', has something to uniquely
identify Ruby list mails. However, where you can have the tag drift
from the start of the subject line, it gets more complicated. For Exim,
something like (untested):

:0
* ^List-Id: A user list for the exim MTA
{
:0 fhw
* ^Subject: \[Exim\] \/.*
| formail -I "Subject: $MATCH"


:0 fhw
* ^Subject: R[Ee]: \[Exim\] \/.*
| formail -I "Subject: Re: $MATCH"

}

The second line could equally well be:
* ^From exim-users-admin@exim\.org

formail(1) is part of the procmail distribution.

HTH,
--
HTML email - just say no --> Phil Pennock
"We've got a patent on the conquering of a country through the use of force.
We believe in world peace through extortionate license fees." -Bluemeat