Join our Newsletter — 33% off our NHI Course
Home› Guides› Email Security Guide: SEG, ICES and API-Based Protection
Guide Email & Communications Security

Email Security Guide: SEG, ICES and API-Based Protection

← All guides
By Lalit Choda, NHI Mgmt Group Updated 16 October 2026 17 min read
On this page

Email remains a primary route for phishing links, malware and payment fraud, and organisations regularly lose credentials to messages that passed straight through an email security gateway. No single product closes that gap: protection comes from layers that each do a different job, from the MX record and sender authentication to inline filtering, API-based post-delivery remediation, transport encryption and the identity controls behind the mailbox. This guide compares secure email gateways (SEG), integrated cloud email security (ICES) and API-based protection, sets out SPF, DKIM and DMARC from the RFCs together with the Google and Yahoo bulk sender requirements, and covers MX routing, TLS, sandboxing, remediation, rollout and measurement. It is written for email administrators, security architects and SOC leads running Microsoft 365, Google Workspace or hybrid mail.

Key takeaways

  • SEG and ICES solve different problems. A gateway filters inline before delivery and controls routing; an API-based tool sees mail after the platform has filtered it, including internal mail, and pulls it back from mailboxes.
  • Routing mistakes undo filtering. If the cloud tenant still accepts direct delivery, attackers skip the gateway, and bypass rules on shared gateway IPs let spoofed mail through. Lock inbound connectors to the gateway.
  • DMARC at p=reject is the goal. Google and Yahoo require only p=none for bulk senders, which stops nobody spoofing you. Move through quarantine to reject, and publish reject records on domains that never send.
  • Post-delivery remediation is a core control. Links are weaponised after delivery and verdicts change, so clawback, time-of-click checks and fast search-and-purge decide how long a malicious message stays usable.
  • Most email losses end in an identity event. Credential phishing, OAuth consent, forwarding rules and stolen sending keys turn a message into account access, so phishing-resistant MFA and app governance belong in the design.

SEG, ICES and API-based protection compared

These category names come from the market rather than a standard, and products increasingly offer more than one deployment mode, so judge the architecture, not the label. Microsoft's description of the split is useful: gateways "filter emails before they reach" its cloud filtering, while ICES products "detect and remediate threats after" it and "act as a secondary filter", using the Microsoft Graph API to move messages between folders.

QuestionSecure email gateway (SEG)ICES / API-basedNative platform protection
DeploymentMX points to the gateway, which relays clean mail to the mailbox platform; outbound usually smart-hosted through itConnected by API (Microsoft Graph, Google Workspace APIs) with admin consent; no MX changeBuilt into Microsoft 365 or Google Workspace
When it actsInline, before deliveryMostly after delivery (scan and pull back); some offer an inline modeBefore delivery, plus post-delivery features
Internal (east-west) mailUsually not seenSeen, which matters for compromised internal accountsSeen
Sender authenticationSees the original connecting IP, so SPF and DMARC evaluate correctlyRelies on platform results and headersCorrect only if MX points to it or skip listing is configured
Outbound controlsStrong: DLP, encryption gateway, enforced TLS per partnerOften limitedPlatform DLP and encryption
Main failure modeDirect-to-tenant delivery that bypasses it; links weaponised laterExposure window between delivery and removal; over-privileged API accessDefaults left unchanged; allow lists overriding detection
Operational costDNS and connector changes, an extra hop, outage riskQuick to deploy and remove; one more high-privilege app to governLowest; tuning only

Choosing a design

  • Cloud-only mail, small or mid-sized organisation: run the platform's own protection on its strict preset and add an API-based layer if reported phishing and BEC losses justify it. An inline gateway only for spam filtering adds routing complexity for little gain.
  • Hybrid or on-premises mail, many domains, heavy outbound needs: a gateway still earns its place for routing control, outbound encryption, enforced partner TLS and archiving integration.
  • High BEC exposure (finance, legal, supplier payments): prioritise behavioural detection of impersonation and vendor account compromise, which needs internal and conversational context. This is where API-based tools are strongest.
  • Stacking: gateway in front, platform in the middle and API layer after is a supported pattern if each layer trusts the right hop. Two inline filters in series mostly add latency and false positives.

MX routing, connectors and bypass

The MX (mail exchanger) record tells the internet where to deliver your mail. When it points at a gateway in front of a cloud tenant, four problems follow unless they are configured away.

  • Direct delivery bypass: the tenant has its own public endpoint, so attackers can deliver straight to it. Microsoft's guidance is to "lock down your Exchange Online organization to only accept mail from your third-party service" with a Partner inbound connector using TlsSenderCertificateName (preferred) or SenderIpAddresses, with RestrictDomainsToCertificate or RestrictDomainsToIPAddresses set to $True.
  • Lost sender data: after a gateway, the message "adopts the source IP of the last hop", so SPF and DMARC at the platform see the gateway. Enhanced Filtering for Connectors (skip listing) restores the original IP and sender; it is not for services that scan after Microsoft 365.
  • Bypass rules on shared IPs: Microsoft warns that gateway providers share IP addresses among customers, so "bypassing scanning on these IPs might allow spoofed and phishing messages". Use skip listing instead of a spam-filter bypass rule.
  • Modified messages: gateways that rewrite links or add banners break DKIM signatures. If the gateway supports ARC (RFC 8617), add it as a trusted ARC sealer.

Outbound, the platform usually sends through the gateway as a smart host. SPF must authorise whichever system actually connects to the internet, and DKIM signing should happen at the last hop that modifies the message.

Sender authentication: SPF, DKIM and DMARC

These standards protect the exact domains you own. They do nothing against look-alike domains or compromised accounts, but they are what lets receivers reject mail that spoofs you.

RecordWhere it livesWhat it checksKey values and limits
SPF (RFC 7208)TXT at the domain, starting v=spf1Whether the connecting IP may send for the MAIL FROM or HELO domainMechanisms ip4, ip6, a, mx, include, exists, all; ptr deprecated. Qualifiers - fail, ~ softfail, ? neutral. "SPF implementations MUST limit the total number of those terms to 10"; void lookups limited to two; two SPF records is a permerror.
DKIM (RFC 6376, updated by RFC 8301)TXT at <selector>._domainkey.<domain>A signature over the body hash and listed headers, tied to the d= domain"Signers MUST sign using rsa-sha256"; "rsa-sha1 MUST NOT be used for signing or verifying"; keys at least 1024 bits, "SHOULD use RSA keys of at least 2048 bits".
DMARC (RFC 9989, obsoletes RFC 7489)TXT at _dmarc.<domain>Whether SPF or DKIM passed for a domain aligned with the From: domainp= none, quarantine or reject; sp= subdomains; np= non-existent subdomains; adkim/aspf relaxed (default) or strict; rua= aggregate reports; t=y test mode.
MTA-STS (RFC 8461) and TLS-RPTTXT at _mta-sts and _smtp._tls; policy at https://mta-sts.<domain>/.well-known/mta-sts.txtWhether senders must use authenticated TLS to your MX hostsModes testing and enforce; NCSC suggests max_age: 86400 in testing and at least 1209600 when enforcing.

Alignment is what makes DMARC work

RFC 7489 put it simply: "When the domain in the RFC5322.From address matches a domain validated by SPF or DKIM (or both), it has Identifier Alignment." DMARC passes if either aligned check passes. SPF often fails alignment for third-party senders, which use their own envelope domain, and it breaks on forwarding. DKIM signing with your own domain at every third-party sender is the reliable route to a passing result.

What changed with RFC 9989

DMARC was first published as an Informational, Independent Submission RFC. In May 2026 RFC 9989 put it on the Standards Track, with aggregate reporting in RFC 9990 and failure reporting in RFC 9991. For record owners: the pct tag is removed (receivers ignore unknown tags); the new t=y flag asks receivers to apply one policy level lower; np covers non-existent subdomains; and the organisational domain is found by a DNS tree walk capped at eight lookups rather than only the Public Suffix List. Rollouts staged with pct=10 should move to t=y or per-subdomain policies.

Domains that never send mail

Parked and defensive domains are spoofed because nobody watches them. The UK government pattern is: SPF v=spf1 -all; DMARC v=DMARC1;p=reject;sp=reject;adkim=s;aspf=s plus a reporting address; an empty DKIM key at *._domainkey (v=DKIM1; p=); and a null MX with priority 0 and value . (RFC 7505).

Google and Yahoo bulk sender requirements

Since February 2024 Gmail and Yahoo have enforced baseline rules for anyone sending to personal Gmail and Yahoo addresses, including HR, billing and marketing systems.

RequirementGmail (all senders)Gmail (over 5,000 a day)Yahoo (bulk senders)
AuthenticationSPF or DKIMSPF and DKIMSPF and DKIM
DMARCNot requiredRecord required, policy may be none; From: aligned with SPF or DKIM domainAt least p=none, must pass; relaxed alignment acceptable
DNSValid forward and reverse DNS (PTR)SameValid forward and reverse DNS
TransportTLS for transmitting emailSameNot among the listed requirements
Spam rateBelow 0.30% in Postmaster ToolsKeep below 0.10%, avoid 0.30%"Keep your spam rate below 0.3%"
UnsubscribeNot requiredOne-click (List-Unsubscribe-Post: List-Unsubscribe=One-Click plus HTTPS List-Unsubscribe), visible link, processed within two daysOne-click (RFC 8058 POST recommended), visible link; "Honor unsubscribes within 2 days"
DKIM key1024-bit minimum, 2048 recommendedSame1024-bit minimum

Gmail also warns senders not to impersonate Gmail From: headers because it will apply DMARC quarantine to its own domain. Yahoo recommends ARC for anyone who forwards mail.

Transport security: opportunistic and enforced TLS

  • Opportunistic TLS: servers upgrade with STARTTLS when both sides support it, otherwise send in plaintext. NCSC notes STARTTLS "is susceptible to a downgrade attack by a 'man in the middle'", and you must still accept unencrypted mail to receive from everyone.
  • Enforced TLS: for regular partners (law firms, payroll, regulators), require TLS with certificate validation per domain and refuse to send otherwise.
  • MTA-STS: start in testing mode with TLS-RPT reports, monitor for at least a month as NCSC advises, then enforce. Change the id in the _mta-sts record whenever the policy file changes.
  • Message-level encryption: S/MIME or an encryption gateway protects content beyond the next hop. Note that Microsoft documents Safe Links "ignores S/MIME signed messages".

Filtering, sandboxing and post-delivery remediation

Before delivery

  • Sender MTA reputation analysis: IP and domain scoring, forward-confirmed reverse DNS (the PTR name resolves back to the same IP), blocklists and connection behaviour remove most unsolicited commercial email cheaply. Snowshoe spam spreads low volumes across many IPs and defeats per-IP thresholds, so it needs content and domain-age signals.
  • Attachments: block file types you never need (executables, scripts, disk images, macro-enabled legacy formats), then detonate the rest in a sandbox. Holding mail during detonation is safer but adds delay.
  • URL rewriting: wrapped links are checked at time of click. With Microsoft's "Wait for URL scanning to complete" on, messages "are delivered only after the URLs are confirmed to be safe". Avoid double wrapping: Microsoft notes that another service wrapping links first "might prevent Safe Links from processing links".
  • Backscatter: reject unknown recipients during the SMTP session rather than bouncing later to forged senders.
  • External sender banner: keep it short and reserve stronger warnings for first-time or look-alike senders, or users stop reading it.

After delivery

  • Automatic clawback: Microsoft's zero-hour auto purge (ZAP) "retroactively detects and neutralizes" phishing, spam and malware in Exchange Online, but its search "is limited to the last 48 hours of delivered email", users are not told, and allow lists and mail flow rules can override it. Check the window your post-delivery tool covers.
  • Search and purge: analysts need a tested way to find every copy of a campaign by sender, URL or attachment hash and remove it within minutes, with an audit trail.
  • User reporting: a report button feeding the same triage queue turns one report into tenant-wide removal.
  • Outbound: run email DLP with a few high-confidence detectors in audit mode before blocking, set per-user sending limits, block automatic external forwarding by default, and protect archives with the same access controls as live mailboxes.

Where identity fits

Filtering decides whether a message arrives. Attackers want the account behind it, and much of the email estate runs on non-human identities.

  • Credential phishing past the gateway: adversary-in-the-middle pages relay passwords and one-time codes in real time, often from legitimate hosting that passes reputation checks. Phishing-resistant MFA makes the stolen credential useless. See the Passwordless and Passkeys Guide.
  • API-based security tools are privileged applications: an ICES product typically holds application permissions to read and modify every mailbox. Record its permissions, owner and credentials and review them like an administrator. See the SaaS and OAuth App Governance Guide.
  • Sending credentials: SMTP relay passwords and email API keys are authorised in your SPF and signed with your DKIM keys, so whoever steals them sends fully authenticated mail as you. The TruffleNet campaign used stolen AWS keys to send business email compromise through Amazon SES, and Gravity SMTP CVE-2026-4020 exposed email API keys. See the API Key Management Guide.
  • Mailbox access by apps and rules: a consented or hijacked app reads mail through the API without any message passing a filter, as in the Microsoft Midnight Blizzard breach. Forwarding rules (ATT&CK T1114.003) keep access "even after compromised credentials are reset". For payment fraud from real supplier mailboxes, see the Email Identity and BEC Guide.

How to implement: a phased rollout

  1. Inventory: list every owned domain, MX record, connector, transport rule and system that sends as your domains (marketing, CRM, ticketing, payroll, scanners). DMARC projects stall when an unknown sender appears late.
  2. Publish monitoring records: fix SPF (under ten lookups), enable 2048-bit DKIM for every sender, and publish p=none with rua. Publish reject records on non-sending domains now; they carry no delivery risk.
  3. Fix routing: enable skip listing, lock inbound connectors to the gateway, remove bypass rules, add ARC trust. Test by sending directly to the tenant endpoint from outside: it must be rejected.
  4. Tighten filtering in rings: apply strict policies (attachment blocking, sandbox hold, wait for URL scanning, impersonation protection for executives and finance) to IT and security first, then 10 to 20 per cent of users, then everyone. Keep the old policy on a group so rollback is a membership change.
  5. Add post-delivery protection: run any API-based tool in report-only mode for two to four weeks, compare findings with the platform, then automate remediation for high-confidence verdicts only.
  6. Enforce DMARC: move to quarantine when reports show legitimate mail passing, then reject. NCSC says many organisations reach reject "after about 3 months" and advises at least two weeks of monitoring after each change; roll back to quarantine if legitimate mail fails.
  7. Transport and outbound: run MTA-STS in testing with TLS-RPT, then enforce; enable DLP in audit mode; block external auto-forwarding with an exception process.
  8. Operationalise: document search-and-purge, send email telemetry to the SIEM and rehearse a campaign response twice a year.

Detection and measurement

Monitor DMARC aggregate reports (new sending sources, alignment failures, spoofing volume), TLS-RPT failures, quarantine and clawback actions, user reports, time-of-click blocks, new inbox and transport rules (for example New-InboxRule), new OAuth consents with mail permissions, and sign-ins that follow a reported phish.

MetricWhat it showsTarget direction
Share of owned domains at p=rejectHow much of your brand can still be spoofedTowards 100%
DMARC pass rate of legitimate volume per sending sourceReadiness for enforcementNear 100% before reject
Median time from first report to tenant-wide removalSpeed of post-delivery remediationMinutes, not hours
Phishing reaching inboxes per 1,000 users per monthResidual risk after all layersFalling
Credential submission and report rates on real and simulated phishingUser and time-of-click effectivenessSubmissions falling, reports rising
Gmail Postmaster Tools spam rate for bulk streamsDelivery risk under bulk sender rulesBelow 0.10%

Common failure patterns

  • Gateway in front, tenant wide open: the MX points to the gateway but the tenant accepts direct delivery, and a bypass rule for the gateway's shared IPs means spoofed mail arrives unfiltered.
  • DMARC parked at p=none: published to satisfy bulk sender rules and never enforced, so the domain can still be spoofed in invoice fraud.
  • SPF overloaded: each new SaaS sender adds an include until the record exceeds ten lookups and returns permerror, failing SPF for all mail. Use per-sender subdomains and DKIM alignment.
  • Allow lists that override detection: broad allow entries added to fix one false positive stop filtering and clawback from acting.
  • Trusting the filter, not the identity: one message that lands is enough. In the Cyberhaven Chrome extension breach, phishing posing as the Chrome Web Store led to a single OAuth consent that let attackers publish a malicious update. Plan filtering together with phishing-resistant MFA and consent controls.

Framework mapping

Control areaNIST SP 800-53 Rev. 5CIS Controls v8.1ISO/IEC 27001:2022 Annex AMITRE ATT&CK
Spam, malware filtering, sandboxingSI-8 Spam Protection, SI-3 Malicious Code Protection9.6 Block unnecessary file types; 9.7 Email server anti-malwareA.8.7 Protection against malwareT1566.001 Spearphishing Attachment (M1049)
URL rewriting, time-of-click checksSI-3, SC-7 Boundary Protection9.3 Network-based URL filtersA.8.23 Web filteringT1566.002 Spearphishing Link (M1021)
SPF, DKIM, DMARCSI-89.5 Implement DMARCA.5.14 Information transferT1566 Phishing (M1054)
TLS, MTA-STS, encryptionSC-8 Transmission Confidentiality and Integrity3.10 Encrypt sensitive data in transitA.5.14, A.8.24 Use of cryptographyNone specific
DLP, forwarding blocksAC-4 Information Flow EnforcementControl 3 Data ProtectionA.8.12 Data leakage preventionT1114.003 Email Forwarding Rule
User reporting, awarenessAT-2 Literacy Training and AwarenessControl 14 Security AwarenessA.6.3 Information security awarenessT1566 (M1017)

In NIST CSF 2.0, filtering and authentication sit under Protect (PR.PS, PR.DS) and reporting, clawback and rule monitoring under Detect (DE.CM) and Respond.

Practitioner checklist

  • Inventory owned domains, MX records, connectors and every system that sends as you, each with an owner.
  • Publish SPF -all, DMARC reject, an empty DKIM key and a null MX on every non-sending domain.
  • Sign all outbound mail with 2048-bit DKIM under your own domain, including third-party senders, and keep SPF under ten lookups.
  • Move sending domains to p=reject via quarantine, and replace pct staging with t=y or subdomain policies.
  • Where a gateway fronts a cloud tenant, restrict inbound connectors to it, enable skip listing and remove shared-IP bypass rules.
  • Block unneeded attachment types, hold mail for sandbox and URL scanning, and avoid double link wrapping.
  • Test clawback and search-and-purge end to end and track time from first report to removal.
  • Block external auto-forwarding by default and alert on new inbox rules, transport rules and mail-scoped OAuth consents.
  • Govern API-based email tools and sending keys as privileged non-human identities with owners, least privilege and rotation.
  • Run MTA-STS in testing with TLS-RPT, then enforce, and enforce TLS with named partners.

Standards and references

Related NHI Mgmt Group resources: Email Identity and BEC Guide · SaaS and OAuth App Governance Guide · Passwordless and Passkeys Guide · API Key Management Guide · Deepfake and AI Impersonation Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Written and reviewed by Lalit Choda, NHI Mgmt Group. Last updated 16 October 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org