procmail
[Top] [All Lists]

Re: Removing [somelist] from subject lines

2001-01-21 10:40:51
Dallman Ross suggested to Mike Harris,

|   :0 fih
|   * ^Subject:.*]\/.*
|   | formail -I"Subject: $MATCH"

The problem there is that if there is a "Re:" and it is properly placed
before the subject tag (some lists stick the tag in front of "Re:," ag-
gravating the problem), "Re:" will get lost, and it will be difficult to
tell, when a follow-up comes very soon after the basenote of the thread,
which is which.  You can't always rely on the order in which they arrive
in your mailbox, especially with mail from lists.
 
One could do this, assuming there's nobody on the list with hostile software
that uses the illegal "Re[2]:" syntax (which, thankably, I've not seen in
years),

  :0
  * ^Subject:\/.*\[.*]
  {
   SUBJECT=$MATCH

   :0 # OK if right side is null
   * SUBJECT ?? ^^\/ *[^[]*
   { PREBRACKET=$MATCH }

   :0 # OK if right side is null
   * SUBJECT ?? ]\/.*
   { POSTBRACKET=$MATCH } 

   :0hfw
   | formail -i "Subject:$PREBRACKET$POSTBRACKET"
  }

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