I'd like to do some subject cleaning with procmail so that:
Subject: [Fwd: Re: misc stuff] => Re: misc stuff (fwd)
Subject: Re: [Fwd: Re: misc stuff] (fwd) => Re: misc stuff (fwd)
Subject: [Fwd: [Fwd: Re: [ace-users] misc stuff] ] => Re: [ace-users] misc
stuff (fwd)
I have the following recipe that only handles the first case:
:0
*$ ^Subject:[ ]+\[Fwd: \/.*
{
sub = $MATCH
:0
* sub ?? \]
* sub ?? ^^\/[^]]+
{
sub = $MATCH
}
:0 fhw
| $FORMAIL -I "Subject: $sub (fwd)"
}
I need help to get it work with case 2 and 3? Note the [Fwd: .* ] can
be multi-level nested. It doesn't look easy for me.
Thanks in advance.
Tony