symfony icon indicating copy to clipboard operation
symfony copied to clipboard

[Mime] Fixed `Mime\Message::ensureValidity()` when a required header is set, but has an empty body

Open rhertogh opened this issue 9 months ago • 3 comments

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.

rhertogh avatar May 22 '24 19:05 rhertogh