diff --git a/ChangeLog b/ChangeLog index e689671cd..5b4987aca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * SoObjects/SOGo/SOGoGCSFolder.m (setRoles:forUser:..) We now even cache "None" roles. + * SoObjects/Mailer/SOGoMailObject.m (fetchCoreInfos) + We now handle correctly untagged responses. 2011-10-13 Francis Lachapelle diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 8faf74c47..15ca436e5 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -217,6 +217,7 @@ static BOOL debugSoParts = NO; - (id) fetchCoreInfos { id msgs; + int i; if (!coreInfos) { @@ -224,8 +225,21 @@ static BOOL debugSoParts = NO; if (heavyDebug) [self logWithFormat: @"M: %@", msgs]; msgs = [msgs valueForKey: @"fetch"]; + + // We MUST honor untagged IMAP responses here otherwise we could + // return really borken and nasty results. if ([msgs count] > 0) - coreInfos = [msgs objectAtIndex: 0]; + { + for (i = 0; i < [msgs count]; i++) + { + coreInfos = [msgs objectAtIndex: i]; + + if ([[coreInfos objectForKey: @"uid"] intValue] == [[self nameInContainer] intValue]) + break; + + coreInfos = nil; + } + } [coreInfos retain]; }