[hypermail] Cleaning up reply prefixes

From: Tom von Alten <tom_vonalten_at_boi.hp.com_at_hypermail-project.org>
Date: Tue, 2 Jan 2001 17:08:04 -0800
Message-ID: <002501c07521$a00cae10$c0e0080f_at_alien-nt.hpl.hp.com>


In the "Wanted: a good flag for Win32 and an m4 guru" thread, Bob Crispen wrote:
> Basically it boils down to s/Re(.*):/Re:/ followed by
> s/Re: Re:/Re:/ iterated. That may cure a couple of other email
> client peculiarities as well (e.g., "Re: RE:", which I haven't
> seen in the wild...

Way back when, I had some shell pre-processing code to clean up this stuff before giving the message to hypermail v1.x

At the time, I cared about English and German language mailers. Depending on how many languages you want to cover, it could get interesting. Here was the sed magic I used, with a perlish suggestion that I never put in place. You may find it amusing.

 # Here's a nicer solution, showing perl's lower quoting needs:
 #  perl -pe 's/^(re(\[\d*\])*:\s*|betr\.:(\[\d*\])*:\s*)*//i'
 #
 THREAD=$(echo "$SUBJECT" |\
         sed -e ':again' \
             -e 's/^[Rr][Ee]\(\[[[:digit:]]*\]\)*:[[:space:]]*//' \
             -e 's/^Betr\.:\(\[[[:digit:]]*\]\)*:[[:space:]]*//' \
             -e 't again')

 typeset -l thread=$THREAD

I had a notion to include variants of "FW:" as well, but it never bothered me quite badly enough...

_____________ Hewlett-Packard Personal Storage Business Tom von Alten mailto:Tom_vonAlten_at_boi.hp.com Received on Wed 03 Jan 2001 03:10:47 AM GMT

This archive was generated by hypermail 2.2.0 : Thu 22 Feb 2007 07:33:52 PM GMT GMT