procmail
[Top] [All Lists]

Re: procmail logging - not consistent

2001-08-04 13:53:01
Louis LeBlanc <leblanc+procmail(_at_)acadia(_dot_)ne(_dot_)mediaone(_dot_)net> 
writes:
Hey all.  I am having trouble getting consistent or reliable logging
from procmail.  Here is what I have at the top of /etc/procmailrc

LOGNAME = $1
EXTENSION = $2
PATH=$1/bin:/usr/bin:/bin:/usr/local/bin:.
SHELL=/bin/sh
MAILDIR=/usr/cyrus
LOGFILE=/home/cyrus/.procmail.log
DEFAULT=$HOME/
...
I don't think $HOME gets set in procmailrc, because when I set
LOGFILE=$HOME/.procmail.log not all incoming mail will result in a
procmail log entry.  Occasionally I get something like this in
/var/log/maillog:

Aug  4 13:12:38 acadia procmail[3039]: Error while writing to "//.procmail.log"

And I can only seem to get fairly reliable logging by setting the
logfile path explicitly and allowing group writing to it.

Setting the LOGNAME variable does not make procmail update the
HOME variable, nor does it make procmail change user IDs.  When in
deliverymode (-d), the LOGNAME and HOME variable reflect the user that
procmail is delivering to.  Otherwise they relect the user that procmail
is running as.  Note that when mailfiltermode (-m) with a rcfile in
/etc/procmailrcs/, they reflect the owner of the rcfile as procmail has
assumed that user ID.

This also means that setting DEFAULT to $HOME/ won't work because either
procmail won't be able to deliver there or the resulting files will be
owned by the wrong uid.  Yes, that's just a fallback in case 'deliver'
fails, but a broken fallback is pointless.  If "deliver" fails, you
almost certainly just just let procmail return failure to sendmail and
have the message bounce.


In sendmail.mc, I am using the following:

define(`confDEF_USER_ID',``mail:mail'')

and

define(`CYRUS_MAILER_USER',`cyrus:mail')

which implies to me that sendmail should be run as user mail:mail,
while the cyrus mailer (in my case procmail) will be executed as
cyrus:mail.

Nope.  You're confusing confDEF_USER_ID with confRUN_AS_USER.
confDEF_USER_ID is just the default user/group combo to be used when
invoking programs.  This is overridden on individual mailers by parameters
like CYRUS_MAILER_USER.  That'll be overridden/ignored by procmail if
you specified an rcfile under /etc/procmailrcs with the -m flag.


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>