procmail
[Top] [All Lists]

Re: Re:/Fwd perversions

1997-10-08 13:28:54
(Hmmm. Wonder if that subject will get "fixed".)

Ben Stuyts <benst(_at_)terminus(_dot_)stuyts(_dot_)nl> wrote:
A while ago some of you helped me set up a recipe to deal with all kinds of  
"Re: Re:^2" perversions in subject lines. It has worked great until a few 
days  
ago, so I'd like to ask for some help again.

I remember that thread.

# Deal with all manner of subject line perversions of "Re:"
:0 fhD
* ^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]: *\
      (RE:|re:|([rR][eE]: ?)*[rR][eE][[^]|[rR][eE]: *[rR][eE]:)
| perl -pe 's/^subject:\s*(re[][^\d]*:\s*)+/Subject: Re: /i;'

(Side note to people here: anyone know any normal headers besides
"Subject:" that "^[Ss][UBJECTubject]+: will match? It is much easier
to type out.)

And I would like to extend it to handle the following subjects that have been 
 
coming in here:

Subject: Fwd: CVSup release identity
Subject: Re: Fwd: CVSup release identity
Subject: Fw: Fwd: CVSup release identity

i.e change all these to:
Subject: Re: CVSup release identity

I am not so well versed with regular expressions of the above complexity, so  
I would appreciate it if you could help me with this.

Myself and Philip were responsible for that RE. It could be extended to
deal with this, but it starts getting ugly. Here's a first pass, era
or Philip will likely find a bug in it:

# Deal with all manner of subject line perversions of "Re:" and
# various forwarding tags.
:0 fhD
* ^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]: *([Ff][Ww][Dd]?: *)?\
        (RE:|re:|([rR][eE]: ?)*[rR][eE][[^]|[rR][eE]: *[rR][eE]:) *\
        ([Ff][Ww][Dd]?: *)?
| perl -pe 's/^subject:(fwd?:|\s)*(re[][^\d]*:\s*)*(fwd?:\s*)/"Subject: 
".($2?"Re: ":"")/ie;'

A multiple pass solution would probably be better, one to handle the
"Re:" junk, one or more to handle other subject garbage. "Re:" is
very special in that we want to keep it if it is there in any form,
while the others we want to delete always.

Elijah
------
I /dev/null dupes, no need to CC list posts.  It is not my responsibility to
prove to you my mail is not spam, if mail to you bounces it will not be resent.

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