I considered your two issues carefully.
I agree that the Status: line should always be at the start of a line and
that an extra blank line should not be written if the message has no body.
The attached ipop3d.patch file has both changes, and these changes will
appear in the next imap-2005 development snapshot.
The second issue is more problematic.
The POP3 protocol does not have any provision for "holes" in the mailbox
("message no longer exists"). In my opinion, the IMAP protocol does not
have "holes" either.
The problem is that the Cyrus server disagrees with that opinion; I
understand the technical issues why they made that decision even though I
continue to disagree with their chosen solution. The bottom line here is
that ipop3d is doing the best that it reasonably can given that, in
effect, it's been dealt a lousy hand of cards.
There will be one minor change: instead of the previous
retr 2
+OK 10030 octets
Status: RO
.
behavior you will now see
retr 2
+OK 10030 octets
Status: RO
.
That is, you'll only see one blank line after the Status: line.
The octet count will continue to be bogus; that came from the IMAP server.
That is why I believe that Cyrus' behavior here is non-compliant with the
specification. Regardless of whether there can be a "hole" in the
sequence space due to expunging (I say there can not, but I am not the
only voice), IMAP size counts must be exact. Since the IMAP server
already informed the client of a non-empty message, it can't withdraw the
message contents since that would change the size.
This will probably end up being hashed out with the Cyrus developers
offline from this list, and eventually we (meaning them and me) will
figure out something better. But for the nonce, I hope that the attached
patch will suffice for you.
-- Mark --
http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
*** ipop3d.c~ Wed Apr 13 17:44:10 2005
--- ipop3d.c Mon Nov 14 09:21:41 2005
***************
*** 10,16 ****
* Internet: [EMAIL PROTECTED]
*
* Date: 1 November 1990
! * Last Edited: 13 April 2005
*
* The IMAP toolkit provided in this Distribution is
* Copyright 1988-2005 University of Washington.
--- 10,16 ----
* Internet: [EMAIL PROTECTED]
*
* Date: 1 November 1990
! * Last Edited: 14 November 2005
*
* The IMAP toolkit provided in this Distribution is
* Copyright 1988-2005 University of Washington.
***************
*** 343,361 ****
sprintf (tmp,"+OK %lu octets\015\012",
(elt = mail_elt (stream,msg[i]))->rfc822_size + SLEN);
PSOUT (tmp);
! /* output header */
t = mail_fetch_header (stream,msg[i],NIL,NIL,&k,FT_PEEK);
! blat (t,-1,k,NIL);
! /* output status */
sprintf (tmp,STATUS,elt->seen ? "R" : " ",
elt->recent ? " " : "O");
! PSOUT (tmp);
! CRLF; /* delimit header and text */
/* output text */
t = mail_fetch_text (stream,msg[i],NIL,&k,
FT_RETURNSTRINGSTRUCT);
! blat (t,-1,k,&stream->private.string);
! CRLF; /* end of list */
PBOUT ('.');
CRLF;
}
--- 343,370 ----
sprintf (tmp,"+OK %lu octets\015\012",
(elt = mail_elt (stream,msg[i]))->rfc822_size + SLEN);
PSOUT (tmp);
! /* get header */
t = mail_fetch_header (stream,msg[i],NIL,NIL,&k,FT_PEEK);
! blat (t,-1,k,NIL);/* write up to trailing CRLF */
! /* build status */
sprintf (tmp,STATUS,elt->seen ? "R" : " ",
elt->recent ? " " : "O");
! /* normal header ending with CRLF CRLF? */
! if (t[k-3] == '\012') {
! PSOUT (tmp); /* write status */
! CRLF; /* then write second CRLF */
! }
! else { /* abnormal - no blank line at end of header */
! CRLF; /* write CRLF first then */
! PSOUT (tmp);
! }
/* output text */
t = mail_fetch_text (stream,msg[i],NIL,&k,
FT_RETURNSTRINGSTRUCT);
! if (k) { /* only if there is a text body */
! blat (t,-1,k,&stream->private.string);
! CRLF; /* end of list */
! }
PBOUT ('.');
CRLF;
}
***************
*** 402,415 ****
/* update highest message accessed */
if (i > last) last = i;
PSOUT ("+OK Top of message follows\015\012");
! /* output header */
t = mail_fetch_header (stream,msg[i],NIL,NIL,&k,FT_PEEK);
! blat (t,-1,k,NIL);
! /* output status */
sprintf (tmp,STATUS,elt->seen ? "R" : " ",
elt->recent ? " " : "O");
! PSOUT (tmp);
! CRLF; /* delimit header and text */
if (j) { /* want any text lines? */
/* output text */
t = mail_fetch_text (stream,msg[i],NIL,&k,
--- 411,431 ----
/* update highest message accessed */
if (i > last) last = i;
PSOUT ("+OK Top of message follows\015\012");
! /* get header */
t = mail_fetch_header (stream,msg[i],NIL,NIL,&k,FT_PEEK);
! blat (t,-1,k,NIL);/* write up to trailing CRLF */
! /* build status */
sprintf (tmp,STATUS,elt->seen ? "R" : " ",
elt->recent ? " " : "O");
! /* normal header ending with CRLF CRLF? */
! if (t[k-3] == '\012') {
! PSOUT (tmp); /* write status */
! CRLF; /* then write second CRLF */
! }
! else { /* abnormal - no blank line at end of header */
! CRLF; /* write CRLF first then */
! PSOUT (tmp);
! }
if (j) { /* want any text lines? */
/* output text */
t = mail_fetch_text (stream,msg[i],NIL,&k,
_______________________________________________
Imap-uw mailing list
[email protected]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw