mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Prevent ImapTransport from raising exception when no messages are available. Fixes #24. Release 3.4.1.
This commit is contained in:
parent
3ffbcea3bf
commit
7474cf0118
2 changed files with 8 additions and 2 deletions
|
|
@ -36,7 +36,13 @@ class ImapTransport(EmailTransport):
|
||||||
def _get_all_message_ids(self):
|
def _get_all_message_ids(self):
|
||||||
# Fetch all the message uids
|
# Fetch all the message uids
|
||||||
response, message_ids = self.server.uid('search', None, 'ALL')
|
response, message_ids = self.server.uid('search', None, 'ALL')
|
||||||
return message_ids[0].split(' ')
|
message_id_string = message_ids[0].strip()
|
||||||
|
# Usually `message_id_string` will be a list of space-separated
|
||||||
|
# ids; we must make sure that it isn't an empty string before
|
||||||
|
# splitting into individual UIDs.
|
||||||
|
if message_id_string:
|
||||||
|
return message_id_string.split(' ')
|
||||||
|
return []
|
||||||
|
|
||||||
def _get_small_message_ids(self, message_ids):
|
def _get_small_message_ids(self, message_ids):
|
||||||
# Using existing message uids, get the sizes and
|
# Using existing message uids, get the sizes and
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -11,7 +11,7 @@ gmail_oauth2_require = [
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='django-mailbox',
|
name='django-mailbox',
|
||||||
version='3.4',
|
version='3.4.1',
|
||||||
url='http://github.com/coddingtonbear/django-mailbox/',
|
url='http://github.com/coddingtonbear/django-mailbox/',
|
||||||
description=(
|
description=(
|
||||||
'Import mail from POP3, IMAP, local mailboxes or directly from '
|
'Import mail from POP3, IMAP, local mailboxes or directly from '
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue