Fix attachment parsing and hasAttachment false positives

FixEmailService
Shipped
April 25, 2026 at 12:09 AM UTC
Author
Kamo
Commit
f1b46eb

Three fixes to EmailImapService: 1. toEnvelope: narrow multipart check to multipart/mixed only — plain HTML+text emails (multipart/alternative) no longer show a false positive paperclip icon in the message list 2. getMessage: reset hasAttachment after full parse so it accurately reflects whether real attachments were found, overriding the envelope heuristic 3. parseMultipart: use isMimeType("multipart/*") to detect nested multiparts instead of calling getContent() on every part (avoids pulling binary attachment content just for a type check, and prevents exceptions from binary parts from breaking the whole parse); also guard text/plain, text/html, and calendar parts against attachment-disposition so named .html/.txt/.ics files are treated as attachments rather than body content

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing