]> code.citadel.org Git - citadel.git/commitdiff
* When the last argument of an IMAP APPEND command is a binary literal
authorArt Cancro <ajc@citadel.org>
Mon, 8 Mar 2004 05:26:49 +0000 (05:26 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 8 Mar 2004 05:26:49 +0000 (05:26 +0000)
  (i.e. all the time), the client will still be sending a CRLF after the
  literal.  Added an extra client_read() after the message input to absorb
  that extra CRLF, to keep client and server from getting out of sync.

citadel/ChangeLog
citadel/imap_misc.c

index de52e10d1e4cb0df7459fbfd66b1dabf4caedaea..439e5d9d91eefa0c038c923e1a51d8e1eb26cebe 100644 (file)
@@ -1,4 +1,10 @@
  $Log$
+ Revision 614.67  2004/03/08 05:26:49  ajc
+ * When the last argument of an IMAP APPEND command is a binary literal
+   (i.e. all the time), the client will still be sending a CRLF after the
+   literal.  Added an extra client_read() after the message input to absorb
+   that extra CRLF, to keep client and server from getting out of sync.
+
  Revision 614.66  2004/03/06 05:09:04  ajc
  * serv_smtp.c: don't offer the STARTTLS extension if TLS is already
    active.  Done for to-the-letter compliance with RFC2487.
@@ -5463,4 +5469,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index f1b9771841faa61545edab2c42bf4bcb716ebf58..dfa41e7d4eb772474cbbf360d790258a91704b59 100644 (file)
@@ -247,12 +247,22 @@ void imap_append(int num_parms, char *parms[]) {
        IMAP->transmitted_length = literal_length;
 
        cprintf("+ Transmit message now.\r\n");
+       lprintf(CTDL_DEBUG, "imap_append() expecting %d bytes\n",
+               literal_length);
        ret = client_read(IMAP->transmitted_message, literal_length);
        IMAP->transmitted_message[literal_length] = 0;
        if (ret != 1) {
                cprintf("%s NO Read failed.\r\n", parms[0]);
                return;
        }
+       lprintf(CTDL_DEBUG, "imap_append() finished reading message\n");
+
+       /* I think there's supposed to be a trailing CRLF after the
+        * literal (the message text) is received.  This call to
+        * client_gets() absorbs it.
+        */
+       client_gets(buf);
+       lprintf(CTDL_DEBUG, "Trailing CRLF: %s\n", buf);
 
        /* Convert RFC822 newlines (CRLF) to Unix newlines (LF) */
        lprintf(CTDL_DEBUG, "Converting newline format\n");