From 95d5f5081fd65e416127be410ff7240b19abf002 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 9 Dec 2007 04:31:24 +0000 Subject: [PATCH] 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. --- citadel/modules/imap/serv_imap.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) 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. */ -- 2.30.2