procmail
[Top] [All Lists]

Re: does procmail always use ~/.procmail

2008-12-06 13:01:22
On Sat, Dec 6, 2008 at 8:45 AM, Professional Software Engineering
<PSE-L(_at_)mail(_dot_)professional(_dot_)org> wrote:
At 08:49 2008-12-06 -0500, Charles Gregory wrote:

So to get a "fallback" effect use a condition at the start of
/etc/procmailrc that tests for the existence of users rc file and
either 'includes' it.... or bypasses all /etc/procmailrc code....

Including it would incur some security issues.

There shouldn't be in the case of DROPPRIVS as you've already suggested ...

:0
* ? test -e $HOME/.procmailrc
{
       # ensure privleges are dropped, then terminate processing of this
       # rcfile (which should drop privs anyway, but I'm being retentive)
       DROPPRIVS=YES
       SWITCHRC=
}

# rest of actual /etc/procmailrc

That's not necessary:

       SWITCHRC    Names  an  rcfile  (relative  to the current directory) to
                   which processing will be switched.  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.

So all you need is

# global rules before here
DROPPRIVS=YES
SWITCHRC=$HOME/.procmailrc
# fallback rules after here
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail