Symptoms
-
Unable to set up a mail account on an external mail client (e.g. Outlook) when the domain name is using Cloudflare proxy:
Connection could not be established with host example.com
Unable to connect to example.com:587 -
The webmail [email protected] works correctly.
Cause
Cloudflare does not proxy the mail traffic, it can only proxy traffic going over the HTTP/HTTPS ports in a specific range: https://support.cloudflare.com/hc/en-us/articles/200169156
Mail client tries to fetch the real Plesk IP address using a domain name to set up a connection but fails because the request ends up on the Cloudflare side and the wrong IP is obtained.
Resolution
There are 3 solutions available:
-
In Cloudflare console, do not proxy traffic on mail.example.com and configure email on mail.example.com.
-
Configure mail client using a hostname that resolves directly to Plesk mail server IP address.
Note: The mail server on that hostname should be secured in order to avoid an SSL warning when trying to set up an email account.
-
Configure mail client using Plesk mail server IP address.
Note: in this scenario, the customer will receive an SSL warning when trying to set up an email account. There are no ways to avoid such warnings.