From f2b455fffcb0f51e4192c0598fc77ecf3353c4c5 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 31 May 2012 14:22:34 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 3c4baa92c5634d4da061da739a9b544d04c44586 Monotone-Revision: b5d91e74f183ad54e2362119b25b4556f810e3b6 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-31T14:22:34 --- ChangeLog | 3 +++ SoObjects/Mailer/SOGoMailFolder.m | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index ba7af70b4..c90eff83e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ of attributes to SOPE. * Added patch from bug #1608. This add many more password schemes for SQL authentication. + * SoObject/Mailer/SOGoMailFolder.m (_readMailboxACL): we + now create the mailbox if we are trying to read ACL of + a deleted mailbox. 2012-05-29 Francis Lachapelle diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index f13415e15..d453ba578 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -1216,6 +1216,17 @@ static NSString *defaultUserID = @"anyone"; [mailboxACL release]; mailboxACL = [[self imap4Connection] aclForMailboxAtURL: [self imap4URL]]; + + // If the mailbox doesn't exist, we create it. That could happen if + // a special mailbox (Drafts, Sent, Trash) is deleted from SOGo's web GUI + // or if any other mailbox is deleted behind SOGo's back. + if ([mailboxACL isKindOf: [NSException class]]) + { + [[self imap4Connection] createMailbox: [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]] + atURL: [[self mailAccountFolder] imap4URL]]; + mailboxACL = [[self imap4Connection] aclForMailboxAtURL: [self imap4URL]]; + } + [mailboxACL retain]; [self _convertIMAPGroupnames];