SMTP Error Certificate mismatch

Created on 22 November 2022, about 2 years ago
Updated 21 June 2023, over 1 year ago

Problem/Motivation

We recently started using Office 365 email service and have just noticed that some email servers are rejecting drupal system emails, like password reset emails, apparently because the SPF and DKIM records are no longer valid on the server the drupal installation is on. Services like GMAIL just won't accept email from the website anymore. They don't go to SPAM, they just are not received at all.

So we arrived at this module as a solution, except we just get an error when trying the test email.

Steps to reproduce

Enable the module, input smtp setting recommened by office 354:

Server name: smtp.office365.com
Port: 587
Encryption method: STARTTLS

Add username and password of Office 365 admin account, send test email.

Error in log:
Error sending email (from xxx@xxxx.com to xxx@xxxx.com with reply-to not set).

Error on status page:
SMTP module is enabled, turned on, but SmtpConnect() threw exception SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): Peer certificate CN=`*.a2hosting.com' did not match expected CN=`smtp.office365.com'

πŸ› Bug report
Status

Closed: cannot reproduce

Version

1.2

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada OMD

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024