Subject: important compatibility patch to UW c-client library

From: Mark Crispin <[email-masked]>
Date: Thu, 22 Aug 2002 11:20:49 -0700 (PDT)

It has recently been discovered that c-client's IMAP client parser does
not properly handle BODYSTRUCTURE extension data that is in the form of a
literal.  Unfortunately, this creates a compatibility problem with some
newer IMAP servers which generate this extension data (including the
latest UW imapd in imap-2002!).

The fix is to change file c-client/imap4r1.c, line:
      net_getbuffer (LOCAL->netstream,j = max (i,(long) IMAPTMPLEN - 1),
to become:
      net_getbuffer (LOCAL->netstream,j = min (i,(long) IMAPTMPLEN - 1),

That is, change the "max" to a "min".  After making this change, rebuild
c-client and/or Pine.  Make sure that imap4r1.c is recompiled.

The bug is that instead of reading the desired extension data, it reads
IMAPTMPLEN-1 bytes (generally a much larger number) beyond the extension
data, thus losing synchronization with subsequent data.  The user either
sees a proliferation of error messages, or the IMAP session seems to get
stuck in a read timeout.

As far as I know, this problem has only bit two people so far, but with
the proliferation of newer IMAP servers which generate extension data this
may bite more people in the future.

This fix is for *ALL* versions of c-client up to and including the one in
imap-2002 RC2; this also means *ALL* versions of Pine up to and including
Pine 4.44.  The fix WILL be in imap-2002 RC3 (and the release version) and
the release version of Pine 4.50.

I *may* withdraw the generation of the extension data in UW imapd as a
temporary measure; however other IMAP servers are also generating this
extension data so the genie is out of the bottle.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------