From 55baeb107fb5e76c866c439aea4855a40d2cb637 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 9 Mar 2022 14:57:32 -0500 Subject: [PATCH] fix(mail): check return value of "setacl" IMAP command --- SoObjects/Mailer/SOGoMailFolder.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 5855b5550..b79a33481 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -1647,13 +1647,24 @@ static NSInteger _compareFetchResultsByUID (id entry1, id entry2, NSArray *uids) forUser: (NSString *) uid { NSString *acls, *folderName; + NSDictionary *result; acls = [self _sogoACLsToIMAPACLs: roles]; folderName = [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]]; - [[imap4 client] setACL: folderName rights: acls uid: [self _sogoACLUIDToIMAPUID: uid]]; + result = [[imap4 client] setACL: folderName rights: acls uid: [self _sogoACLUIDToIMAPUID: uid]]; [mailboxACL release]; mailboxACL = nil; + + if (![[result valueForKey: @"result"] boolValue]) + { + NSException *error; + + error = [NSException exceptionWithName: @"SOGoMailException" + reason: @"Error while setting roles" + userInfo: (id)result]; + [error raise]; + } } - (NSString *) defaultUserID