forked from mirror/django-mailbox
Fixed issue with exception when IMAP transport returned no messages.
--HG-- branch : ashvetsov/fixes-to-push extra : source : b9b283ff46d734933c4a715630e114d5e250a34b
This commit is contained in:
parent
e6f9e6b94b
commit
8ab0f708c5
1 changed files with 4 additions and 0 deletions
|
|
@ -21,6 +21,10 @@ class ImapTransport(object):
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
typ, inbox = self.server.search(None, 'ALL')
|
typ, inbox = self.server.search(None, 'ALL')
|
||||||
|
|
||||||
|
if not inbox[0]:
|
||||||
|
return
|
||||||
|
|
||||||
for key in inbox[0].split():
|
for key in inbox[0].split():
|
||||||
try:
|
try:
|
||||||
typ, msg_contents = self.server.fetch(key, '(RFC822)')
|
typ, msg_contents = self.server.fetch(key, '(RFC822)')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue