mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
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)')
|
||||
if not msg_contents:
|
||||
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):
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue