question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML body regression in mail-parser 3.12.0

See original GitHub issue

Describe the bug HTML bodies (raw or base64-encoded) without a email boundary are treated as a binary attachment instead of HTML body content. This bug was not present in 3.11.0.

To Reproduce Steps to reproduce the behavior:

  1. import mailparser
  2. mail = mailparser.parse_from_file(f)
  3. See error

Expected behavior The HTML body should be parsed as the message body

Raw mail Samples Warning - includes phishing emails: samples.zip Password: infected.

Environment:

  • OS: Linux
  • Docker: No
  • mail-parser version 3.12.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
seanthegeekcommented, Jul 3, 2020

@fedelemantuano Sorry I just now noticed your replies. I was wrong about the cause of the bug, so my attempts to simplify/redact the emails failed to reproduce the issue. You are exactly right. The issue was caused by PR #64.

Often messages will add a Content-ID header to an HTML body part of an email. mail-parser parser still parsed the body correctly, but PR #64 caused those email bodies to also be incorrectly be treated as an attachment.

--_000_450A05536D04B1AE5PQSSMTPGBLB03pilgrimaspcom_
Content-Type: text/html; charset="utf-8"
Content-ID: <705D55D15DB6CD4681934E1C11784FA1@namprd04.prod.outlook.com>
Content-Transfer-Encoding: base64

It looks like you already fixed this issue in the develop branch. Can you put out a release so I can update my downstream projects?

0reactions
fedelemantuanocommented, Nov 29, 2020

@Passimist, I tested the email in this thread and I did’t have any issue. Can you send me an email with this problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

mailparser.io - Mailparser Support Area
Sending emails to mailparser.io, what's the recommended way? Can I parse data from PDF attachments? How can I extract table rows from an...
Read more >
stalwartlabs/mail-parser: Fast and robust e-mail parsing library ...
4 and provides a more human-friendly representation of the message contents consisting of just text body parts, html body parts and attachments.
Read more >
mail-parser - PyPI
mail-parser is not only a wrapper for email Python Standard Library. ... body; body html; body plain; headers; attachments; sender IP address; to...
Read more >
VMware Tanzu Application Service for VMs v3.0 Release Notes
This topic contains release notes for VMware Tanzu Application Service for VMs (TAS for VMs) v3.0. TAS for VMs is certified by the...
Read more >
Mailparser - Nodemailer
Advanced email parser for Node.js. Everything is handled as a stream which should make it able to parse even very large messages (100MB+)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found