From: Timo Sirainen Date: Mon, 1 Feb 2016 18:26:19 +0000 (+0200) Subject: imap: Removed special EXPUNGE callback for an Outlook workaround. X-Git-Tag: 2.2.22.rc1~226 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7b25e0;p=thirdparty%2Fdovecot%2Fcore.git imap: Removed special EXPUNGE callback for an Outlook workaround. As the comment mentions, this workaround isn't needed if index files are used. Hopefully also the Outlook bug itself is gone nowadays.. In any case the current callback code didn't work, because it was returning FALSE and causing an assert in a pipelined EXPUNGE+APPEND combination after 6e9454f: Panic: file imap-client.c: line 862 (client_check_command_hangs): assertion failed: (!have_wait_unfinished || unfinished_count > 0) It would probably be possible to fix this, but it would complicate the code even further, so it's easier just to get rid of this feature. It was easily triggered by running imaptest stress testing. --- diff --git a/src/imap/cmd-expunge.c b/src/imap/cmd-expunge.c index 336be6174b..06589facbe 100644 --- a/src/imap/cmd-expunge.c +++ b/src/imap/cmd-expunge.c @@ -5,20 +5,6 @@ #include "imap-search-args.h" #include "imap-expunge.h" -static bool cmd_expunge_callback(struct client_command_context *cmd) -{ - if (cmd->client->sync_seen_deletes && !cmd->uid) { - /* Outlook workaround: session 1 set \Deleted flag and - session 2 tried to expunge without having seen it yet. - expunge again. MAILBOX_TRANSACTION_FLAG_REFRESH should - have caught this already if index files are used. */ - return cmd_expunge(cmd); - } - - client_send_tagline(cmd, "OK Expunge completed."); - return TRUE; -} - static bool ATTR_NULL(2) cmd_expunge_finish(struct client_command_context *cmd, struct mail_search_args *search_args) @@ -45,14 +31,8 @@ cmd_expunge_finish(struct client_command_context *cmd, } client->sync_seen_deletes = FALSE; - if ((client->enabled_features & MAILBOX_FEATURE_QRESYNC) != 0) { - return cmd_sync(cmd, MAILBOX_SYNC_FLAG_EXPUNGE, - IMAP_SYNC_FLAG_SAFE, "OK Expunge completed."); - } else { - return cmd_sync_callback(cmd, MAILBOX_SYNC_FLAG_EXPUNGE, - IMAP_SYNC_FLAG_SAFE, - cmd_expunge_callback); - } + return cmd_sync(cmd, MAILBOX_SYNC_FLAG_EXPUNGE, + IMAP_SYNC_FLAG_SAFE, "OK Expunge completed."); } bool cmd_uid_expunge(struct client_command_context *cmd)