procmail
[Top] [All Lists]

Re: an anti-spam procmail recipe

1997-08-19 16:46:18
Hello,

Still about catching email with the same address in From and To fields... I'd
love to be able to use the recipe, but have a problem understanding two of the
concepts in it, and I don't want to just copy and paste without understanding
what all this really means ;)


<<snip the initalization section >>

# E-mails where the To: and From: headers match but it's not To: or From: me
# or somebody from my domain are probably spam.
:0
* ^To:[        ]*\/[^  ].*
{
   TO_VALUE = $MATCH

   :0
   * ^From:[  ]*\/[^  ].*
   {
       FROM_VALUE = $MATCH

       :0:
       * TO_VALUE ?? .

I thought this meant "if TO_VALUE equals any_single_character" but it wouldn't
make sense. So I am assuming it means "if TO_VALUE contains at least one
character" - is this correct?

       * FROM_VALUE ?? .

As above, but also - why FROM_VALUE and not $FROM_VALUE? 
(Or, a better question: is there a man page that explains such things?)

       * $ ! ^TO($MY_NAMES)
       * $ ! $FROMHDR($MY_NAMES|[^(_at_)]+@$MY_DOMAINS)
       * $ FROM_VALUE ?? ^^$\TO_VALUE^^

Ok, I understand the last line means "if FROM_VAUE is identical to TO_VALUE",
but what still puzzles me is the necessity of starting the condition with `$' in
all the 3 lines above. I know the procmail man page says...

$    Evaluate the remainder according to sh(1)  substitution
     rules  inside  double  quotes, skip leading whitespace,
     then reparse it.

...but this is Greek to me. Why not simply
        * ! ^TO($MY_NAMES)
and so on? What's really the difference? If we want to "skip leading whitespace"
wouldn't it be enough to prepend [      ]* to the expression(s) instead? 
Also, the two lines on top which do the job of extracting strings into the
TO_VALUE and FROM_VALUE variables - don't they actually take care of leading
whitespece themselves, the way they're written?


Thanks,

marek 


-- 
"If you're happy and you know it, clunk your chains."
Largactil Cafe http://www.lodz.pdi.net/~eristic/index.html
Send message with GET PGP_KEY in subject for PGP public key.
Unsolicited commercial email goes to /dev/null unread.
Please reply to list unless there's a specific reason not to.


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