Make WordPress Core


Ignore:
Timestamp:
11/26/2023 07:25:50 PM (10 months ago)
Author:
SergeyBiryukov
Message:

External Libraries: Upgrade PHPMailer to version 6.9.1.

This is a maintenance and feature release, adding support for the official release of PHP 8.3, methods for removing and replacing custom headers, XCLIENT support, and links to a new way of implementing XOAUTH2 authentication.

The only change likely to have any impact on existing code is that PHPMailer previously attempted to use opportunistic STARTTLS encryption when connecting to localhost, which was unlikely to work. The workaround required setting SMTPAutoTLS = false, but that's no longer required. You may still need to use this setting when connecting to literal IPs.

References:

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937], [55557], [56484].

Props jrf, Synchro.
Fixes #59966.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/PHPMailer/SMTP.php

    r56484 r57137  
    3636     * @var string
    3737     */
    38     const VERSION = '6.8.1';
     38    const VERSION = '6.9.1';
    3939
    4040    /**
     
    197197        'ZoneMTA' => '/[\d]{3} Message queued as (.*)/',
    198198        'Mailjet' => '/[\d]{3} OK queued as (.*)/',
     199    ];
     200
     201    /**
     202     * Allowed SMTP XCLIENT attributes.
     203     * Must be allowed by the SMTP server. EHLO response is not checked.
     204     *
     205     * @see https://www.postfix.org/XCLIENT_README.html
     206     *
     207     * @var array
     208     */
     209    public static $xclient_allowed_attributes = [
     210        'NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT'
    199211    ];
    200212
     
    973985
    974986    /**
     987     * Send SMTP XCLIENT command to server and check its return code.
     988     *
     989     * @return bool True on success
     990     */
     991    public function xclient(array $vars)
     992    {
     993        $xclient_options = "";
     994        foreach ($vars as $key => $value) {
     995            if (in_array($key, SMTP::$xclient_allowed_attributes)) {
     996                $xclient_options .= " {$key}={$value}";
     997            }
     998        }
     999        if (!$xclient_options) {
     1000            return true;
     1001        }
     1002        return $this->sendCommand('XCLIENT', 'XCLIENT' . $xclient_options, 250);
     1003    }
     1004
     1005    /**
    9751006     * Send an SMTP RSET command.
    9761007     * Abort any transaction that is currently in progress.
Note: See TracChangeset for help on using the changeset viewer.