diff --git a/src/documents/mail.py b/src/documents/mail.py index d974d57c5..9a1c792aa 100644 --- a/src/documents/mail.py +++ b/src/documents/mail.py @@ -75,9 +75,11 @@ class Message(Loggable): continue dispositions = content_disposition.strip().split(";") - if len(dispositions) < 2 or \ - (not dispositions[0].lower() == "attachment" and - "filename" not in dispositions[1].lower()): + if len(dispositions) < 2: + continue + + if not dispositions[0].lower() == "attachment" and \ + "filename" not in dispositions[1].lower(): continue file_data = part.get_payload()