Subject: IMAP 4.7 bugs?

From: "Sung-hoon.Choi" <[email-masked]>
Date: Fri, 9 Jun 2000 14:20:10 +0900 (KST)

Hello.

I am a web-mail developer. ( about 1,000,000 mail users )

For web-mail service, we use UW-IMAP package.

I had found serveral bugs in UW-IMAP packages 4.7

I made two patches for imap-4.7b. ( imap-4.7c have same bugs? )

1) unix.c

--- unix.c.orig Wed Feb 23 09:43:30 2000
+++ unix.c      Thu Jun  8 21:28:54 2000
@@ -321,7 +321,7 @@
          *s = '\0';            /* tie off to get just superior */
                                /* name doesn't exist, create it */
          if ((stat (tmp,&sbuf) || ((sbuf.st_mode & S_IFMT) != S_IFDIR)) &&
-             !dummy_create (stream,tmp)) {
+             !dummy_create (stream,newname)) {
            unix_unlock (fd,NIL,&lockx);
            unix_unlock (ld,NIL,NIL);
            unlink (lock);
@@ -1505,6 +1505,7 @@
        bs->curpos += k;        /* increment new position */
        bs->cursize -= k;       /* eat that many bytes */
       }
+      if (!bs->cursize) SETPOS (bs,GETPOS (bs));
       if (SIZE (bs)) SNX (bs); /* skip over newline if one seen */
       ret[i++] = '\n';         /* make sure newline at end */
       ret[i] = '\0';           /* makes debugging easier */

First,
   in blackbox mode, newley created mailbox name is incorrect.
   ( tmp --> newname )

Second,
   must do "if (!bs->cursize) SETPOS (bs,GETPOS (bs));" after while() loop

   if bs->cursize equals j,
   after while() the bs->cursize becomes zero.

   So, calling SNX ( bs ) makes bs->cursize too big.

2). pop3.c

--- pop3.c.orig Fri Oct 29 13:34:50 1999
+++ pop3.c      Thu Jun  8 21:27:44 2000
@@ -503,7 +503,8 @@
   }
                                /* abort requested */
   else ret = net_sout (LOCAL->netstream,"*\015\012",3);
-  pop3_reply (stream);         /* set up response */
+  if ( ret ) ret = pop3_reply (stream);
+  else pop3_reply (stream);            /* set up response */
   return ret;
 }

Some POP3 server just closed connection without ERR response when authentication failed.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
   DreamWiz Inc. 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
   Development Team  ( Mail/Web/Network/System )
  
   Choi, Sung-hoon ( 최성훈 ) 
  
   Phone : +82-2-550-3541
   Fax      : +82-2-550-3505
   HP       : 011-9730-9689 
   ICQ #   : 33529335 
   WWW  : http;//my.dreamwiz.com/shoon/
                http://www.netian.com/~shoon/ 
                http://www.chollian.net/~shoon007 /
   E-mail : mailto:[email-masked]
                mailto:[email-masked] 
                mailto:[email-masked] 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 

-------------------------------------------------

DreamWiz Free Mail @ http://www.dreamwiz.com/

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Thu, 8 Jun 2000 22:38:25 -0700 (PDT)

Thank you very much for your patches!

I have adopted your unix.c patches in the latest imap-2000 snapshot:
	ftp://ftp.cac.washington.edu/mail/imap-2000.BETA.tar.Z
exactly as you suggested.  I made a slight modification to your pop3.c patch.

imap-4.7 is no longer actively developed.  Please test imap-2000, since that
is the version that is currently being developed.  imap-2000 has other
bugfixes and several desirable new features, most notably SSL support.