Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mail-parser treats multiparts as attachments #128

Open
ItayBenAvi opened this issue Feb 5, 2025 · 0 comments
Open

mail-parser treats multiparts as attachments #128

ItayBenAvi opened this issue Feb 5, 2025 · 0 comments

Comments

@ItayBenAvi
Copy link

Describe the bug
mail-parser fails on mails that have multipart attachments
mail-parsers fails in core.py:473
Traceback:
AttributeError: 'NoneType' object has no attribute 'decode'

This happens because of recent change in line core.py:353:
"or ported_string(p.get_content_disposition()).lower() == "attachment""

To Reproduce
Create a part which is multipart with content-disposition of attachment

Expected behavior
Payload should be treated as multipart and as attachment

It can be resolved by changing core.py:353 from 'or' to 'and' statement

Raw mail
Un-fortunately, I can't add the mail for security reason.
The mail have a part with the following payload:

  • content-disposition: attachment
  • p.is_multipart == True

Environment:

  • OS: Linux
  • Docker: yes
  • mail-parser version 4.1.2 (doesn't re-produce on 3.5.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant