procmail
[Top] [All Lists]

Re: Have perm problems with spam filtering procmail recipe.

2004-04-28 08:21:43
On Wed, Apr 28, 2004 at 10:02:09AM -0400, Brian Wagener wrote:
Hello,
I just got my box setup with postfix, procmail, and spamassasin. And it
all works except when a mail is detected to be spam, it is moved to the
correct .Spam directory, but it is has root.mail permissions instead of
the users permissions like what happens when the mail isn't spam. Anyone
know what can be wrong?

"DROPPRIVS=yes" is missing. DROPPRIVS=yes tells procmail to drop its
root (or whoever it's being run as) privileges to the recipient's privs.

# /etc/procmailrc
DEFAULT=$HOME/.maildir/
LOGFILE=/var/log/procmail.log
:0wf: $HOME/spamassassin.lock
* < 256000
| /usr/bin/spamc -f

Here's one way to fix the problem:

:0
* ^X-Spam-Status: Yes
{
    DROPPRIVS=yes
    $HOME/.maildir/.Spam/
}

Another way would be to do "DROPPRIVS=yes" at the top of the
procmailrc file (or at least as high as you can--if you're doing
anything that requires root privs you certainly don't want to drop
sooner).

One side effect I just noticed is that the delivery will not be able
to be logged to /var/log/procmail.log because that file is (likely,
anyway) not going to be writable by anyone except root or daemon.

You need to either switch LOGFILEs after you DROPPRIVS or make that
log writable by the uid procmail drops privileges to.

Scott
-- 
Scott Wiersdorf
scott(_at_)perlcode(_dot_)org

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