procmail
[Top] [All Lists]

scoring twice on one line

2001-09-16 09:08:28

Although I've been using Procmail (v3.15.1) for over a year now, I'm still a 
novice and need your help  to understand scoring. I wanted my recipe to set a 
variable if it found certain names in the From: header. Those names could 
appear as "first-name last-name" or as "last-name, first-name." For example:
  From: "Justin Kuo" <kuo(_at_)world(_dot_)std(_dot_)com>
or
  From: "Kuo, Justin" <kuo(_at_)theworld(_dot_)com>

In the following recipe, $NSPC is set beforehand. I thought the recipe would 
score two hits (score=1). Instead, it scores just one hit (score=0) and the 
variable is never set.

  :0
  *$ ! ^Reply-to: *\/$NSPC.*
  *$ ! ^From: *\/$NSPC.*
  *$ ! ^Sender: *\/$NSPC.*
  *$ ! ^From *\/$NSPC+
  *$ ! ^X-Envelope: *\/$NSPC.*
  {
      FROM = `formail -xFrom:`
  }
  :0 E
  {
      FROM = $MATCH
  }

  :0
  *$ -1^0
  *$  1^1 FROM ?? (.*\<)?(Justin|Kuo)\>
  *$  1^1 FROM ?? (.*\<)?(Cath(y|erine)|Baer)\>
  *$  1^1 FROM ?? (.*\<)?(Eleanor|Chris|Saunders)\>
  {
    FLDR='personal'
    dummy="set folder to ${FLDR}"
  }

I checked the procmail tips (http://www.procmail.org/jari/pm-tips.txt) and it 
looked like it could be done. Do I need two lines to accomplishg that task? 
What am I missing here? Thanks.  --  Justin

Justin F. Kuo, Programmer/Analyst, 781-774-5410
Medical Information Technology, Inc.
Mailstop: F4E49W, MEDITECH Circle, Westwood, MA  02090
<Prev in Thread] Current Thread [Next in Thread>