Skip to content

Commit

Permalink
imap: Removed special EXPUNGE callback for an Outlook workaround.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen committed Feb 1, 2016
1 parent a58963a commit b7b25e0
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions src/imap/cmd-expunge.c
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit b7b25e0

Please sign in to comment.