diff --git a/CHANGELOG.md b/CHANGELOG.md index ede78a7..98d89cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,13 @@ All notable changes to `initphp/mailer` are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [3.1.0] - 2026-11-25 ### Security +- **Affected versions: 2.0.0 and 3.0.0.** The code these fixes change is the same in + both (3.0.0 only reformatted it). 1.0 and 1.1 are a different, single-file code + base and were not assessed. - A CR, LF or NUL in an address or return path is now rejected with an `InvalidAddressException` **whether or not** the `validate` option is on (`Address`, `setFrom()`, `setReplyTo()`, `setTo()`, `setCC()`, `setBCC()`). A @@ -90,6 +93,25 @@ Behaviours that differ from 3.0.0 and are not security fixes in themselves: hand cannot inject headers. A MIME boundary from `setBoundaryFactory()` that is empty or contains a quote, CR, LF or NUL throws a `MailerException`. +### Documentation + +- Sending Mail, Configuration, Error Handling and the FAQ state that `validate => + false` switches off the format check only (a CR, LF, NUL, `<` or `>` in an + address is rejected either way), and that a request-supplied *string* can still + name several recipients: pass a single untrusted address as an array item and + keep `validate` on. +- Encoding and Headers, Sending Mail and Transports describe the custom-header + rules: the accepted header names, that headers the library writes win over a + custom one of the same name, that `To` is not special-cased, that a `Bcc` header + added by hand with `setHeader()` is visible to the recipients on SMTP (on + sendmail it is removed from the delivered copy, and the recipients set with + `setBCC()` never appear in the headers), and how a subject or display name with a line break + or NUL is made safe. +- SMTP Transport documents that a failed send closes the connection and forgets + the "authenticated" state, the xtext-encoded `ORCPT` address, the `220` + greeting check and the new error cases. Attachments and the API reference list + the CR, LF and NUL checks and the `Content-ID` and quoted-name rules. + ## [3.0.0] - 2026-11-22 ### Changed (breaking) @@ -172,5 +194,6 @@ breaking changes and how to migrate. case-insensitive. - The archive returned after a send no longer contains SMTP credentials. +[3.1.0]: https://github.com/InitPHP/Mailer/compare/3.0.0...3.1.0 [3.0.0]: https://github.com/InitPHP/Mailer/compare/2.0.0...3.0.0 [2.0.0]: https://github.com/InitPHP/Mailer/compare/1.1...2.0.0 diff --git a/src/Facade/Mailer.php b/src/Facade/Mailer.php index 0c12e49..7fc752b 100644 --- a/src/Facade/Mailer.php +++ b/src/Facade/Mailer.php @@ -8,7 +8,7 @@ * @author Muhammet ŞAFAK * @copyright Copyright © 2022 InitPHP * @license https://github.com/InitPHP/Mailer/blob/main/LICENSE MIT - * @version 2.0 + * @version 3.1.0 * @link https://muhammetsafak.com */ diff --git a/src/Mailer.php b/src/Mailer.php index b59deb0..9b2e3d9 100644 --- a/src/Mailer.php +++ b/src/Mailer.php @@ -8,7 +8,7 @@ * @author Muhammet ŞAFAK * @copyright Copyright © 2022 InitPHP * @license https://github.com/InitPHP/Mailer/blob/main/LICENSE MIT - * @version 2.0 + * @version 3.1.0 * @link https://muhammetsafak.com */