procmail
[Top] [All Lists]

Re: extract part of subjkect line into variable?

1999-04-07 05:35:15
Hello Mathias,

you wrote:

MK> Is there an easy way to extract part of the Subject line
MK> into a variable in procmail?

MK> Example:
MK>         Subject: [xx] re: test

MK> I would like to assign the "xx" in the squarebrackets into a variable.


  Here's the solution provided by Philip Guenther <guenther(_at_)gac(_dot_)edu>:

Chuck Campbell <campbell(_at_)neosoft(_dot_)com> writes:
I've looked deeper (at old messages and threads I have saved) and none of
them have either the In-Reply-To or References headers, so I am assuming
that the addition of "[911] " to the front of the subject line is the
culprit.

How can I get procmail to strip this when handling mail from this list?

        # Extact everything in the Subject: header after the "[911] "
        # and use formail to make that the new Subject:
        :0 fhw
        * ^Subject: *\[911\] \/.*
        |formail -I"Subject: $MATCH"


Best regards,
 Serge                            mailto:serge7(_at_)usa(_dot_)net