Philip Guenther <guenther(_at_)gac(_dot_)edu> wrote:
Ben Stuyts <benst(_at_)terminus(_dot_)stuyts(_dot_)nl> writes:
On Thu, 24 Jul 97, process(_at_)qz(_dot_)little-neck(_dot_)ny(_dot_)us (Eli
the Bearded) wrote:
Yes, this looks like it would solve my problem. But there seems to be a
problem. From my log file:
Oops. I should have mentioned that. I tend to write for the latest
and greatest perl regexp engines.
:0 fhD
* ^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]:.*RE:
You meant " *" not ".*", I presume.
| perl -pe 's/^subject:\s*(re[][^\d]*:\s*)+/Subject: Re: /i;'
:0 fhE
* ^Subject: *((Re: ?)*Re[[^]|Re: *Re:)
| perl -pe 's/^subject:\s*(re[][^\d]*:\s*)+/Subject: Re: /i;'
Since you've typed out that much in [] anyway, why not combine them?
Keeps you from having two copies of the perl script to maintain. And
let's deal with "re:", too.
# 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;'
The first condition is probably overkill: sendmail at least will always
canonicalize headers to all lowercase except for the first character and
any letter after a minus sign.
smail, at least as configured here, does not. qmail probably does not.
Other mailers may not. I use this as a filter for spam suspect mail.
:0D:
* ^(SUBJECT|DATE|FROM):
$HOME/notes/untagged
Yes, you could get it down to only one copy of the perl action, but it
would be no faster, and I don't think it would be any clearer, so what's
the point?
Oh, it is a more entertaining extreme than using recursive procmailrcs
to do this with formail, IMHO.
Elijah
------
Please do not CC me when replying to the list. It is not my responsibility to
prove to you my mail is not spam, if mail to you bounces it will not be resent.