Jan wrote regarding '[SLE] Procmail + postfix' on Wed, Sep 08 at 08:54:
Hello I have changed my MTA from sendmail to postfix and now i am not able to use procmail with postfix. I think it is the rights problem. I log procmail to a file /tmp/procmail.log and i keep all incoming mails in /var/spool/mail/postall and if you look at the file privileges, after sending mail for the first time, you see: -rw------- 1 john users 656 Sep 8 15:06 /tmp/procmail.log and the same for /var/spool/mail/postall. That is the state of the files after i sent mail from a user to user john. And then when I am trying to send mail to different user, the log says error while writting /tmp/procmail.log. Obviously considering the rights of the file. That means procmail always start its processes as user $LOGNAME (maybe not all of them) So is there any other way how to fix it than just change the rights of the file /tmp/procmail.log for group -w- and all the files in /var/spool/mail/... and /var/spool/mail/postall and so on I think this solution is not very secure, all the mailboxes of the users with rights for group "users" writable. All my users are in the group "users"
I am starting procmail as user nobody in the file master.cf and in the file main.cf using mailbox_command = /usr/bin/procmail
So, is the reasoning behind this that you want one directory to get a copy of all incoming mail? If so, you should look into postfix's always_bcc option instead. Anyway, procmail assumes the UID of the message's recipient. So, you can't have it logging to a file that's only writable by one user if the process is gonna run as multiple users - unless you make that file writable by all the users procmail will run under. I assume that you have set LOGFILE in /etc/procmailrc. A possible solution would be to set LOGFILE to /tmp/procmail-$LOGNAME.log or something similar, or maybe /tmp/procmail_log/$LOGNAME. You might also consider setting VERBOSE=1 in /etc/procmailrc in order to get more verbose debug logs, if you're still having problems with it. --Danny