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];