Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

Unable to set up an email account hosted in Plesk in an email client when a domain is behind Cloudflare: The connection to the server failed

 
cloudflaredomain nameemailextensionshosted

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:

      Log onto incoming mail server (IMAP): The connection to the server failed.

    • Thunderbird:

      Unable to log in at server. Probably wrong configuration, username or password.

    • Mail for iOS:

      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:

      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>:

    1. Disable proxy traffic for mail.example.com in Cloudflare dashboard (if it is enabled).

    2. 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).

 

Via Plesk interface

 

  1. Log in to Plesk.

  2. Install the Panel.ini Editor from the Extensions menu in Plesk.

  3. Open Panel.ini Editor at Extensions > My Extensions.

  4. In Panel.ini Editor, switch to the Editor tab and add the following configuration at the end of the file:

    [mail]
    clientConfig.incomingServer="mail.<domain>"
    clientConfig.outgoingServer="mail.<domain>"

  5. Apply the changes.

 

Via command-line

 

  1. Connect to the server via SSH.

  2. 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

  3. Add the following lines:

    [mail]
    clientConfig.incomingServer="mail.<domain>"
    clientConfig.outgoingServer="mail.<domain>"

  4. Save the changes and close the file.

 

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

What is Cloudflare and How To Set It Up For Your Site?

Read More »

WordPress Firewall – Why Do You Need One?

Read More »

Getting Started With Plesk Extensions & Tools

Read More »
Knowledge Base

Websites on Plesk server are slow or show error 500 or PHP mail cannot be sent: ap_pass_brigade failed

Read More »

Mail delivery does not work: do not list domain in BOTH mydestination and virtual_mailbox_domains

Read More »

Email header analysis reports SPF failed for localhost IP on mail sent from Plesk hosted mailbox: SPF Authentication : SPF Failed for IP – 127.0.0.1

Read More »

Unable to send mail from Plesk server: deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

Read More »

Hosting Wiki

  • RESTful Web Service
  • DBMS Interface
  • Server Redundancy
  • Cloud Service Architecture
  • Virtualizor
  • QMAIL
  • Sendmail
  • On-Demand Services
  • Cloudflare
  • Bare Metal Server
  • Denial of Service
  • PhpMyAdmin
  • phpPgAdmin
  • Red Hat Virtualization
  • Virtuozzo
  • Oracle VM Server
  • Citrix Hypervisor
  • Server Virtualization Software
  • Windows Server
  • Linux
  • Virtualization
  • JavaScript
  • PHP
  • HTTP/3
  • HTTP/2
  • Domain
  • VirtualMin
  • Plesk
  • Lighttpd
  • Web Server
  • DNS Server
  • IPv6
  • IPv4
  • SIP
  • SSL
  • SSH
  • UDP/IP
  • Network Bandwidth
  • Email Autoresponder
  • Mailing Lists
  • Email Alias
  • Email Virus Protection
  • Email Forwarding
  • Webmail
  • TCP/IP
  • HTTP
  • IMAP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family