procmail
[Top] [All Lists]

Re: Keeping Re: [ListName] at beginning of Subject:

2001-10-17 21:55:21
On 17 Oct, Ben Stuyts wrote:
| Hi,
| 
| I am looking for a recipe to change a subject line like this:
| 
| Subject: [ListName] Re: blablabla
| 
| into this:
| 
| Subject: Re: [ListName] blablabla
| 
| The problem with the first form is that my mail program (Eudora) has a 
| problem with the first form when sorting alphabetically by subject. It 
| sorts them starting at Re: in stead of at the original subject line.
| 

Here's one possibility. It's not offered as resource stingy, but it'll
get the job done and a little more.

:0 fhw
| perl -pe 's/^(Subject:) *(\[[^]]+]) *((Re:) *)*/$1 \u\L$4 $2 /i;'

It'll do what you asked, consolidate multiple Re:, make RE: Re:(*), and
"normalize" spacing (i.e. multiple or no spaces between the items always
becomes one.). I'm sure it could be done more efficiently and using
"pure" procmail and the MATCH token, but I don't have time to figure it
out and figured this is better than nothing. You'd probably want to
restrict this with further conditions so it only executed for those
messages requiring it.

* If you don't mind RE: upper case, then eliminate "\u\L".

[Note: replace "procmail" with "procmail6" for working email address.]

-- 
                   /"\
Don Hammond        \ /     ASCII Ribbon Campaign
Raleigh, NC US      X        Against HTML Mail,
                   / \      and News Too

_______________________________________________
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>