Understanding Email Security Deployments

Last updated Oct 26, 2026

Introduction

Email continues to be a mission critical method for communication between people and organizations. This also makes email an ideal channel for attackers to exploit in their attempts to take over accounts, steal data, and gain access to internal systems. Being able to reduce spam, defeat phishing, and malware attacks is critical for the security of your organization. Over 90% of cybersecurity incidents begin with an email attack.

Cloudflare Email security service is a market leading solution that can be deployed in a variety of ways to support different needs for each organization. This document outlines the different methods to deploy Email security and why you would choose any specific model.

Strengthen your email infrastructure with Cloudflare Email security

Email remains a critical communication channel for businesses of all sizes. However, email also serves as a prime target for cyber attacks, including phishing, spam, and malware. To safeguard your organization sensitive data and reputation, a robust email security solution is essential.

Cloudflare Email security offers a comprehensive suite of tools and technologies designed to protect your email infrastructure from a wide range of threats. By implementing Cloudflare Email security, you can significantly enhance your organization security posture and mitigate the risks associated with email-borne attacks.

This reference architecture provides a detailed overview of how to deploy and configure Cloudflare Email security to optimize your email security posture. This reference architecture will delve into key components and best practices to ensure the seamless integration of this solution into your existing IT infrastructure.

Who is this reference architecture for and what will you learn?

This reference architecture is designed for IT or security professionals who are looking at using Cloudflare to secure aspects of their business. This reference architecture is designed for a broad audience, including:

  • IT security professionals: Security engineers, architects, and administrators responsible for designing, implementing, and managing Email security solutions.
  • Network engineers: Network engineers who manage network infrastructure and email gateways.
  • Cloud architects: Cloud architects who design and implement cloud-based Email security solutions.
  • Security and IT decision-makers: Managers and executives who need to understand the technical aspects of Email security and make informed decisions.

Whether you are a seasoned security expert or a newcomer to Email security, this document will provide you with the necessary information to effectively deploy and manage Cloudflare Email security.

To build a stronger understanding of Cloudflare, we recommend the following resources:

By the end of this reference architecture, you will have learned how Cloudflare protects your email and what considerations should be made for choosing how to deploy. You will learn about the specific components, technologies, and configurations involved in the Cloudflare Email security solution. This includes how it integrates with existing email infrastructure and leverages cloud-based services.

Email security deployment options

Cloudflare Email security is a modern approach to solving phishing attacks. Cloudflare solution is built upon AI and Machine Learning utilizing elastics services in addition to benefiting from Cloudflare expansive threat intelligence network. Cloudflare Email security was designed as the only true Cloud Elastic Service with shared intelligence and Supervised ML ↗︎ capable of any deployment method available for email. However, choosing the right deployment model is crucial for maximizing the benefits of Email security.

This document will discuss the following methods to deploy and where you would use them:

Choose a deployment model

Before you choose a deployment option, it is important to consider your needs and desired experience. Our best practice is typically to go with an MX deployment when we are the primary phishing protection in place. The key reasons for this are as follows:

  • Pre-delivery remediation allows us to tune how messages are delivered by appending to the subject/body, applying URL Rewriting to Cloudflare Remote Browser Isolation, and delivering messages into the junk folder or downstream email quarantine. This enables you to design with a specific user experience in mind.
  • We can remove messages before they are consumed by systems that ingest emails such as a ServiceNow or an Archiving Solution.
  • We remove the risk of dwell time issues where there is a time difference between delivery to the inbox and when the message is moved from the inbox.
  • We can support mixed deployments such as a mix of Microsoft 365 and Microsoft Exchange or Microsoft 365 and Google Workspace.

If those needs are not important or you are using layered security that does not include another API-based solution, then our API method is quick and efficient to deploy with no changes to your mail flow. Journal/BCC reduces API usage by ingesting messages through SMTP. API-based remediation remains subject to provider throttling. However, if you want the protection of an MX deployment along with the benefits of API for internal messaging, then our mixed deployment is ideal.

Should your needs change, know that you have the flexibility to change deployment methods as you see fit without having to repurchase our solution. The only caveat is that Advantage and CyberSafe customers are limited to Inline deployments while Enterprise licensing benefits from all capabilities.

Before you commit to a specific deployment, Cloudflare suggests you review all of the options, weigh your needs, and consult with your account team as needed.

Deployment options

Inline

With an Inline deployment, all emails destined for one or more domains are filtered through Cloudflare before they are delivered to the user's inbox. Cloudflare can be deployed anywhere in your email processing chain. When deployed as the first hop, you will need to update the domain's DNS MX records to point to Cloudflare. If you prefer Cloudflare to inspect messages after your existing SEG (Secure Email Gateway), Cloudflare can be inserted as a hop in the processing chain, and will then forward processed messages downstream to the next hop. Based on policies, messages are blocked and/or quarantined if they are marked as Spam, Malicious, Bulk, and more.

Inline deployment

The diagram above describes the following:

  1. Email arrives at Cloudflare based on MX records ↗︎.
  2. Cloudflare inspects email body, header, and attachments and assigns the appropriate disposition:
  3. Malicious
  4. Spam
  5. Bulk
  6. Suspicious
  7. Spoof
  8. Clean
  9. Apply any policy, such as allow or block certain domains.
  10. Quarantine high risk emails
  11. All messages that received a disposition by Cloudflare will have the header X-CFEmailSecurity-Disposition added. This header can be used by downstream systems to enact any special handling (rerouting, external quarantining, and more).
  12. Forward on all valid email traffic.
  13. Subject and/or body modifications can be applied to the messages to add visible information for the end-user about the disposition.

From a security perspective, the Inline deployment is the preferred method of deployment, because it scans every email and stops malicious content from reaching the user inbox. This removes all exposure risks to users.

Benefits of Inline deployment

  • Messages are processed and blocked before delivery to the user mailbox.
  • Inline deployment allows you to modify the message, adding subject or body mark-ups such as appending [SPAM] or [EXTERNAL SPAM] to the subject.
  • Provides high availability and adaptive message pooling as Cloudflare will continue to accept incoming emails in queue, even when the downstream services are not available. When the downstream services are restored, messages will resume delivery for the queue.
  • Messages with an assigned disposition that are not quarantined receive an X-header that may be used for advanced handling downstream.
  • Compatible with all mail systems including Microsoft Exchange On-Prem, Postfix, Lotus Notes, Google Workspace, Microsoft 365, and more.

Considerations

Before deploying Email security via Inline deployment, you will need to consider the following:

  1. Redirecting deployments where mail flows into Microsoft Exchange or Microsoft 365 first, then to an Email security solution by way of mail flow rules for scanning/remediation, and then back into Microsoft 365 is not supported by Microsoft. While Cloudflare is technically capable of this deployment, it creates attribution (recognizing the original sender) and delivery issues.
  2. If Cloudflare is going to be the MX, this will require DNS changes. If there are many domains, each DNS zone needs to be updated.
  3. Inline deployment can increase complexity in the SMTP architecture if Cloudflare is not deployed as MX such as Inline behind a traditional SEG (Mimecast/ProofPoint).
  4. Inline deployment may require policy duplication on multiple solutions and the MTA. For example, Cloudflare, SEGs, and MTA treat allow policies in significantly different ways and may all need exception handling for the same message.
  5. In a layered deployment, some vendors such as Mimecast and Barracuda can only function as the MX. In this scenario, you would configure Cloudflare Inline behind those vendors.
  6. When using Mimecast, it is recommended to disable URL Rewriting as it makes it impossible for Cloudflare to decode and crawl URLs. If this feature remains enabled, our link following capabilities are limited to domain reputation and age.

Inline (Cisco Connector)

Cisco offers a unique capability to integrate with Cloudflare using a connector as MX or behind Cloudflare with a supportable Hairpin deployment. This deployment functions the same as Inline in all other considerations. Refer to Cisco as MX Record and Cisco - Email security as MX Record.

API

An alternative approach is to integrate via the Graph API in Microsoft 365. In this model, emails are delivered directly to the user inbox, where Cloudflare then receives copies of messages, scans them, and moves them as configured by disposition.

This is performed by subscribing to all user mailboxes on the authorized domains. You have the ability to choose if the scope should be restricted to the Inbox only, or All Folders during the authorization process. Upon delivery to the mailbox, the subscription triggers an action within Microsoft 365 that sends Cloudflare a copy of the email to be scanned and assigned a disposition. Once the disposition has been assigned, our solution will look at the auto-move policy and perform the desired action.

API deployment

The diagram above describes the following:

  1. An email is delivered directly to the user inbox via an existing route.
  2. Cloudflare retrieves messages for inspection via email vendors API. Cloudflare inspects email body, header, and attachments and assigns the appropriate disposition:
  3. Malicious
  4. Spam
  5. Bulk
  6. Suspicious
  7. Spoof
  8. Clean
  9. Apply any policy, such as allow or block certain domains.
  10. Messages are moved per policy in the Cloudflare solution. The following actions are available:
  11. Inbox
  12. Junk
  13. Trash
  14. Soft Delete (User Recoverable)
  15. Hard Delete (Admin Recoverable)

Under normal circumstances, this process is typically performed in less than 2-3 seconds from inbox delivery to the move request. There is no SLA from Google or Microsoft 365 on how long they will take to perform the action. If the move action is not successful, our solution will retry numerous times every five minutes.