procmail
[Top] [All Lists]

Re: Message being delivered as root

2002-02-17 22:52:04
Charles Tassell <ctassell(_at_)isn(_dot_)net> writes:
  I'm using the following procmailrc file to create a maildir for a user 
if one does not already exist, and deliver the message there:

You don't say so, but it sounds like this is _the_ /etc/procmailrc file,
not just some random $HOME/.procmailrc.  If that's true, be sure to say
so when you describe your situation.  The /etc/procmailrc is special;
to quote the second paragraph of the procmail(1) manpage:

       Care must be taken when creating /etc/procmailrc, because,
       if circumstances permit, it will  be  executed  with  root
       privileges  (contrary  to  the  $HOME/.procmailrc  file of
       course).


PATH=/usr/bin:/usr/ucb:/bin:/usr/local/bin:.

Unless you can say why you need to override the compiled in default
value for the PATH variable, you shouldn't be setting it.  Setting it
to include the currect directory is particularly unwise, especially in
the /etc/procmailrc file.  Remove that line.


MAILDIR=$HOME/Maildir
DEFAULT=$MAILDIR/

Do not confuse the MAILDIR variable in procmail with the MAILDIR
environment variable described by qmail.  Assigning to MAILDIR in an
rcfile tells procmail to try to change directories to the specified
directory.  Since you don't really want procmail to do that, DON'T
SET MAILDIR TO THE PATH TO A MAILDIR FOLDER!  (I wish djb had picked a
different variable for his Maildir.)

Secondly, if this _is_ the /etc/procmailrc file, so that you're trying
to change the default spool location for all users, then you should stop
and fix the compiled in location directly.  In your case, all you have to
do is add the line

#define MAILSPOOLHOME "/Maildir/"

to the config.h file.  Recompile, reinstall, and then remove everything
you showed from your /etc/procmailrc file, as it all looked superfluous
to me.


Finally, if you got directions to set MAILDIR and DEFAULT in the
/etc/procmailrc file from a website, please email the author of the
webpage and tell them their instructions are *wrong* and just cause
problems for other people.


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