procmail
[Top] [All Lists]

Re: allow a specific address, block all others

1997-12-09 14:16:39
At 09:19 AM 12/9/97 -0500, Steve Woodard wrote:

ORGMAIL=/var/spool/mail/woodard

$DEFAULT should be set fairly reliably to be your user mailbox already.  Is
there a reason you don't use it?

:0
* ^From:(_dot_)*(_at_)someplace(_dot_)net
{
        :0:
        * ^From:(_dot_)*woodard(_at_)someplace(_dot_)net
        $ORGMAIL

        :0
        /dev/null
}

Note that the mailbox delivery recipe has locking on it (you're doing a
file operation there).  The second sub-recipe trashcans anything not
delivered by the first.  By placing the two inside a common condition, you
make sure that you won't accidentally move the domain trasher in front of
the personal mail keeper elsewhere in your recipes - if you did that, then
you'd always trash the personal mail.

an excerpt from the log file-
procmail: No match on "^From: woodard(_at_)someplace(_dot_)net"

^From:[         ]woodard(_at_)someplace(_dot_)net

Where there is a space+tab in the brackets, would normally work quite well.

Using ".*" as I have above says "match anything in front of the text to
match.".  Space, tab, partial name (though it could match "swoodard@" and
"jwoodard@", etc).

From woodard(_at_)someplace(_dot_)net  Tue Dec  9 09:11:31 1997

Do you want to match on the envelope from (which would include .forward'd
messages I believe), or do you want to match on the From field?

The above recipes match the field.  If you want to match the envelope, then
you'd use something more like:

* ^From(_dot_)*woodard(_at_)someplace(_dot_)net

(this would actually match EITHER the envelope or the header field)

* ^From[        ]woodard(_at_)someplace(_dot_)net

(this would match only the envelope)


---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395

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