From fa9a33d818470a5796f0ff8797f98b510ed8de18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:57:30 +0200 Subject: Merging upstream version 6.5+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/PHPMailer/SMTP.php | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'wp-includes/PHPMailer/SMTP.php') diff --git a/wp-includes/PHPMailer/SMTP.php b/wp-includes/PHPMailer/SMTP.php index 2b63840..1b5b007 100644 --- a/wp-includes/PHPMailer/SMTP.php +++ b/wp-includes/PHPMailer/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.8.1'; + const VERSION = '6.9.1'; /** * SMTP line break constant. @@ -198,6 +198,18 @@ class SMTP 'Mailjet' => '/[\d]{3} OK queued as (.*)/', ]; + /** + * Allowed SMTP XCLIENT attributes. + * Must be allowed by the SMTP server. EHLO response is not checked. + * + * @see https://www.postfix.org/XCLIENT_README.html + * + * @var array + */ + public static $xclient_allowed_attributes = [ + 'NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT' + ]; + /** * The last transaction ID issued in response to a DATA command, * if one was detected. @@ -971,6 +983,25 @@ class SMTP ); } + /** + * Send SMTP XCLIENT command to server and check its return code. + * + * @return bool True on success + */ + public function xclient(array $vars) + { + $xclient_options = ""; + foreach ($vars as $key => $value) { + if (in_array($key, SMTP::$xclient_allowed_attributes)) { + $xclient_options .= " {$key}={$value}"; + } + } + if (!$xclient_options) { + return true; + } + return $this->sendCommand('XCLIENT', 'XCLIENT' . $xclient_options, 250); + } + /** * Send an SMTP RSET command. * Abort any transaction that is currently in progress. -- cgit v1.2.3