Tuesday, 5 August 2025

How Exchange Online Email Flow Works and Default email protections for cloud mailboxes

 

How Exchange Online Email Flow Works:

A diagram of email from the internet or Customer feedback entering Microsoft 365 and passing through the default email protections for cloud mailboxes.

 Exchange Online email flow refers to how email messages are routed to and from mailboxes in Microsoft's cloud-based Exchange environment (part of Microsoft 365). Here is a clear explanation of how email flow works in Exchange Online, broken down by inbound, outbound, and internal flow.

1.Inbound Email Flow (Internet → Exchange Online mailbox):

When an email is sent from the internet to a user in your Exchange Online organization, it undergoes a rigorous, multi-step process to ensure it is legitimate and safe. This inbound mail flow is primarily handled by Exchange Online Protection (EOP), which is a crucial part of Microsoft 365.

Here's a detailed breakdown of the steps:

  1. DNS and MX Routing: The external sender's mail server looks up your domain's DNS records to find the Mail Exchanger (MX) record. Your MX record is configured to point to a Microsoft 365 service address, typically in the format of your-domain.mail.protection.outlook.com. This record directs all incoming mail for your domain to Exchange Online Protection.
  2. Connection Filtering and IP Reputation: The sender's server establishes a connection with EOP. At this stage, EOP performs an initial set of checks, including:
    • Recipient Verification: EOP first verifies that the recipient's email address is a valid user in your organization's directory. This process, known as Directory Based Edge Blocking (DBEB), helps to reject messages for non-existent users at the perimeter, conserving resources and reducing junk mail.
    • IP Reputation: EOP checks the sending server's IP address against Microsoft's internal blocklists and allowlists. If the IP is known for sending spam or other malicious content, the connection may be rejected immediately, stopping the message before it can even enter the filtering pipeline.
  3. Anti-Malware and Anti-Phishing: If the connection is accepted, the message data is then scanned for malware, viruses, and phishing attempts. EOP's anti-malware engine uses multiple signature-based and heuristic scanning engines to detect malicious attachments and links.
  4. Mail Flow Rules (Transport Rules): The message is evaluated against any mail flow rules you have configured. These rules can be used to enforce specific policies, such as:
    • Adding a disclaimer to all incoming emails from outside the organization.
    • Redirecting emails with specific keywords to a compliance officer.
    • Encrypting emails based on sensitive information.
  5. Spam Filtering: The message is then subjected to a detailed content analysis by EOP's anti-spam engine. This process assigns a Spam Confidence Level (SCL) score to the message. The SCL score, ranging from -1 to 9, indicates how likely the message is to be spam. Based on the score and your organization's anti-spam policies, the message is handled accordingly. Common actions include:
    • SCL of 0 or 1: The message is delivered to the user's inbox.
    • SCL of 5 or 6: The message is delivered to the user's Junk Email folder.
    • SCL of 9: The message is quarantined or rejected.
  6. Delivery to Mailbox: If the message successfully passes all the filtering and rule-based checks, it is finally delivered to the recipient's Exchange Online mailbox, where the user can access it via Outlook or other email clients.

Simple steps Or Interview point of explanation:

External Sender Sends Email

  • Email is sent from an external domain (e.g., Gmail, another organization).

 Email hits Microsoft 365 Front-End (Edge)

  • Microsoft 365’s Exchange Online Protection (EOP) scans the email for spam, malware, and compliance policies.
  • If enabled, Microsoft Defender for Office 365 performs advanced threat protection (ATP) such as Safe Links or Safe Attachments.

Accepted Domain Check

  • If the recipient domain is valid for the tenant, the message proceeds.

Transport Rules (Mail Flow Rules)

  • Custom mail flow rules (also known as Exchange transport rules) are applied if configured (e.g., prepend subject, block, redirect).

 Mailbox Delivery

  • The email is delivered to the recipient’s mailbox in Exchange Online.

 

 

 

2.Outbound Email Flow (Mailbox → Internet):

 

The outbound email flow in Exchange Online is the process by which an email sent from a user's mailbox is delivered to a recipient outside your organization. This process is also managed and secured by Exchange Online Protection (EOP).

Here is a detailed breakdown of the steps:

  1. Submission from Client to Exchange Online: A user composes and sends an email from their Exchange Online mailbox using an email client like Outlook or Outlook on the web. The message is submitted to the Exchange Online transport service.
  2. Internal Processing and Policy Checks: Once the email is in the Exchange Online transport pipeline, it's subjected to a series of internal checks before it is sent to the internet:
    • Mail Flow Rules (Transport Rules): The message is evaluated against any outbound mail flow rules you have configured. These rules can be used to:
      • Apply disclaimers: Add a standard disclaimer to all external emails.
      • Enforce encryption: Automatically encrypt messages containing sensitive information, such as credit card numbers or social security numbers.
      • Redirect mail: Route emails to a different service, like a third-party archiving or filtering solution, using a connector.
      • Block content: Prevent messages with certain keywords or attachments from being sent.
    • Anti-Malware Scanning: EOP scans the message and its attachments for malware and viruses. If malware is detected, the message is typically quarantined or deleted, and the sender is notified.
  3. Outbound Spam Filtering and Throttling: Exchange Online Protection performs outbound spam checks to prevent a user's compromised account from sending spam and affecting your organization's reputation.
    • Reputation Management: EOP uses various techniques to monitor outbound email for signs of spam. If a user sends a large volume of email in a short period or the content is flagged as spam, the message may be throttled or blocked.
    • High-Risk Delivery Pool: To protect the sending reputation of all Microsoft 365 customers, EOP separates high-risk or potentially suspicious outbound email into a separate high-risk delivery pool. This ensures that the IP addresses used by most legitimate users are not affected by spammers.
  4. Routing and Delivery to External Recipient: Once the email has passed all the checks and rules, Exchange Online is responsible for routing it to the recipient's mail server. This is where DNS records, particularly SPF and DKIM, are critical:
    • SPF (Sender Policy Framework): Your SPF record in DNS authorizes Microsoft's servers to send email on behalf of your domain. The recipient's mail server can check this record to verify that the email came from a legitimate source.
    • DKIM (DomainKeys Identified Mail): EOP applies a digital signature to the outgoing message, which the recipient's server can use to verify that the message content has not been tampered with in transit.
    • DMARC (Domain-based Message Authentication, Reporting, and Conformance): This policy instructs the recipient's server on what to do with emails that fail the SPF and DKIM checks. It helps to prevent email spoofing of your domain.
  5. Final Delivery: The email is delivered to the recipient's mail server, which performs its own set of inbound checks before placing the email in the recipient's mailbox.

Simple steps: 

  • Email is composed and sent from Outlook, OWA, or another client using Exchange Online.
  • The message is authenticated, and send/receive limits are checked.
  • Rules like disclaimers or encryption may apply.
  • Outbound scanning ensures there is no malware, spam, or data loss (via DLP policies).
  • The message exits Microsoft 365 and goes over the internet to the recipient's mail server.

3.Internal Email Flow (Exchange Online Mailbox → Exchange Online Mailbox)

The internal email flow in Exchange Online is the simplest of all email flows, as the message never leaves the Microsoft 365 cloud environment. When an email is sent from one user to another within the same Exchange Online organization, the process is streamlined and highly efficient.

Here is a breakdown of the key steps:

  1. Submission from Sender's Mailbox: The sender composes and sends an email from their mailbox. The message is immediately submitted to the Exchange Online transport service, which is part of the same Microsoft 365 tenant.
  2. Transport Pipeline and Policy Checks: The message enters the transport pipeline, but unlike external mail, it is not routed to the internet. Instead, it is processed internally.
    • Mail Flow Rules (Transport Rules): The message is checked against any mail flow rules you have configured. These rules can apply to internal messages specifically. For example, you might have a rule that:
      • Enforces a company-wide signature or disclaimer on all internal emails.
      • Routes a copy of all emails sent to a specific group to an archive mailbox for compliance purposes.
      • Blocks emails with a specific word or phrase from being sent between certain users.
    • Anti-Malware Scanning: Although the risk is lower than with external mail, the message and its attachments are still scanned for malware and viruses as a security precaution. This helps to prevent the spread of malware that might have already entered the organization.
  3. No External Filtering or Authentication: The message bypasses the external-facing layers of Exchange Online Protection (EOP) that are used for connection filtering, IP reputation checks, and external anti-spam analysis. There is also no need for DNS records like SPF, DKIM, or DMARC, as the email is not traversing the internet.
  4. Delivery to Recipient's Mailbox: After passing through the internal policy checks and malware scans, the message is directly delivered to the recipient's Exchange Online mailbox. The delivery is virtually instantaneous, as it is an intra-service communication within the same Microsoft 365 environment.

Simple steps:

·         A message sent between users within the same Exchange Online tenant.

·         Transport Rules / Policies Applied

  E.g., tagging internal mail, adding footers, etc.

·         Email does not leave Microsoft's data centers — direct mailbox-to-mailbox delivery.

                                                      Exchange online Mail flow Diagram”

 

 

4.Security & Protection Layers in Email Flow

  • EOP (Exchange Online Protection): Built-in anti-spam, anti-malware, spoof protection.
  • Microsoft Defender for Office 365: Phishing, Safe Attachments, Safe Links, and threat intelligence.
  • DKIM, SPF, DMARC: Authentication technologies to prevent spoofing.
  • DLP (Data Loss Prevention): Prevents sensitive info from being shared.
  • Transport Layer Security (TLS): Encrypts the email in transit.

 

 

 

 

 

A)    Default email protections for cloud mailboxes-EOP Overview:

 

A diagram of email from the internet or Customer feedback entering Microsoft 365 and passing through the default email protections for cloud mailboxes.

 

Microsoft 365's inbound email flow for incoming messages is a multi-layered process designed to protect users from threats like spam, malware, and phishing.

 

1.      Connection Filtering: The initial layer of defense is connection filtering, which acts as a bouncer for incoming emails. It evaluates the sender's reputation and IP address. Most spam and malicious emails are blocked at this point, preventing them from consuming further resources.

2.      Malware Protection: If a message passes the connection filter, it's immediately scanned for malware in both the message body and attachments. If malware is detected, the message is sent to quarantine. By default, only administrators have access to quarantined malware, but they can create policies to grant users specific permissions to interact with these messages.

3.      Policy Filtering: After the message is deemed free of malware, it's checked against any custom mail flow rules (transport rules) that have been configured. These rules allow administrators to enforce specific policies, such as notifying a manager about emails from a particular sender. For on-premises Exchange organizations with the appropriate licenses, data loss prevention (DLP) checks are also performed at this stage.

4.      Content Filtering: The next step is content filtering, which focuses on identifying and handling spam and phishing attempts:

o    Anti-Spam: Messages are analyzed and categorized as bulk, spam, or high-confidence spam.

o    Anti-Phishing: Messages are scanned for signs of phishing and spoofing. High-confidence phishing messages are always quarantined, and, like malware, access is restricted to administrators by default.

5.      Delivery: A message that successfully navigates all these protection layers is finally delivered to the recipient's inbox.

 

Essential Configuration Steps for Administrators:

While the default settings provide a solid baseline, administrators must actively configure and enhance them to achieve robust security. The primary location for managing these settings is the Microsoft Defender portal (security.microsoft.com).

Use Preset Security Policies (Highly Recommended)

This is the easiest and most effective way to ensure a strong security posture. Microsoft provides pre-configured policies based on best practices.

  • What to do:
    1. Navigate to the Microsoft Defender portal (security.microsoft.com).
    2. Go to Email & collaboration > Policies & rules.
    3. Select Threat policies > Preset security policies.
    4. Enable and configure the Standard protection and Strict protection presets.
      • Standard Protection: A great baseline for all users. It enables MDO features like Safe Links and Safe Attachments (if licensed) with balanced settings.
      • Strict Protection: Recommended for high-value targets like executives, finance, and IT staff. It uses more aggressive settings.
    5. Assign users or groups to these policies.

 

 

 

M)

 

Alternative method to Review and Tune Key Policies Manually

Configuration Steps:

1. Access Microsoft 365 Security & Compliance Center

  • Go to: https://security.microsoft.com

2. Configure Anti-Spam Policy

Action: Open the Anti-spam inbound policy (Default).

 Recommendation: Review the "Actions" section. For High confidence spam, consider changing the action from "Move message to Junk Email folder" to "Quarantine message". This gives administrators more control over potentially dangerous emails.

 

  • Navigation: Email & collaboration → Policies & rules → Threat policies → Anti-spam policies
  • Actions:
    • Customize spam filtering thresholds.
    • Set up actions for spam, high confidence spam, phishing, bulk email.
    • Enable end-user spam notifications.

 

3. Configure Anti-Malware Policy:

Recommendation: Enable the "Common Attachments Filter". This allows you to block specific file types that are commonly used to transmit malware (e.g., .exe, .vbs, .scr).

  • Navigation: Threat policies → Anti-malware
  • Actions:
    • Configure malware detection response.
    • Enable zero-hour auto purge (ZAP).
    • Add custom notifications for detected threats.

4.Configure Anti-Phishing Policies

 

Recommendation:

·         Ensure Spoof intelligence is enabled.

·         Under Impersonation, configure protection for key users (e.g., your CEO, CFO) and your internal domains. Note: Advanced impersonation protection requires a Microsoft Defender for Office 365 license.

·         Review the "Actions" tab to control what happens when spoofing or impersonation is detected.

  • Navigation: Threat policies → Anti-phishing
  • Actions:
    • Enable mailbox intelligence.
    • Configure user/domain impersonation protection.
    • Set up actions for detected phishing attempts.

…………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………

 

5. Enable Microsoft Defender for Office 365 (Plan 1 or 2)

  • Add-on license required (for ATP).
  • Configure:
    • Safe Links: Protect users from clicking on malicious URLs.
    • Safe Attachments: Open attachments in a sandbox before delivery.
    • Real-time detections & Threat Explorer (Plan 2 only).

6. Configure DKIM, DMARC, and SPF

  • DNS-level domain authentication protections:
    • SPF (Sender Policy Framework)
    • DKIM (DomainKeys Identified Mail)
    • DMARC (Domain-based Message Authentication, Reporting, and Conformance)


·         Sender Policy Framework (SPF): This is a DNS record that lists which mail servers are permitted to send emails on behalf of your domain. It helps recipient servers verify that an email is coming from a legitimate source.

·         DomainKeys Identified Mail (DKIM): This standard adds a digital signature to the header of an email. The signature is created using your domain's private key, and the recipient server can use your public key (found in DNS) to verify that the email's content hasn't been changed in transit.

·         Domain-based Message Authentication, Reporting and Conformance (DMARC): This policy builds on SPF and DKIM. It tells receiving mail servers what to do with messages that fail both SPF and DKIM checks (e.g., quarantine them, reject them, or simply report on them). DMARC also provides reporting, giving domain owners visibility into who is sending emails using their domain, and how those emails are being authenticated.

·         Authenticated Received Chain (ARC): This protocol is designed for situations where an email is modified in transit by a legitimate service, such as a mailing list or forwarding service. ARC preserves the original authentication results (SPF, DKIM, etc.) so that the final recipient's server can still authenticate the message, even though the modifications might have otherwise caused it to fail DMARC.


Source: https://learn.microsoft.com/en-us/defender-office-365/eop-about

Create and apply information management policies - Microsoft Support