Jose Romildo Malaquias writes:
> Hello.
>
> I want to remove a prefix from the messages coming
> from a mailing list I am subscribed before saving
> the messages in its folder. Currently my procmail
> recipes for saving the message is
>
> DUMMY=`test -d linux-br || mkdir linux-br`
> :0:
> * ^[EMAIL PROTECTED]
> linux-br/`date +%Y-%m`
>
> The subject header line comes with one of the prefixes
> "(linux-br) ", "Re: (linux-br) ", "Re: Re: (linux-br) ",
> and so on (without the quotes).
David&David (you know who you are ;) really got me going now.
The following actually works. It only removes the "(linux-br)"
part and leaves preceding "Re: " intact. If you don't want that
(remove preceding Re's), the solution is even easier.
Left as an exercise to the reader ...
:0
* ^Subject:.*\(linux-br\)
* ^Subject: \/[^(]*
{
prebr="$MATCH"
:0fh
# that's space and tab in the square brackets
* ^Subject:.*\(linux-br\) \/[^ ]*
| formail -b -I"Subject: $prebr$MATCH"
}
Just another bored procmailer ...
Sorry for the off-topic post.