procmail
[Top] [All Lists]

Trimming the Subject

1998-01-14 08:35:41
A lot of mail I get from mailing lists managed by some dumb list software
does not have the References: or even the In-Reply-To: header and so I have
to rely mostly on Subject: header sorting to organize the mailbox. 

To compound the problem, some stupid MUAs out there (PC-based surely) have
the following Subject: header.

Subject: Re: The real subject -Reply
                              ^^^^^^
or even

Subject: Re: The real subject -Reply -Reply

The stupid '-Reply' string above throws off the Subject: sorting and these
mails are detached from the  thread they belong to.

How can I trim out the -Reply string from the subject here? 

Ideally, I dont want to fork off 'sed' to do the job and have procmail do
it itself?

I came up with this:

:0fh
{ 
 SUBJECT=|formail -x Subject|sed 's/-Reply//g'

 :0fh
 |formail -i "Subject: ${SUBJECT}"
}


Anyway, open to ideas.


Thanks much,
Vikas

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