def _get_or_create_mailbox(self, mailbox_name):
"""
Avoid creating variations of the case.
If there's already a 'Sent' folder, do not create 'SENT', just
return that.
"""
name = yield self._get_case_insensitive_mbox(mailbox_name)
if name is None:
name = mailbox_name
yield self.account.add_mailbox(name)
mailbox = yield self.account.get_collection_by_mailbox(
name)
# Pixelated expects the mailbox wrapper;
# it should limit itself to the Mail API instead.
# This is also a smell that the collection-mailbox-wrapper
# distinction is not clearly cut.
defer.returnValue(mailbox.mbox_wrapper)
评论列表
文章目录