procmail
[Top] [All Lists]

Re: more damn non-standard email systems, using "-Reply"

1997-08-20 17:16:38

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'`

which will

  1) produce exactly one leading "Re: ", no matter how many
     exist initially (including zero), ignoring their case.

  2) zap all trailing instances of -reply (ignoring case), each
     optionally preceded by whitespace.


Terry.

<Prev in Thread] Current Thread [Next in Thread>