I for some reason cannot use procmail for filtering (such as with spamassassin) between postfix and cyrus-imapd.
Currently I have in /etc/postfix/main.cf:
mailbox_transport = procmail
in master.cf:
procmail unix - n n - - pipe
flags=R user=cyrus argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
in /etc/procmailrc:
LOGNAME = $1
EXTENSION = $2
PATH=$1/bin:/usr/bin:/bin:/usr/local/bin:/usr/lib/cyrus:.
SHELL=/bin/sh
MAILDIR=/var/spool/mail
LOGFILE=/tmp/procmail_log
DEFAULT=$HOME/.Maildrop
VERBOSE=yes
DELIVER="/usr/lib/cyrus/bin/deliver"
USERINBOX="$DELIVER -a $USER $USER"
INCLUDERC=/home/$USER/.procmailrc
:0 w
| $USERINBOX
Whichever one we tried, failed
EXITCODE = $?
HOST
The only notable change from a similar, working setup is that the master.cf file in the old setup used “nobody” as the transport user and the new system specifies “cyrus” as the user.
The /tmp/procmail_log default output file shows:
www::/etc # cat /tmp/procmail_log
procmail: [6894] Mon May 3 16:09:57 2010
procmail: Assigning “DELIVER=/usr/lib/cyrus/bin/deliver”
procmail: Assigning "USERINBOX=/usr/lib/cyrus/bin/deliver -a "
procmail: Assigning “INCLUDERC=/home//.procmailrc”
procmail: Couldn’t read “/home//.procmailrc”
procmail: Executing “/usr/lib/cyrus/bin/deliver,-a”
procmail: [6898] Mon May 3 16:09:57 2010
procmail: Assigning “DELIVER=/usr/lib/cyrus/bin/deliver”
procmail: Assigning "USERINBOX=/usr/lib/cyrus/bin/deliver -a "
procmail: Assigning “INCLUDERC=/home//.procmailrc”
procmail: Couldn’t read “/home//.procmailrc”
procmail: Executing “/usr/lib/cyrus/bin/deliver,-a”
/usr/lib/cyrus/bin/deliver: option requires an argument – ‘a’
421-4.3.0 usage: deliver -C <alt_config> ] -m mailbox] -a auth] -r return_path] -l] -D]
421 4.3.0 v2.3.14
/usr/lib/cyrus/bin/deliver: option requires an argument – ‘a’
421-4.3.0 usage: deliver -C <alt_config> ] -m mailbox] -a auth] -r return_path] -l] -D]
421 4.3.0 v2.3.14
procmail: Program failure (75) of “/usr/lib/cyrus/bin/deliver”
procmail: Assigning “LASTFOLDER=/usr/lib/cyrus/bin/deliver -a”
procmail: Assigning “EXITCODE=75”
procmail: Assigning “HOST”
procmail: HOST mismatched “www”
Subject: try 52
Folder: /usr/lib/cyrus/bin/deliver -a 285
procmail: Error while writing to “/usr/lib/cyrus/bin/deliver”
procmail: Program failure (75) of “/usr/lib/cyrus/bin/deliver”
procmail: Assigning “LASTFOLDER=/usr/lib/cyrus/bin/deliver -a”
procmail: Assigning “EXITCODE=75”
procmail: Assigning “HOST”
procmail: HOST mismatched “www”
Subject: try 51
Folder: /usr/lib/cyrus/bin/deliver -a 284
procmail: [6911] Mon May 3 16:11:16 2010
procmail: Assigning “DELIVER=/usr/lib/cyrus/bin/deliver”
procmail: Assigning "USERINBOX=/usr/lib/cyrus/bin/deliver -a "
procmail: Assigning “INCLUDERC=/home//.procmailrc”
procmail: Couldn’t read “/home//.procmailrc”
procmail: Executing “/usr/lib/cyrus/bin/deliver,-a”
/usr/lib/cyrus/bin/deliver: option requires an argument – ‘a’
421-4.3.0 usage: deliver -C <alt_config> ] -m mailbox] -a auth] -r return_path] -l] -D]
421 4.3.0 v2.3.14
procmail: Program failure (75) of “/usr/lib/cyrus/bin/deliver”
procmail: Assigning “LASTFOLDER=/usr/lib/cyrus/bin/deliver -a”
procmail: Assigning “EXITCODE=75”
procmail: Assigning “HOST”
procmail: HOST mismatched “www”
Subject: try 52
Folder: /usr/lib/cyrus/bin/deliver -a 285
Obviously it is losing track of the receiving user at some point, given the couldn’t read “/home//.procmailrc”
error and the missing user in the Assigning "USERINBOX=/usr/lib/cyrus/bin/deliver -a " error.
Can anyone shed light on why postfix is not providing the user to procmail? I have tried using the two definitions of mailbox_command in the main.cf comments:
#mailbox_command = /some/where/procmail
#mailbox_command = /some/where/procmail -a “$EXTENSION”
instead of the mailbox_transport = procmail line with no luck.