Applicable to:
- Plesk for Linux
Symptoms
-
A domain is behind Cloudflare proxy.
-
When setting up an email account of this domain in a mail client (Outlook, Thunderbird, Mail for iOS, etc.), the operation fails due to a failed connection to the mail server.
Examples of error messages:
-
Outlook:
PLESK_INFO: Log onto incoming mail server (IMAP): The connection to the server failed.
-
Thunderbird:
PLESK_INFO: Unable to log in at server. Probably wrong configuration, username or password.
-
Mail for iOS:
PLESK_INFO: The IMAP server "example.com" is not responding. Check your network connection and that you entered the correct information in the "Incoming Mail Server" field.
-
PHP script:
PLESK_INFO: Connection could not be established with host example.com
-
Cause
Cloudflare proxies only HTTP/HTTPS traffic and blocks other traffic including mail. A mail client tries to fetch the real IP address using a domain name to set up a connection, but fails because the request ends up on the Cloudflare side.
Resolution
For manual configuration
-
Use mail.<domain_name>:
-
Disable proxy traffic for mail.example.com in Cloudflare dashboard (if it is enabled).
-
Set up an email account in a mail client using mail.example.com for incoming/outgoing mail server.
Note: Issue a wildcard SSL certificate for the domain example.com to add an email account using a secure connection.
-
-
Configure an email account using the server hostname (if it is not behind Cloudflare) for incoming/outgoing mail server.
Note: Secure the mail server hostname with an SSL certificate to add an email account using a secure connection.
-
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.
For autodiscovery
Note: For this solution to work, disable proxy traffic for mail.example.com in Cloudflare dashboard (if it is enabled).
-
Install the Panel.ini Editor from the Extensions menu in Plesk.
-
Open Panel.ini Editor at Extensions > My Extensions.
-
In Panel.ini Editor, switch to the Editor tab and add the following configuration at the end of the file:
CONFIG_TEXT: [mail]
clientConfig.incomingServer="mail.<domain>"
clientConfig.outgoingServer="mail.<domain>" -
Apply the changes.
-
Connect to the server via SSH.
-
Open the
panel.ini
file in a text editor. In this example, we are using the vi editor:# vi /usr/local/psa/admin/conf/panel.ini
-
Add the following lines:
CONFIG_TEXT: [mail]
clientConfig.incomingServer="mail.<domain>"
clientConfig.outgoingServer="mail.<domain>" -
Save the changes and close the file.
Comments
0 comments
Please sign in to leave a comment.