From: Timo Sirainen Date: Mon, 25 Jan 2016 15:37:02 +0000 (+0200) Subject: imap: Finish all commands before starting IDLE. X-Git-Tag: 2.2.22.rc1~288 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=759a60c896270a74ef4a94ad348fe3722f183608;p=thirdparty%2Fdovecot%2Fcore.git imap: Finish all commands before starting IDLE. We don't want to send tagged command replies only after the DONE. Also this fixes assert-crash: Panic: file imap-client.c: line 852 (client_check_command_hangs): assertion failed: (!have_wait_unfinished || unfinished_count > 0) Which could be reproduced by: printf "0 SELECT INBOX\n1 NOOP\n2 IDLE\n"; read; printf "DONE\n"; read) | ./imap --- diff --git a/src/imap/imap-commands.c b/src/imap/imap-commands.c index f5679ba3a0..613098aabc 100644 --- a/src/imap/imap-commands.c +++ b/src/imap/imap-commands.c @@ -54,7 +54,11 @@ static const struct command imap_ext_commands[] = { { "ENABLE", cmd_enable, 0 }, { "ID", cmd_id, 0 }, { "IDLE", cmd_idle, COMMAND_FLAG_BREAKS_SEQS | - COMMAND_FLAG_REQUIRES_SYNC }, + COMMAND_FLAG_REQUIRES_SYNC | + /* finish syncing and sending + all tagged commands before + IDLE is started */ + COMMAND_FLAG_BREAKS_MAILBOX }, { "GETMETADATA", cmd_getmetadata, 0 }, { "SETMETADATA", cmd_setmetadata, 0 }, { "NAMESPACE", cmd_namespace, 0 },