Articles in this section

PHPMailer script or any CMS that uses it in Plesk can not sent messages

Plesk for Linux kb: technical ext: migrator ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • It is not possible to configure SMTP server in Joomla:

    PLESK_ERROR: SMTP Error: Could not connect to SMTP host.

  • The following error can be found in domain /var/www/vhosts/system/example.com/logs/error_log:

    CONFIG_TEXT: mod_fcgid: stderr: Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`example.com' did not match expected CN=`hostname.com'

Cause

Starting from PHP 5.6 stream wrapper now verify peer certificates and hostname by default when using SSL/TLS. It means that:

  • Connection will fail in case if self-signed certificate is used;
  • In case when the certificate for mail is not the same as the domain name, connection will fail too.

Resolution

Secure mail server using Let's Encrypt certificate. To install it, use the following article: How to secure mail server with Let's Encrypt certificate.

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.