Handle [ALREADYEXISTS] and Mailbox already exists!
Make compatible with IMAP servers that give the reason code "[ALREADYEXISTS]" and IMAP servers that give natural language reason "Mailbox already exists!" by searching for the two words "already" and "exists" in the exception reason string. Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
564930725e
commit
84efb45270
|
@ -561,7 +561,8 @@ class IMAPRepository(BaseRepository):
|
||||||
try:
|
try:
|
||||||
self.makefolder_single(folder_path)
|
self.makefolder_single(folder_path)
|
||||||
except OfflineImapError as e:
|
except OfflineImapError as e:
|
||||||
if '[ALREADYEXISTS]' not in e.reason:
|
reasonLower = e.reason.lower() # Handle reasons '[ALREADYEXISTS]' and 'Mailbox already exists!' @chris001
|
||||||
|
if not ('already' in reasonLower and 'exists' in reasonLower):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def makefolder_single(self, foldername):
|
def makefolder_single(self, foldername):
|
||||||
|
|
Loading…
Reference in New Issue