procmail
[Top] [All Lists]

Re: extract part of subjkect line into variable?

1999-04-07 07:28:58
How about:

:0fh
* ^Subject: *\[\/[0-9]+
{
    NUMBER = $MATCH
}

---
Russell Heilling   -   Technical Manager   -   NetDirect Internet Ltd
Tel: +441812937000 email:russellh(_at_)netdirect(_dot_)net(_dot_)uk Fax: 
+441812936000
   "That which doesn't kill you will make you bitter and cynical"

----- Original Message -----
From: Mathias Koerber <mathias(_at_)koerber(_dot_)org>
To: Serge Koudrya <serge7(_at_)usa(_dot_)net>
Cc: <procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de>
Sent: Wednesday, April 07, 1999 1:44 PM
Subject: Re: extract part of subjkect line into variable?


But that is not what I want to do. I want to extract the 911, not
what is left behind it.
\/ does not provide that solution...

-----Original Message-----
From: Serge Koudrya <serge7(_at_)usa(_dot_)net>
To: Mathias Koerber <mathias(_at_)staff(_dot_)singnet(_dot_)com(_dot_)sg>
Cc: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
<procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de>
Date: Wednesday, April 07, 1999 8:19 PM
Subject: Re: extract part of subjkect line into variable?


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