Bug 180303 - cannot forward mail from procmail to cyrus
cannot forward mail from procmail to cyrus
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: cyrus-imapd (Show other bugs)
4.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Petr Rockai
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-06 19:47 EST by Frank DiPrete
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-12 07:11:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Frank DiPrete 2006-02-06 19:47:46 EST
Description of problem:
annot 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.10-1.RHEL4.1
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: [4426] Mon Feb  6 19:45:01 2006
procmail: Executing "/usr/bin/clamassassin"
/bin/sh: /usr/bin/clamassassin: No such file or directory
procmail: [4426] Mon Feb  6 19:45:01 2006
procmail: Error while writing to "/usr/bin/clamassassin"
procmail: Rescue of unfiltered data succeeded
procmail: [4426] Mon Feb  6 19:45:01 2006
procmail: No match on "^X-Virus-Status: Yes"
procmail: Executing "/usr/bin/spamc"
procmail: [4426] Mon Feb  6 19:45:02 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@0:/var/mail/fdiprete"
From root@tracker.houselan.net  Mon Feb  6 19:45:01 2006
 Subject: test rhel 4
  Folder: /var/mail/fdiprete
Comment 1 Frank DiPrete 2006-02-06 19:48:16 EST
same problem on fedora c3:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=180302
Comment 2 Frank DiPrete 2006-02-07 09:24:07 EST
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 3 Petr Rockai 2006-05-12 07:11:59 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.