zbateson/mail-mime-parser
PSR-compliant, testable MIME email parser for PHP (RFC 822/2822/5322). A standards-based but forgiving alternative to imap* and Pear for reading and inspecting messages, headers, parts, and attachments. Requires PHP 8.1+.
imap_* functions or PEAR libraries, reducing technical debt and improving maintainability.support@ auto-creates a ticket).Adopt When:
imap_* functions or PEAR libraries (e.g., Mail_mimeDecode) for better performance or maintainability.Look Elsewhere If:
mb_parse_str() or imap_fetchbody().email (Python) or nodemailer (JS).phpmailer or symfony/mailer.*"This package lets us process emails like a first-party feature—without building a custom parser from scratch. It’s used by teams at SecuMailer to handle encrypted emails securely, and it’s PSR-compliant, meaning our devs can integrate it cleanly with Laravel or any modern PHP app. For example:
imap_* functions with a tested, maintained library (last release: March 2026).It’s a low-risk, high-reward decision—we avoid technical debt while enabling features like email-based workflows or analytics. The cost? Minimal: a Composer dependency and a few hours of dev time to integrate."*
*"Why this over alternatives?
Integration Plan:
EmailParserService) with methods like:
extractAttachments($email) → returns array of files.getEmailMetadata($email) → returns structured headers (e.g., ['from', 'subject', 'sent_at']).Trade-offs:
imap_*, this parses raw email strings/streams—we’ll need to fetch emails via API/IMAP first.Alternatives Considered:
Recommendation: Proceed with a 2-week spike to validate performance and edge-case handling. If successful, prioritize integration for [high-impact use case, e.g., support tickets]."*
How can I help you explore Laravel packages today?