Bug 180302

Summary: cannot forward mail from procmail to cyrus
Product: [Fedora] Fedora Reporter: Frank DiPrete <fdiprete>
Component: cyrus-imapdAssignee: Petr Rockai <prockai>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-12 11:10:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank DiPrete 2006-02-07 00:30:29 UTC
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

Comment 1 Frank DiPrete 2006-02-07 00:31:57 UTC
tested imap and it works fine just can't forward from procmail to imap via deliver

Comment 2 Frank DiPrete 2006-02-07 00:48:32 UTC
same problem on RHEL4:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=180303

Comment 3 Frank DiPrete 2006-02-07 14:24:50 UTC
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

Comment 4 Petr Rockai 2006-05-12 11:10:56 UTC
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.