Bug 107692

Summary: messages are rejected by fetchmail
Product: [Fedora] Fedora Reporter: Alexandre Oliva <oliva>
Component: fetchmailAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: fabrice, steve
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: fetchmail-6.2.5-6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-11 18:00:06 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:
Attachments:
Description Flags
the mailbox that triggers the bug
none
Proposed patch
none
Proposed spec patch none

Description Alexandre Oliva 2003-10-22 03:27:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031014

Description of problem:
Since the upgrade to -8, fetchmail started rejecting some e-mails that it used
to get perfectly well from a remote imap server.  It prints messages like this:

reading message aoliva.ic.unicamp.br:1 of 7 (2077 header octets)
..fetchmail: message delimiter found while scanning headers
 not flushed

and the message remains in the remote mailbox, while I get a message from
FETCHMAIL-DAEMON in my local mailbox.  This is a bad regressions.

The fetchmail configuration file says:

set daemon 900
set postmaster aoliva
set no bouncemail
defaults
   protocol imap
   auth ssh
   # mda "/usr/bin/procmail -d aoliva"
   to aoliva
   expunge 0
poll oliva@lsd
   via emilia.lsd.ic.unicamp.br.
   plugin "ssh -x -a -l oliva emilia bin/imapd"

imapd on the remote end is imap-2001a-18 (from Shrike).

I'll attach the contents of the remote mailbox after that fetchmail session was
completed, with the not-flushed message by itself.

Version-Release number of selected component (if applicable):
fetchmail-6.2.0-8

How reproducible:
Always

Steps to Reproduce:
1.store the attached e-mail in your /var/spool/mail/box
2.set up fetchmail to do imap over ssh from there
3.run it


Actual Results:  the message isn't fetched.

Expected Results:  it should.  the previous release did.  fetchmail-6.2.0-3,
that I still have handy, does as well.

Additional info:

Comment 1 Alexandre Oliva 2003-10-22 03:28:24 UTC
Created attachment 95376 [details]
the mailbox that triggers the bug

Comment 2 Fabrice Bellet 2003-11-13 17:14:49 UTC
I have the same problem. This is related to the patch
fetchmail-6.2.0-reply_hack.patch. In my case the message is silently
flushed from the server despite the error. The problem is that linelen
is modified by reply_hack(), but its value is used elsewhere to
decrement a char counter in the mainloop. Does this patch work for you ?

--- transact.c	2003-11-13 18:09:39.000000000 +0100
+++ transact.c.new	2003-11-13 18:05:11.000000000 +0100
@@ -415,7 +415,7 @@
     skipcount = 0;
     ctl->mimemsg = 0;
 
-    for (remaining = fetchlen; remaining > 0 || protocol->delimited;
remaining -= linelen)
+    for (remaining = fetchlen; remaining > 0 || protocol->delimited; )
     {
 	char *line;
 	int overlong = FALSE;
@@ -433,6 +433,7 @@
 		return(PS_SOCKET);
 	    }
 	    set_timeout(0);
+	    remaining -= n;
 	    linelen += n;
 	    msgblk.msglen += n;
 


Comment 3 Alexandre Oliva 2003-11-20 02:21:46 UTC
Thanks, I can confirm that the patch fixes the problem, apparently
without introducing any ill effects.

Comment 4 Fabrice Bellet 2003-12-11 15:21:46 UTC
Maybe an updated package could be released for Fedora Core 1 (as this
bug also applies to FC1) ?

Comment 5 Alexandre Oliva 2004-02-13 15:04:32 UTC
Any reason why this patch didn't make it even to FC2test1?

Comment 6 Alexandre Oliva 2004-02-24 13:40:14 UTC
Patch still applies cleanly atop of 6.2.0-10, and avoids the
unfetchable-message problem we've had since 6.2.0-8.  Could you please
oh please merge the patch in?  I've rolled my own RPMS to fix the
issue, and I could provide diffs to spec files if you'd like.

Comment 7 Simon Perreault 2004-04-03 13:52:57 UTC
Created attachment 99088 [details]
Proposed patch

Comment 8 Simon Perreault 2004-04-03 13:55:35 UTC
Created attachment 99089 [details]
Proposed spec patch

Now you don't have any excuse not to close this bug. ;)

Comment 9 Simon Perreault 2004-04-03 13:57:56 UTC
In the meantime, for those interested, you can find the RPM at
http://nomis80.org/rpms/fetchmail-6.2.0-8.1.i386.rpm.