procmail
[Top] [All Lists]

Re: Removing list identification from subject

2002-02-13 14:27:54
Tastlessly following up myself, when I offered this for eliminating
Subject: [tags]:
 
| :0fhw
| * ^Subject:.*\[
|| perl -pe 'next unless/^Subject:/i;s/\[[^]]+]//; \
|         -e 's/(ject:(\s*Re:)?)\s*/$1 /i;s/(ject:)\s*(Re:)/$1 $2/;'
| 

I had made a mental note while playing with this to work on preventing
the removal of [text] which is not really a [tag], for example:

   Subject: matter, [but this] should not be removed.

Unfortunately my mental note failed me. This should do it, including
normalizing whitespace between Subject:, Re:, and the rest of the field:

  :0fhw
  * ^Subject:.*\[
  |perl -pe 'next unless s/^(Subject:(\s*Re:)?)\s*\[[^]]+]/$1 /i;' \
        -e 's/(Subject:)\s*(Re:)\s*/$1 $2 /i;'

To recap, I believe this will take care of Subject: [tags], with or
without Re: before or after, and normalize whitespace between Subject:,
Re:, and the rest of the field.  This still suffers the flaw that

  Subject: [this isn't really a list tag]

will be removed. It's left as an exercise, for those for whom this is an
issue, to identify and implement additional procmail conditions limiting
the filter's operation only to those messages from lists known to them
to contain such tags.

-- 
Reply to list please, or append "6" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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