Design Email Security Gateway

Hard45 min
1 / 30
understanding7 min read

Problem Statement and Email Gateway Placement

Problem Statement and Email Gateway Placement — email security gateway system design section.

Problem Statement and Email Gateway Placement

SMTP sessions arrive at regional MTA pools. Each message is normalized to a canonical envelope (headers, MIME tree hash, attachment manifest). Cheap checks run first: RBL, SPF/DKIM/DMARC alignment, known-good allowlists. Suspicious MIME branches to sandbox queues; URL links are rewritten for time-of-click analysis.

Design anchors (1)

  • MX records point to your gateway cluster before mail reaches Google Workspace or Exchange.
  • Separate inbound inspection (spam, phishing, malware) from outbound DLP (data loss, encryption policy).
  • Quarantine is a first-class workflow—users and SOC must release with audit, not shadow-delete.

Failure drills

If AV engine farm is degraded, degrade to single-engine scan with longer queue delay—never pass unscanned executables. If DMARC strict policy blocks legitimate forwarders, route to admin review bucket with 72h TTL. If click-time proxy is down, strip rewrite and block external links in HTML bodies for high-risk tenants.

Cost and capacity

At 8M messages/day inbound, CPU is dominated by MIME recursion and sandbox VM minutes—not SMTP handshake.

SignalTarget
Peak msg/s120 /s
Avg size85 KB
Quarantine2.1 %
FP budget0.05 %
javaOne Dark Pro
1public record MailVerdict(String tenantId, String policyVersion, String disposition, int ruleId) {
2 public boolean requiresQuarantine() { return "quarantine".equals(disposition); }
3}
pythonOne Dark Pro
1def dmarc_aligned(spf: str, dkim: str, policy: str) -> bool:
2 return spf == "pass" and dkim == "pass" and policy != "reject"
typescriptOne Dark Pro
1export interface NormalizedEnvelope {
2 messageId: string;
3 fromDomain: string;
4 mimeParts: number;
5}
6export function cacheKey(tenantId: string, env: NormalizedEnvelope): string {
7 return `${tenantId}:${env.messageId}:${env.mimeParts}`;
8}

Why interviewers care

Email Security Gateway interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement and Email Gateway Placement that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • MX records point to your gateway cluster before mail reaches Google Workspace or
  • Metrics: Peak msg/s, Avg size, Quarantine, FP budget
  • Separate **inbound inspection** (spam, phishing, malware) fr
Interview tip
When discussing Problem Statement and Email Gateway Placement, quantify message volume, quarantine rate, and false-positive budget before naming vendors.
Avoid
Do not claim ingress replaces mailbox security or SIEM correlation—state layered defense.

Section Rescue Kit

Buzzwords to use:

MX ingressDMARC

Safe statements:

  • "SMTP 250 means queued—not clean—for ingress paths."
  • "I never bypass sandbox for executable attachments without recorded risk acceptance."
  • "Quarantine release is MFA-gated, idempotent, and append-only in the ledger."
Design Email Security Gateway - System Design | WinJob | WinJob