procmail
[Top] [All Lists]

Re: Recipe Question

1996-09-03 01:42:33
[Mailed and mailed.]

On Mon, 2 Sep 1996 20:00:28 -0700 (PDT), "Z.B." <zachb(_at_)netcom(_dot_)com>
wrote:
Which of these recipes will apply to an person that has quotes around his 
name?

Neither, because ^FROM is not a valid macro. 
  (I think maybe it should be. Stephen says maybe one day it will be.)
  Moreover, anyone can put anything in the "real name" field, and even
in the From: field. Sender, if available, should be rather reliable. 

I see the address as "Mr. Idiot" <idiot(_at_)stupid(_dot_)com>

Now who would use a vanity address like that? :-)

Off top of hat, can probably be optimized and improved:

    :0
    * ^(.*-)?(From|Sender):(_dot_)*idiot(_at_)stupid\(_dot_)com
    /dev/null

or even 

    # If it's in any header at all (incl. Subject) -- it's bye-bye
    :0
    * idiot(_at_)stupid\(_dot_)com
    /dev/null

or will I need to put the quotemarks in the condition too?

As a general question about regular expressions, it depends on what
you want to match. If they +might+ not be there and some other part of
the text is likely to always only match the guy you [don't] want, why
bother with the quote marks. If you are (more or less) likely to match
the wrong guy by accident, play it safe. You could require that the
name, with or without quote mark, be bounded with whitespace on both
sides:

    * [         ]"?Mr\. Idiot"?[        ]
    # The brackets contain space, tab

Hope this helps,

/* era */

-- 
See <http://www.ling.helsinki.fi/~reriksso/> for mantra, disclaimer, etc.
* If you enjoy getting spam, I'd appreciate it if you'd register yourself
  at the following URL:  <http://www.ling.helsinki.fi/~reriksso/spam.html>

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