From: Art Cancro Date: Sun, 9 Dec 2007 04:31:24 +0000 (+0000) Subject: IMAP server: suppress untagged 'EXISTS' and 'EXPUNGE' responses X-Git-Tag: v7.86~2661 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=95d5f5081fd65e416127be410ff7240b19abf002 IMAP server: suppress untagged 'EXISTS' and 'EXPUNGE' responses 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. --- diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index 31b3e5c96..b6ec6e5c5 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -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. */