mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
Merge b786f3d4a9 into eec7fb76f9
This commit is contained in:
commit
52cb4a0753
1 changed files with 8 additions and 2 deletions
|
|
@ -83,8 +83,14 @@ class ImapTransport(EmailTransport):
|
||||||
for each_msg in data:
|
for each_msg in data:
|
||||||
each_msg = each_msg.decode()
|
each_msg = each_msg.decode()
|
||||||
try:
|
try:
|
||||||
uid = each_msg.split(' ')[2]
|
stripped_msg = each_msg.replace('(', '').replace(')', '')
|
||||||
size = each_msg.split(' ')[4].rstrip(')')
|
split_msg = stripped_msg.split(' ')
|
||||||
|
for i, s in enumerate(split_msg):
|
||||||
|
if s == 'UID':
|
||||||
|
uid = split_msg[i + 1]
|
||||||
|
elif s == 'RFC822.SIZE':
|
||||||
|
size = split_msg[i + 1]
|
||||||
|
|
||||||
if int(size) <= int(self.max_message_size):
|
if int(size) <= int(self.max_message_size):
|
||||||
safe_message_ids.append(uid)
|
safe_message_ids.append(uid)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue