Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 26 Jan 2003 16:18:39 +0000
From: Nuno Teixeira <nunotex@...quorum.com>
To: popa3d-users@...ts.openwall.com
Cc: Solar Designer <solar@...nwall.com>
Subject: Re: "was not the expected length ..." errors


    Hi,
    
    I'm very happy by helping you in this bug.
    
    Well, I'm using popa3d-0.5.1 FreeBSD port, and I apply the changes 
    manually in mailbox.c and the problem is solved.
    
    The FreeBSD popa3d port maintainer is Sergey Samoyloff 
    <gonza@...hline.ru>. I think that I can send him the patch for 
    popa3d-0.5.1.
    
    Please tell me if the patch is correct for this version (attached to 
    this message).
    
    Thanks very much,
    
    		Nuno Teixeira   
    
On Sun, Jan 26, 2003 at 07:45:52AM +0300, Solar Designer wrote:
> On Sat, Jan 25, 2003 at 08:42:39PM +0000, Nuno Teixeira wrote:
> 
> Hi,
> 
> >     I'm making tests with fetchmail on FreeBSD 5.0R and it gives the error: 
> >     "... was not the expected length (608 actual != 610 expected)" but it 
> >     fetches the mail ok.
> 
> Thanks a lot for your report.
> 
> Actually, this appears to be a bug I've introduced in popa3d 0.4.9.3.
> Before this version, popa3d would often include the mailbox separator
> trailing empty line in messages.  I decided that I don't like this
> (the line is a part of the mailbox format, not a part of the messages)
> and killed this property in 0.4.9.3.  Unfortunately, this lack of an
> empty line triggered a bug in Outlook Express (now worked around in
> 0.5.9 by still adding the empty line whenever necessary for MSOE), and
> as you have now noticed I forgot to update the reported message length
> accordingly.  I wish someone who uses fetchmail reported this earlier.
> Other POP3 clients clearly don't do this check because it doesn't
> really affect anything (there's a more reliable way to see when a
> whole message has been received).
> 
> Please test the patch below (against 0.5.9) and let me know if it
> solves the problem for you.  I will then include it in the release.
> 
> diff -ur popa3d-0.5.9/mailbox.c popa3d-0.5.9-size-fix/mailbox.c
> --- popa3d-0.5.9/mailbox.c	Sun Sep  8 13:52:57 2002
> +++ popa3d-0.5.9-size-fix/mailbox.c	Sun Jan 26 07:30:26 2003
> @@ -227,6 +227,7 @@
>  				if (!msg.data_offset) break;
>  				msg.raw_size = offset - msg.raw_offset;
>  				msg.data_size = offset - body - msg.data_offset;
> +				msg.size -= body << 1;
>  				MD5_Final(msg.hash, &hash);
>  				if (db_op(&msg)) break;
>  			}
> @@ -319,6 +320,7 @@
>  		if (!msg.data_offset) return 1;
>  		msg.raw_size = offset - msg.raw_offset;
>  		msg.data_size = offset - (blank & body) - msg.data_offset;
> +		msg.size -= (blank & body) << 1;
>  		MD5_Final(msg.hash, &hash);
>  		if (db_op(&msg)) return 1;
>  
> -- 
> /sd

-- 

/*
PGP fingerprint:
C6D1 06ED EB54 A99C 6B14  6732 0A5D 810D 727D F6C6
*/

View attachment "popa3d.patch" of type "text/plain" (575 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.