symfony/mime
The Symfony MIME component lets you create, parse, and manipulate MIME messages in PHP, handling email bodies, attachments, headers, and encodings so you can build or inspect standards-compliant multipart messages with ease.
symfony/mime remains a standalone component with no Laravel-specific coupling. It continues to slot under Illuminate/Mail and the Symfony mailer bridge without architectural change; the v5.4.54 security patch touches only internal header/address parsing, not the public API surface Laravel depends on.v8.1.0-BETA3 is a pre-release. The operative artifact for planning purposes is now the stable, security-patched line (5.4.54 and its equivalents). Production adoption should anchor on the stable patched branch, with 8.1 tracked as a forward-looking track only.@ inside the domain is no longer treated as the addr-spec separator.@ in the local part is now rejected.File::getMimeType() behaviour is unaffected by this release. No change to the attachment integration path.[SECURITY]. The control-character and header-name fixes close a header-injection vector; the @-handling fixes close ambiguity in address parsing that can be exploited to smuggle or misattribute recipients. This should be treated as a mandatory upgrade, not an optional one, for any code path where addresses or header names derive from user input.@ placement imported from third-party CRMs.@.^8.1 (as previously proposed) would have excluded this fix line and, separately, would have put us on a beta. Pin to a stable patched branch — ^5.4.54, ^6.4.x, ^7.x, or ^8.0.x as appropriate — and verify the equivalent fix set exists on whichever branch is resolved by the target Laravel version.symfony/mime version already contains the v5.4.54 fix set, and identify any application pinned below it.X- headers, subject-adjacent fields, template-driven headers)? The non-printable/non-ASCII rejection will affect those paths.v8.1.0-BETA3 from the plan entirely? Recommendation: yes for production; keep it only as an evaluation track.MimeTestCase assertions planned earlier include negative cases — control characters in header names, @ in domain, unquoted @ in local part — or only happy-path validation?Illuminate/Mail, notification channels, newsletter packages, Request::file()/Storage, and the media library all continue to work. The difference is that the validation boundary is now stricter, which improves the security posture of every one of these paths simultaneously.symfony/mime version resolved across applications, services, and queue workers.symfony/mime to a stable branch containing the v5.4.54 fix set.Address::create() in a helper that returns a structured result rather than a bare boolean, so callers can distinguish "malformed" from "newly rejected by hardened parser."use Symfony\Component\Mime\Address;
function validateEmail(string $email): array {
try {
Address::create($email);
return ['valid' => true, 'reason' => null];
} catch (\InvalidArgumentException $e) {
return ['valid' => false, 'reason' => $e->getMessage()];
}
}
Address::create() explicitly.UPGRADE.md, but add a specific check for security-tagged releases — this one did not carry a deprecation notice, and the behavioural change is only visible in the changelog entries.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Legacy stored addresses now rejected | Transactional sends fail; user-visible errors | Census before rollout; quarantine table; remediation pass |
| Header name with non-ASCII characters rejected | Custom/branded headers break | Audit tenant- or template-controlled header names; normalise before construction |
| Control-character rejection on internally built headers | Unexpected send failures | Sanitise at input boundary; test negative cases |
@-in-domain or unquoted-@-in-local rejection |
Third-party/CRM-sourced addresses fail | Normalise on ingest; log and quarantine, do not silently strip |
| Version drift across services | Inconsistent accept/reject behaviour per service | Enforce a single pinned patch level in CI |
| Pre-release component in production path | Unplanned behaviour changes | Separate lockfile constraints for evaluation vs. production |
MimeTestCase set: control characters in header names, non-ASCII header names, @ inside domain, unquoted @ in local part. These should be regression tests, not one-offs.How can I help you explore Laravel packages today?