• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Centos 7 Plesk 12.5 SMTP Email issue

Twincarb

New Pleskian
Hi,

I have a clean built Centos 7.2.1511 with Plesk 12.5 installed on it. This is the first Centos 7 + Plesk I have used, I am more used to Centos 6.7 with Plesk.

I have got several domains which contain Joomla and Wordpress sites, when either site is set up to use SMTP for email sending with SSL or TLS SMTP Authentication set to yes I get the following error.
Code:
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
When the same is configured not to use authentication the emails are able to pass without any problems.

Ok So I take a step back and open an SSH window
Code:
openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587
This appears to work as expected I get the certificate returned and all the good stuff finishing with
Code:
Verify return code: 0 (ok)

Do the same with
Code:
openssl s_client -starttls smtp -crlf -connect smtp.office365.com:587
This time it returns
Code:
getaddrinfo: Name or service not known - connect:errno=0

If I then do a quick ping to get a valid IP for smtp.office365.com and use that in place of smtp.office365.com again it works as expected and returns the certificate all the good stuff finishing with
Code:
Verify return code: 0 (ok)
I have had a look in maillog and nothing is screaming out to me anything obvious. Any hints or suggestions would be warmly welcomed. I have had a look over similar posts but not able to find anything that helps.
Regards
 
Code:
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
That error say the script cannot connect you YOUR SMTP server... not a remote one... check the port you use for connect... passwds.. etc...
 
The port and the connection details, all appear to be set up correctly. To test it from command line I ran...
# dig +short smtp.office365.com
The response back is...
Code:
smtp.outlook.office365.com.
outlook.office365.com.
lb.geo.office365.com.
outlook.office365.com.g.office365.com.
outlook-emeawest2.office365.com.
132.245.226.242
132.245.213.50
132.245.31.242
132.245.225.98
132.245.57.18
132.245.211.242
132.245.34.242
132.245.69.66
132.245.59.178
157.56.255.226
I then change within Joomla the SMTP host from smtp.office365.com to outlook-emeawest2.office365.com
I keep the connection settings identical, same port same username same password.
Result is the email is sent correctly, the only issue with using this method is that it's not the correct address to use.

Again in WordPress on the same server I need to change smtp.office365.com to outlook-emeawest2.office365.com

This work around isn't required on any other server that I look after the only difference is this one is using Centos 7 rather then 6
 
Back
Top