diff --git a/OpenChange/MAPIStoreMailVolatileMessage.m b/OpenChange/MAPIStoreMailVolatileMessage.m index fb5defdae8..513b94f267 100644 --- a/OpenChange/MAPIStoreMailVolatileMessage.m +++ b/OpenChange/MAPIStoreMailVolatileMessage.m @@ -943,9 +943,13 @@ - (void) save: (TALLOC_CTX *) memCtx [mapping registerURL: [self url] withID: mid]; /* synchronise the cache and update the change key with the one provided - by the client. Before doing this, lets issue a noop because of timing - issues with Dovecot. */ - [client noop]; + by the client. Before doing this, lets issue a unselect/select combo + because of timing issues with Dovecot in obtaining the latest modseq. + Sometimes, Dovecot doesn't return the newly appended UID if we do + a "UID SORT (DATE) UTF-8 (MODSEQ XYZ) (NOT DELETED)" command (where + XYZ is the HIGHESTMODSEQ+1) immediately after IMAP APPEND */ + [client unselect]; + [client select: folderName]; [(MAPIStoreMailFolder *) container synchroniseCache]; changeKey = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)];