IMAP server: suppress untagged 'EXISTS' and 'EXPUNGE' responses
authorArt Cancro <ajc@citadel.org>
Sun, 9 Dec 2007 04:31:24 +0000 (04:31 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 9 Dec 2007 04:31:24 +0000 (04:31 +0000)
if the client just transmitted a command containing a literal.
Buggy IMAP implementations choke on this even though it is legal.
This is an attempt to fix Bug #308.

citadel/modules/imap/serv_imap.c

index 31b3e5c96fb9cad2f3c677e48a3892064c2c7902..b6ec6e5c5b4b051d312c233294cc03affc59ea26 100644 (file)
@@ -1370,19 +1370,24 @@ void imap_command_loop(void)
                return;
        }
 
-       /* Ok, at this point we're in normal command mode.  The first thing
-        * we do is print any incoming pages (yeah! we really do!)
-        */
-       imap_print_instant_messages();
 
-       /*
-        * Before processing the command that was just entered... if we happen
-        * to have a folder selected, we'd like to rescan that folder for new
-        * messages, and for deletions/changes of existing messages.  This
-        * could probably be optimized somehow, but IMAP sucks...
+       /* Ok, at this point we're in normal command mode.
+        * If the command just submitted does not contain a literal, we
+        * might think about delivering some untagged stuff...
         */
-       if (IMAP->selected) {
-               imap_rescan_msgids();
+       if (cmdbuf[strlen(cmdbuf)-1] != '}') {
+
+               imap_print_instant_messages();
+       
+               /*
+                * Before processing the command that was just entered... if we happen
+                * to have a folder selected, we'd like to rescan that folder for new
+                * messages, and for deletions/changes of existing messages.  This
+                * could probably be optimized somehow, but IMAP sucks...
+                */
+               if (IMAP->selected) {
+                       imap_rescan_msgids();
+               }
        }
 
        /* Now for the command set. */