symfony
symfony copied to clipboard
[Mime] Fixed `Mime\Message::ensureValidity()` when a required header is set, but has an empty body
Q | A |
---|---|
Branch? | 6.4 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Issues | - |
License | MIT |
According to RFC 5322 - Destination Address Fields "... Each destination field may have one or more addresses ...".
Currently Message::ensureValidity()
only checks the presence of the required fields in headers which considers the message valid if the field is present but has no body. This PR adds empty checks for the required fields so that an exception will be raised when those fields are all empty.