import of E-Mails with empty attachment fails
Unfortunately, some programs generate really strange E-Mails, I know of a case of automated emails containing an attached PDF and an empty body attachment of type text/plain.
BaseEmailModel.process_message should skip the attachments with len(0), those fail to upload with an error in signature verification.
Workaround in mayan/apps/sources/models.py
line 603:
else:
# Treat inlines as attachments, both are extracted and saved as
# documents
if message.is_attachment() or message.is_inline():
+ if len(message.body) == 0:
+ return
label = message.detected_file_name or 'attachment-{}'.format(counter)