procmail
[Top] [All Lists]

Re: scoring twice on one line

2001-09-16 10:18:42
Firstly, you need to include some of your procmail log after you've
switched VERBOSE logging on.

In particular, the contents of the FROM variable will be quite
revealing, I expect.

In the following recipe, $NSPC is set beforehand.

Set to what?  Something like
   NSPC="[^     ]"
?  I'll assume that for now.

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

If Reply-to: and From: headers aren't present it will try to set MATCH
to just the *first* non-space "word" on the "From " line - is that what
you meant?

Also, the action here (set FROM to be whatever is in the From: header)
is only invoked if there is no From: header (amongst other things).
Which doesn't seem entirely right.

  :0
  *$ -1^0 
  *$  1^1 FROM ?? (.*\<)?(Justin|Kuo)\>
  *$  1^1 FROM ?? (.*\<)?(Cath(y|erine)|Baer)\>
  *$  1^1 FROM ?? (.*\<)?(Eleanor|Chris|Saunders)\>  

The '$'s are unnecessary here as you aren't expanding any variables.
Also the '(.*\>)?' don't do anything useful.

You can see that the principle is quite sound with a test recipe that
explicitly sets the FROM variable such as:

 FROM='"Justin Kuo" <kuo(_at_)world(_dot_)std(_dot_)com>"'
 :0
 * -1^0
 * 1^1 FROM ?? (Justin|Kuo)\>
 { }

 FROM='"Kuo, Justin" <kuo(_at_)theworld(_dot_)com>'
 :0
 * -1^0
 * 1^1 FROM ?? (Justin|Kuo)\>
 { }

and looking at the verbose log - you'll see that the recipes have
positive scores like you expect.  Which perhaps suggests that FROM isn't
being set to what you expect.  Scoring is doing what you think it
should - it's the other parts that aren't!

Hope that helps,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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