procmail
[Top] [All Lists]

Re: Altering Subject Headers

1999-12-28 04:45:09
Steve Youngs wrote:
* Bryan Albright <bryana(_at_)uswest(_dot_)net> writes:

Yep.  Use the following recipe as an example, and make the
modifications where required.

# replace subject of Trafficview Report: Estimated freeway driving
# time is xx.x minutes to Drive Time: xx.x minutes.
:0 fhw
* ^Subject:.*Trafficview Report: Estimated freeway driving time is \/.*
| /usr/local/bin/formail -I "Subject: Drive Time: $MATCH"


So, to change a subject of "[LCP] some text I don't know" to "some
text I don't know", I'd use the following?

:0 fhw
* ^Subject:.*[LCP] \/.*
| formail -I "Subject: $MATCH"

Is that right?

Not really... Iirc you need to quote the brackets, so the recipe
should look like

        * ^Subject:.*\[LCP\] \/.*

However, this does not remove multiple occurrence of [LCP] which
partially happends to some of the lists I'm subscribed to - due to
broken software.

That's the reason why I don't use procmail/formail but sed.  It's
not clean though...

Regards,

        Joey

-- 
Never trust an operating system you don't have source for!

Please always Cc to me when replying to me on the lists.

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