Use this when filtering mail for spam, phishing, malware and data leaks at the gateway.
Mail Gateway
A mail gateway (secure email gateway) filters inbound and outbound mail for spam, phishing, malware and data leaks, with sandboxing, URL rewriting and policy enforcement before mail reaches users.
1. A mail gateway (SEG/cloud) filters inbound/outbound mail.
2. Attachment sandboxing, URL rewriting, DLP.
3. Integrated cloud mail protections.
4. Avoid bypass routes to the mail server.
5. Monitor queues.
internet → gateway → mail platform
Context & applicabilityCommon mistakes · platform/version boundaries
- Mail server still accepts direct connections from the internet, bypassing the gateway.
- Gateway allow lists that trust spoofable sender addresses.
- Outbound mail not routed through the gateway, so DLP and signing are skipped.
- DKIM signing done before the gateway modifies the message (adds banners), breaking signatures.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Sandboxing catches unknown attachments.
- URL rewriting protects at click time.
- Outbound filtering catches compromised accounts.
- Gateway health and queue — status
- Policies: attachments, URLs, sandbox — protection
swaks --to <user> --attach-type application/zip --server <gw>— test policy (lab)
ReferenceWhy it matters1 section · depth on demand
Gateway functions
Inbound: spam/phishing filtering, malware and sandbox analysis, URL rewriting with time-of-click checks, impersonation detection. Outbound: DLP, encryption, rate limits. Deployment: MX points to the gateway (cloud SEG) or API-based integration with Microsoft 365/Google (ICES). When using an MX gateway, lock the mail server to accept mail only from the gateway, or attackers bypass it.
ReferenceImportant terms & boundaries2 sections · depth on demand
Deployment
- Cloud gateways (Microsoft Defender for Office 365, Proofpoint, Mimecast) change MX records to the gateway.
- Lock down the mail server to accept only from the gateway, or attackers bypass it by sending directly.
- Configure enhanced filtering / skip listing when the gateway sits in front of Microsoft 365, so SPF/DMARC checks use the real sender IP.
In depth
A mail gateway (secure email gateway or cloud email security service) filters inbound and outbound email: spam, malware, phishing, impersonation, DLP and encryption. It may sit in front of the mail system as the MX record, or integrate via APIs with Microsoft 365 or Google Workspace.
| Deployment | Characteristics |
|---|---|
| MX-based gateway | All mail flows through it; can block before delivery |
| API-based (integrated cloud email security) | Scans inside the mailbox; can remove messages after delivery |
| Native (Defender for Office 365, Gmail) | Built-in, tightly integrated |
When using an MX gateway in front of a cloud mailbox, lock the mailbox to accept mail only from the gateway (connector restrictions), or attackers can bypass filtering by delivering directly.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Email Security → Mail Gateway. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7489 · confidence 94%