Quoting terry jones (terry(_at_)chiliad(_dot_)teclata(_dot_)es):
Hi Tim. Instead of this
NEWSUB=`echo "$SUBJECT" | sed 's/\-Reply$//g'`
and the subsequent recursion etc., try this one:
NEWSUB=`echo "$SUBJECT" |
perl -p -e 's/^((Re:\s*)*)?(.*)/Re: \3/i; s/(\s*-reply)*$//i'`
Or, use a procmailrc that doesn't take an external process or
recursion. Something like this: (untested)
:0
* ^Subject:.*(- reply[ ]*)+$
{
:0 fw
* ^Subject:[ ]+(Re: )*\/([^-]|-[^ ]|- [^r]|- r[^e]|- re[^p]|- rep[^l]|-
repl[^y])*
| formail -i "Subject: Re: $MATCH"
}
The first condition checks that you have a subject that ends in
"- reply" or "- reply - reply", etc., but not something like
"Important - reply at once". The second condition grabs the important
part of the subject and modifies the header accordingly. This will
fail for something like "Important - reply at once - reply", changing
it to "Re: Important", so I used the -i option to save the original
subject as Old-Subject:.
--
Michael Stone, Sysadmin, ITRI PGP: key 1024/76556F95 from mit keyserver,
mstone(_at_)itri(_dot_)loyola(_dot_)edu finger, or email with
"Subject: get pgp key"