From c33e030588d04580fdd867007cf9ab9058324ca9 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 15 Sep 2010 10:33:07 +0000 Subject: [PATCH] Improved rationale in UI/MailerUI/UIxMailListActions.m Monotone-Parent: 4371482c9c25a9757f941f8b27520cda720cea01 Monotone-Revision: 0bf76f3e9fbac283fc0390e74b1e27d8d12c23c7 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-09-15T10:33:07 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/UIxMailListActions.m | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/UI/MailerUI/UIxMailListActions.m b/UI/MailerUI/UIxMailListActions.m index 0ee7ba64f..37480a71f 100644 --- a/UI/MailerUI/UIxMailListActions.m +++ b/UI/MailerUI/UIxMailListActions.m @@ -596,6 +596,26 @@ [headers addObject: msg]; while (message) { + // We must check for "umimportant" untagged responses. + // + // It's generally caused by IMAP server processes sending untagged IMAP responses to SOGo in differnent IMAP + // connections (SOGo might use 2-3 per user). Say you ask your messages: + // + // 127.000.000.001.40725-127.000.000.001.00143: 59 uid fetch 62 (UID FLAGS ENVELOPE RFC822.SIZE BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (X-PRIORITY)]) + // 127.000.000.001.00143-127.000.000.001.40725: * 62 FETCH (UID 62 FLAGS (\Seen) RFC822.SIZE 854 ENVELOPE .... ( + // * 61 FETCH (FLAGS (\Deleted \Seen)) + // * 62 FETCH (FLAGS (\Deleted \Seen)) + // * 63 FETCH (FLAGS (\Deleted \Seen)) + // 59 OK Fetch completed. + // + // We must ignore the * 61 .. * 63 untagged responses. + // + if (![message objectForKey: @"uid"]) + { + [self setMessage: [msgsList nextObject]]; + continue; + } + msg = [NSMutableArray arrayWithCapacity: 12]; // Columns data @@ -668,14 +688,7 @@ [msg addObject: [self msgRowID]]; // uid - if ([message objectForKey: @"uid"]) - { - [msg addObject: [message objectForKey: @"uid"]]; - [headers addObject: msg]; - } - else - [self logWithFormat: @"Invalid UID for message: %@", message]; - + [msg addObject: [message objectForKey: @"uid"]]; [headers addObject: msg]; [self setMessage: [msgsList nextObject]];