helpful comments
This commit is contained in:
parent
2b9d6f9fdc
commit
5fc0e1ae42
@ -234,6 +234,7 @@ class IMAPFolder(BaseFolder):
|
|||||||
ui.debug('imap', 'savemessage: first attempt to get new UID')
|
ui.debug('imap', 'savemessage: first attempt to get new UID')
|
||||||
uid = self.savemessage_searchforheader(imapobj, headername,
|
uid = self.savemessage_searchforheader(imapobj, headername,
|
||||||
headervalue)
|
headervalue)
|
||||||
|
# See docs for savemessage in Base.py for explanation of this and other return values
|
||||||
if uid <= 0:
|
if uid <= 0:
|
||||||
ui.debug('imap', 'savemessage: first attempt to get new UID failed. Going to run a NOOP and try again.')
|
ui.debug('imap', 'savemessage: first attempt to get new UID failed. Going to run a NOOP and try again.')
|
||||||
assert(imapobj.noop()[0] == 'OK')
|
assert(imapobj.noop()[0] == 'OK')
|
||||||
@ -242,8 +243,9 @@ class IMAPFolder(BaseFolder):
|
|||||||
finally:
|
finally:
|
||||||
self.imapserver.releaseconnection(imapobj)
|
self.imapserver.releaseconnection(imapobj)
|
||||||
|
|
||||||
if uid:
|
if uid: # avoid UID FETCH 0 crash happening later on
|
||||||
self.messagelist[uid] = {'uid': uid, 'flags': flags}
|
self.messagelist[uid] = {'uid': uid, 'flags': flags}
|
||||||
|
|
||||||
ui.debug('imap', 'savemessage: returning %d' % uid)
|
ui.debug('imap', 'savemessage: returning %d' % uid)
|
||||||
return uid
|
return uid
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user