From 182f7b9158692ef602ed9cbd944b388e79961729 Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Tue, 15 Oct 2024 22:20:47 +0200 Subject: [PATCH] Use rfc-editor.org for all docs links --- changelog.md | 5 ++++- src/PHPMailer.php | 18 +++++++++--------- src/SMTP.php | 10 +++++----- test/PHPMailer/DKIMTest.php | 14 +++++++------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/changelog.md b/changelog.md index 592538a2..ef48943e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # PHPMailer Change Log +## WIP +* Use rfc-editor.org for all RFC docs links + ## Version 6.9.2 (October 9th, 2024) * Escape dots in SMTP transaction ID patterns * Add link to [aboutmy.email](https://aboutmy.email) testing service in docs @@ -227,7 +230,7 @@ Many thanks to @jrfnl for all her work. ## Version 6.1.0 (September 27th 2019) * Multiple bug fixes for folding of long header lines, thanks to @caugner -* Add support for [RFC2387 child element content-type hint](https://tools.ietf.org/html/rfc2387#section-3.1) in `multipart/related` structures. +* Add support for [RFC2387 child element content-type hint](https://www.rfc-editor.org/rfc/rfc2387#section-3.1) in `multipart/related` structures. * Support for Ical event methods other than `REQUEST`, thanks to @puhr-mde * Change header folding and param separation to use spaces instead of tabs * Use ; to separate multiple MIME header params diff --git a/src/PHPMailer.php b/src/PHPMailer.php index 12da1035..69709a21 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -253,7 +253,7 @@ class PHPMailer * You can set your own, but it must be in the format "", * as defined in RFC5322 section 3.6.4 or it will be ignored. * - * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 + * @see https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4 * * @var string */ @@ -387,7 +387,7 @@ class PHPMailer * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual * delivery's outcome (success or failure) is not yet decided. * - * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY + * @see https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1 for more information about NOTIFY */ public $dsn = ''; @@ -1871,7 +1871,7 @@ class PHPMailer */ protected static function isPermittedPath($path) { - //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1 + //Matches scheme definition from https://www.rfc-editor.org/rfc/rfc3986#section-3.1 return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path); } @@ -2705,7 +2705,7 @@ class PHPMailer } //Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 - //https://tools.ietf.org/html/rfc5322#section-3.6.4 + //https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4 if ( '' !== $this->MessageID && preg_match( @@ -4910,7 +4910,7 @@ class PHPMailer * Uses the 'relaxed' algorithm from RFC6376 section 3.4.2. * Canonicalized headers should *always* use CRLF, regardless of mailer setting. * - * @see https://tools.ietf.org/html/rfc6376#section-3.4.2 + * @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.2 * * @param string $signHeader Header * @@ -4922,7 +4922,7 @@ class PHPMailer $signHeader = static::normalizeBreaks($signHeader, self::CRLF); //Unfold header lines //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` - //@see https://tools.ietf.org/html/rfc5322#section-2.2 + //@see https://www.rfc-editor.org/rfc/rfc5322#section-2.2 //That means this may break if you do something daft like put vertical tabs in your headers. $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); //Break headers out into an array @@ -4954,7 +4954,7 @@ class PHPMailer * Uses the 'simple' algorithm from RFC6376 section 3.4.3. * Canonicalized bodies should *always* use CRLF, regardless of mailer setting. * - * @see https://tools.ietf.org/html/rfc6376#section-3.4.3 + * @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.3 * * @param string $body Message Body * @@ -4990,7 +4990,7 @@ class PHPMailer $DKIMquery = 'dns/txt'; //Query method $DKIMtime = time(); //Always sign these headers without being asked - //Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1 + //Recommended list from https://www.rfc-editor.org/rfc/rfc6376#section-5.4.1 $autoSignHeaders = [ 'from', 'to', @@ -5096,7 +5096,7 @@ class PHPMailer } //The DKIM-Signature header is included in the signature *except for* the value of the `b` tag //which is appended after calculating the signature - //https://tools.ietf.org/html/rfc6376#section-3.5 + //https://www.rfc-editor.org/rfc/rfc6376#section-3.5 $dkimSignatureHeader = 'DKIM-Signature: v=1;' . ' d=' . $this->DKIM_domain . ';' . ' s=' . $this->DKIM_selector . ';' . static::$LE . diff --git a/src/SMTP.php b/src/SMTP.php index 5b238b52..5c225dc9 100644 --- a/src/SMTP.php +++ b/src/SMTP.php @@ -62,7 +62,7 @@ class SMTP * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, * *excluding* a trailing CRLF break. * - * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 + * @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.6 * * @var int */ @@ -72,7 +72,7 @@ class SMTP * The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5, * *including* a trailing CRLF line break. * - * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5 + * @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.5 * * @var int */ @@ -373,7 +373,7 @@ class SMTP } //Anything other than a 220 response means something went wrong //RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error - //https://tools.ietf.org/html/rfc5321#section-3.1 + //https://www.rfc-editor.org/rfc/rfc5321#section-3.1 if ($responseCode === 554) { $this->quit(); } @@ -582,7 +582,7 @@ class SMTP } //Send encoded username and password if ( - //Format from https://tools.ietf.org/html/rfc4616#section-2 + //Format from https://www.rfc-editor.org/rfc/rfc4616#section-2 //We skip the first field (it's forgery), so the string starts with a null byte !$this->sendCommand( 'User & Password', @@ -795,7 +795,7 @@ class SMTP //Send the lines to the server foreach ($lines_out as $line_out) { //Dot-stuffing as per RFC5321 section 4.5.2 - //https://tools.ietf.org/html/rfc5321#section-4.5.2 + //https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2 if (!empty($line_out) && $line_out[0] === '.') { $line_out = '.' . $line_out; } diff --git a/test/PHPMailer/DKIMTest.php b/test/PHPMailer/DKIMTest.php index 63034ab0..34991846 100644 --- a/test/PHPMailer/DKIMTest.php +++ b/test/PHPMailer/DKIMTest.php @@ -48,13 +48,13 @@ final class DKIMTest extends SendTestCase /** * DKIM body canonicalization tests. * - * @link https://tools.ietf.org/html/rfc6376#section-3.4.4 + * @link https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.4 * * @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_BodyC */ public function testDKIMBodyCanonicalization() { - // Example from https://tools.ietf.org/html/rfc6376#section-3.4.5. + // Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.5. $prebody = " C \r\nD \t E\r\n\r\n\r\n"; $postbody = " C \r\nD \t E\r\n"; @@ -83,13 +83,13 @@ final class DKIMTest extends SendTestCase /** * DKIM header canonicalization tests. * - * @link https://tools.ietf.org/html/rfc6376#section-3.4.2 + * @link https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.2 * * @covers \PHPMailer\PHPMailer\PHPMailer::DKIM_HeaderC */ public function testDKIMHeaderCanonicalization() { - // Example from https://tools.ietf.org/html/rfc6376#section-3.4.5. + // Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.4.5. $preheaders = "A: X\r\nB : Y\t\r\n\tZ \r\n"; $postheaders = "a:X\r\nb:Y Z\r\n"; self::assertSame( @@ -116,7 +116,7 @@ final class DKIMTest extends SendTestCase /** * DKIM copied header fields tests. * - * @link https://tools.ietf.org/html/rfc6376#section-3.5 + * @link https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5 * * @requires extension openssl * @@ -135,7 +135,7 @@ final class DKIMTest extends SendTestCase openssl_pkey_export_to_file($pk, self::PRIVATE_KEY_FILE); $this->Mail->DKIM_private = self::PRIVATE_KEY_FILE; - // Example from https://tools.ietf.org/html/rfc6376#section-3.5. + // Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5. $from = 'from@example.com'; $to = 'to@example.com'; $date = 'date'; @@ -179,7 +179,7 @@ final class DKIMTest extends SendTestCase openssl_pkey_export_to_file($pk, self::PRIVATE_KEY_FILE); $this->Mail->DKIM_private = self::PRIVATE_KEY_FILE; - // Example from https://tools.ietf.org/html/rfc6376#section-3.5. + // Example from https://www.rfc-editor.org/rfc/rfc6376.html#section-3.5. $from = 'from@example.com'; $to = 'to@example.com'; $date = 'date';