Gordon Messmer wrote:
> Charles Galpin wrote:
> > Can you also explain what you mean about netscape. I don't use it's client
> > much. How do things like outlook express like maildirs?
> 
> Both netscape and outlook express are terrible IMAP clients.  Netscape
> often requests message id -1, which is totally invalid, and courier
> rejects that.  Netscape then dies, and will no longer retrieve new
> headers from courier-imap.

Hehe, I think that the following patch should be sufficient.  Basically,
since only numeric input (or *) is valid, I strip out any character that
isn't a number or a '*' OR is a '0'.  It's still possible that a broken
request won't return the message expected, but I can't fix everything.  

I'm going to mail test this a bit before I send it to the courier-imap
author, but I'm uploading rpms of courier-imap to
ftp://duke.eburg.com/pub/linux/redhat-6.x-mycontrib now.

MSG
--- courier-imap-0.21/imap/imaptoken.c.orig     Mon Jan 10 21:42:24 2000
+++ courier-imap-0.21/imap/imaptoken.c  Mon Jan 10 21:41:24 2000
@@ -386,6 +386,24 @@
        if (tok->tokentype == IT_NUMBER)        return (1);
        if (tok->tokentype != IT_ATOM)          return (0);
        p=tok->tokenbuf;
+
+       if ( (!isdigit((int)(unsigned char)*p) || *p == '0')
+           && *p != '*')
+       {
+       char *tmp;
+
+               while ( (!isdigit((int)(unsigned char)*p) || *p == '0')
+                      && *p != '*')
+               {
+                       p++;
+               }
+               if(*p == 0)     return(0);
+               
+               tmp = strdup(p);
+               free(tok->tokenbuf);
+               tok->tokenbuf = tmp;
+       }
+               
        while (isdigit((int)(unsigned char)*p) || *p == '*')
        {
                if (*p == '0')  return (0);

Reply via email to