Description of problem: Cannot configure procmail to forward to cyrus using deliver. deliver rejects the mesage with exit code 65 (data format error?) Version-Release number of selected component (if applicable): cyrus-imapd-2.2.12-1.1.fc3 procmail v3.22 2001/09/10 How reproducible: always Steps to Reproduce: 1. forward from procmail to cyrus-imapd deliver 2. (see procmailrc below) 3. Actual results: mail is rejected by deliver with exit code 65 and procmail delivers it to /var/spool/mail/user instead Expected results: delver via cyrus to imap mailbox Additional info: /etc/procmailrc LOGFILE=/var/log/mail/procmail.log VERBOSE=yes # check for viruses with clamd :0fw | /usr/bin/clamassassin # if virus is found dump it :0: * ^X-Virus-Status: Yes /var/tmp/virusbucket # send mail through spamd :0fw | /usr/bin/spamc # if marked as spam dump it :0: * ^X-Spam-Status: Yes /var/tmp/spambucket #hand off to cyrus for delivery :0W | /usr/lib/cyrus-imapd/deliver -e -a $LOGNAME -m user.$LOGNAME log: procmail: [16913] Mon Feb 6 19:26:28 2006 procmail: Executing "/usr/bin/clamassassin" procmail: [16913] Mon Feb 6 19:26:28 2006 procmail: No match on "^X-Virus-Status: Yes" procmail: Executing "/usr/bin/spamc" procmail: [16913] Mon Feb 6 19:26:35 2006 procmail: No match on "^X-Spam-Status: Yes" procmail: Executing "/usr/lib/cyrus-imapd/deliver,-e,-a,fdiprete,-m,user.fdiprete" procmail: Non-zero exitcode (65) from "/usr/lib/cyrus-imapd/deliver" procmail: Assigning "LASTFOLDER=/usr/lib/cyrus-imapd/deliver -e -a fdiprete -m user.fdiprete" procmail: Assigning "PATH=/home/fdiprete/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin" procmail: Locking "/var/mail/fdiprete.lock" procmail: Assigning "LASTFOLDER=/var/mail/fdiprete" procmail: Opening "/var/mail/fdiprete" procmail: Acquiring kernel-lock procmail: Unlocking "/var/mail/fdiprete.lock" procmail: Notified comsat: "fdiprete@1914:/var/mail/fdiprete" From root.net Mon Feb 6 19:26:28 2006 Subject: data format error Folder: /var/mail/fdiprete
tested imap and it works fine just can't forward from procmail to imap via deliver
same problem on RHEL4: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=180303
Found a workaround. After removing the From header cyrus will accept the forward: LOGFILE=/var/log/maillog VERBOSE=no # check for viruses with clamd :0fw | /usr/bin/clamassassin # if virus is found dump it :0: * ^X-Virus-Status: Yes /var/tmp/virusbucket # send mail through spamd :0fw | /usr/bin/spamc # if marked as spam dump it :0: * ^X-Spam-Status: Yes /var/tmp/spambucket # hand off to cyrus for delivery # strip From header - borks cyrus deliver (arg!) :0f | formail -I "From " :0w | /usr/lib/cyrus-imapd/deliver -e -a $LOGNAME -m user.$LOGNAME
That isn't a workaround. The From line is not part of the internet message format RFC and therefore is invalid. Cyrus correctly rejects such message. The problem is that procmail expects that the reading process wants to read mbox-formatted input, not just the message. Stripping the From line is therefore a correct solution.