forked from mirror/django-mailbox
Add handling for situations in which the message was deleted in another thread before processing.
This commit is contained in:
parent
6183f68b39
commit
5bcbac33d6
1 changed files with 7 additions and 1 deletions
|
|
@ -103,7 +103,13 @@ class ImapTransport(EmailTransport):
|
||||||
typ, msg_contents = self.server.uid('fetch', uid, '(RFC822)')
|
typ, msg_contents = self.server.uid('fetch', uid, '(RFC822)')
|
||||||
if not msg_contents:
|
if not msg_contents:
|
||||||
continue
|
continue
|
||||||
message = self.get_email_from_bytes(msg_contents[0][1])
|
try:
|
||||||
|
message = self.get_email_from_bytes(msg_contents[0][1])
|
||||||
|
except TypeError:
|
||||||
|
# This happens if another thread/process deletes the
|
||||||
|
# message between our generating the ID list and our
|
||||||
|
# processing it here.
|
||||||
|
continue
|
||||||
|
|
||||||
if condition and not condition(message):
|
if condition and not condition(message):
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue