zbateson/mail-mime-parser
PSR-compliant, testable MIME email parser for PHP 8.1+ as an alternative to imap* and PEAR. Parses RFC 822/2822/5322 messages from strings, resources, or PSR-7 streams; standards-compliant yet forgiving, with a cleaned-up 4.x API.
Received chains) for spoofing.Adopt if:
List-Unsubscribe).From, To, Subject as objects, not strings).Look elsewhere if:
imap_* functions or PEAR libraries).Mailable).Mail facade).For Executives:
"This package replaces fragile, outdated email parsing (e.g., imap_* functions) with a modern, RFC-compliant solution that handles encrypted emails and attachments—critical for [compliance/security use case]. It cuts dev time by 70% while supporting features like S/MIME for [industry-specific need]. The BSD license avoids vendor lock-in, and active maintenance ensures long-term viability."
For Engineering: *"Leverage this to:
imap_* hacks: Get structured headers/attachments with zero regex.zbateson/mmp-crypt-smime for HIPAA/GDPR emails.Mail::raw()) into objects for workflows.Mail facade, but 10x more robust for complex emails."*For Developers: *"Key wins:
preg_match hell: Parse multipart/mixed emails with ->getAttachmentPart(0).->getContentStream() to pipe files directly to S3 or databases.->getHeader('X-Custom-Header')->getValue() without manual parsing.zbateson/mmp-crypt-gpg to handle PGP emails.
Example workflow:$email = MailMimeParser::parse($rawEmail);
$invoice = $email->getAttachmentPart(0)->saveContent('invoices/' . uniqid() . '.pdf');
// Now process $invoice with Laravel’s Filesystem.
```"*
How can I help you explore Laravel packages today?