From f072f75dc4ae0bcb2dbf57f1d374a1e53913eed4 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Tue, 9 Sep 2014 15:07:41 -0300 Subject: addMailbox shouldn't accept empty names since it makes it impossible to retrieve it later --- mail/changes/prevent-mailbox-with-blank-name | 3 +++ mail/src/leap/mail/imap/account.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 mail/changes/prevent-mailbox-with-blank-name diff --git a/mail/changes/prevent-mailbox-with-blank-name b/mail/changes/prevent-mailbox-with-blank-name new file mode 100644 index 00000000..c676fb64 --- /dev/null +++ b/mail/changes/prevent-mailbox-with-blank-name @@ -0,0 +1,3 @@ + o account#addMailbox can't allow empty mailbox names since it makes it +impossible to create it later (mailbox#__init__ will throw an error), which makes +it impossible to getMailbox or even delete it diff --git a/mail/src/leap/mail/imap/account.py b/mail/src/leap/mail/imap/account.py index 74ec11e2..70ed13bd 100644 --- a/mail/src/leap/mail/imap/account.py +++ b/mail/src/leap/mail/imap/account.py @@ -187,6 +187,8 @@ class SoledadBackedAccount(WithMsgFields, IndexedDB, MBoxParser): """ name = self._parse_mailbox_name(name) + leap_assert(name, "Need a mailbox name to create a mailbox") + if name in self.mailboxes: raise imap4.MailboxCollision(repr(name)) -- cgit v1.2.3