• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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