1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00
This commit is contained in:
Matti Lehtinen 2025-08-01 03:07:15 +00:00 committed by GitHub
commit 52cb4a0753
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,8 +83,14 @@ class ImapTransport(EmailTransport):
for each_msg in data:
each_msg = each_msg.decode()
try:
uid = each_msg.split(' ')[2]
size = each_msg.split(' ')[4].rstrip(')')
stripped_msg = each_msg.replace('(', '').replace(')', '')
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):
safe_message_ids.append(uid)
except ValueError as e: