procmail
[Top] [All Lists]

Re: Request for syntax assistance

2003-12-14 06:46:26
At 21:54 2003-12-13 -0600, Nick wrote:
Sean,

Thanks for the answer. I think I asked the question incorrectly. Here is
what I want to do in a sort of pseudocode.

I have most of it, but I am unsure about the parts labeled "continue to
the $HOME/.procmailrc" that is what I meant about terminating the rest
of the /etc/procmailrc file. If I match a condition, I want to skip the
rest of the file.

So, cease processing the current rcfile.

'man procmailrc'

note what SWITCHRC does, especially "If the named rcfile doesn't exist or is not a normal file or /dev/null then an error will be logged and processing will continue in the current rcfile."


At 22:53 2003-12-13 -0600, Nick wrote:

# Check against personal whitelists
FROM=`formail -XFrom: | formail -r -xTo: | tr -d ' '`
:0
* ? grep -F -i -x -q "$FROM" $HOME/.whitelist
SWITCHRC=$HOME/.procmailrc

I'd advise if you're going to do this, do:

* conditions
{
        DROPPRIVS=YES
        SWITCHRC=$HOME/.procmailrc
}

I can't say for certain, but I'd expect that /etc/procmailrc would retain it's privledges when switching to a user rcfile in this fashion (which differs from terminating proccessing of the current rcfile). Even if it doesn't, it can't hurt to do it like above just to enforce the fact that privledges are being dropped.

BTW, have you considered what happens if there is no $HOME/.procmailrc (see the procmailrc manpage)?

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
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>