procmail
[Top] [All Lists]

Re: Error while writing to "bla bla...

2001-12-17 23:34:29

On Mon, Dec 17, 2001 at 07:36:55PM -0800, Paul Thomas wrote:

Hello,

Hello yourself.

I'm stuck with an /etc/procmailrc recipe. The recipe works fine
when placed in the .procmailrc of a user home directory, but in
/etc/procmailrc it won't write the spam-check.log in the user
directory as it does the procmail.log file.

This is usually caused by the fact that /etc/procmailrc is run as root,
whereas ~/.procmailrc is run as the user.  If you don't specify a
full path to spam-check.log in the rule, that file will be written
in whatever happens to be the current working directory of your MTA
when it launches procmail.  You haven't said what MTA you're using, or
how it's configured, so we can't help much there, but you can find out
where you've accidentally stowed spam-check.log entries with:

# find / -name spam-check.log -print

:0 wc
 ^Received:.*for.*debris
| /usr/bin/spam-check -d
:0 wa
spam-check.log

Right, well, this is broken because there's no "*" at the start of your
only condition, and you aren't requesting a lock file in the recipe that
saves to the log file.  And where the heck is spam-check.log supposed to
live?  If in $MAILDIR, you should say so.  Otherwise procmail will try
to write the file wherever it happens to be at the moment.

And what are you trying to do, anyway?  Save in the spam-check.log
folder on the basis of the script's return value?  If so, you can
reduce the number of recipies with something like:

        :0:
        * ^Received:.*for.*debris
        * ? /usr/bin/spam-check -d
        $MAILDIR/spam-check.log

Here is the procmail.log result when the recipe is
run from /etc/procmailrc (DROPPRIVS=YES):

This makes things more interesting.  The above `find` command will
not find files that haven't been written.  If you're setting
DROPPRIVS=yes before you try to write the log, then a procmail running
with dropped privs will likely not be able to create a file in whatever
directory it's running in.

-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Development / Abuse / Whatever       vox: +1 416 598-0000
  IT Canada                                            http://www.it.ca/

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