1. 4SO
  2. Products
  3. Mail Gateway

Self-hosted mail platform

4SO Mail Gateway

High-volume sending, protected receiving and multi-tenant operations in one product.

An independent Mail Platform for teams that want to run Outbound Delivery, Inbound Protection, Domain Identity, Queue, Deliverability, lifecycle and Observability as one product.

  • Outbound Delivery
  • Inbound Protection
  • Multi-tenant
  • Self-hosted
4SO Mail Gateway flow: Accept mail, Inspect and classify, Queue and route, Deliver reliably, Observe and optimize.
Who it is for
Organizations and providers that run high-volume outbound mail and protected inbound mail for many domains or tenants.
What it does
Outbound delivery on KumoMTA, inbound protection with Rspamd and ClamAV, domain identity and DKIM, queue and deliverability, and separate human approval for sensitive access changes.
Where it runs
Self-contained on Linux or virtual machines. The mail spool stays on the node, and the sending and receiving path depends on neither Kubernetes nor an AI model.
INBOUND · DELIVER / QUARANTINE / REJECTEvery inbound message reaches an explicit outcome
01

A message arrives from the internet at the SMTP receive layer.

01Problem

Enterprise email is more than sending and receiving messages.

Delivery, Reputation, DKIM, Queue, Inbound Security, Quarantine, Feedback and recovery each have their own failure modes. Mail Gateway brings these components into one coherent operating model.

  1. 01

    Deliverability is a process

    Routing, Shaping, Suppression, Warm-up and Feedback have to be seen together.

  2. 02

    Receiving needs layered defense

    Authentication, Anti-spam, Anti-malware, Quarantine and Backend policy form a single chain.

  3. 03

    Domains and tenants have operational boundaries

    Sender authorization, access and sensitive changes are executed within the correct domain.

  4. 04

    Nodes and the Control Plane have a lifecycle too

    Provisioning, Drain, Switchover, Upgrade, Backup and recovery are part of the product itself.

02Capabilities

Outbound and Inbound on one platform, with clear boundaries.

Mail Gateway runs the sending, receiving and operations paths with a shared access model and shared observability.

  1. 01

    High-volume sending

    Authenticated submission, routing, queue and delivery from the Mail Data Plane.

  2. 02

    Domain identity and DKIM

    Domain authorization and the lifecycle of the sending signature.

  3. 03

    Reputation and Suppression

    Bounce, Complaint, Suppression and Warm-up management to protect Deliverability.

  4. 04

    SPF / DKIM / DMARC / ARC

    Authentication and evaluation of inbound messages on the Receiver path.

  5. 05

    Anti-spam / Anti-malware

    A protection chain that runs before delivery to the Backend or Quarantine.

  6. 06

    Quarantine workflow

    Hold, Release, Delete and Expiry with controlled access.

  7. 07

    Queue and Delivery Visibility

    Health, Routing, TLS, Queue and Deliverability in a single operational view.

  8. 08

    Backup, PITR and recovery

    Control Plane and mail-node lifecycle with defined recovery paths.

4SO

The Mail Data Plane does not depend on an LLM to send or receive mail; the mail-serving path is deterministic.

03Deployment model

The Control Plane and mail nodes scale independently.

The product starts from a simple Control Plane and can grow into an HA Control Plane with multiple Mail Nodes for Outbound and Inbound roles; the Manager never enters the Mail Data Plane.

ProfileControl PlaneMail Data PlaneUse case
Single ManagerOne ManagerOne or more Mail NodesSimple deployment and central management
Distributed Mail NodesCentral Control PlaneSeparate nodes for Outbound / InboundSeparation of capacity and Data Plane roles
HA Control PlaneMultiple ManagersIndependent Mail Node PoolManagement redundancy without the Manager entering the Mail Data Plane
Recovery-readyControl Plane + Backup/PITRRebuildable node lifecycleControlled recovery after failure
04Lifecycle

The mail lifecycle runs from onboarding to recovery.

Domain and node provisioning is only the start; Deliverability, Protection, Queue, Rotation and recovery are all core product operations.

  1. 01Pre-checkPreflight
  2. 02ProvisioningProvision
  3. 03Domain and identityAuthorize
  4. 04SendingDeliver
  5. 05Receiving and protectionProtect
  6. 06MonitoringObserve
  7. 07Upgrade and rollbackUpgrade / Rollback
05Profiles

Every mail path has its own tools and policy.

Instead of a one-dimensional Mail Server, the product coordinates several specialized workflows under one Control Plane.

  • Outbound Sender

    High-volume sending path with Queue and Routing.

    • Submission / HTTP injection
    • DKIM and Sender authorization
    • Routing / Shaping / Pools
  • Inbound Protect

    Public receiving with Authentication and Protection.

    • SPF / DKIM / DMARC / ARC
    • Anti-spam / Anti-malware
    • Backend delivery / Quarantine
  • Deliverability

    Control over sending behavior and feedback.

    • Suppression
    • Warm-up / Safety policy
    • Bounce / FBL / OOB feedback
  • Tenant Operations

    Domains, access and domain-scoped operations.

    • Tenant / Domain boundaries
    • Role-based actions
    • Audit / approval workflows
  • Mail Node Lifecycle

    Nodes are manageable resources too.

    • Provisioning / Trust
    • Drain / Fence / Switchover
    • Health / recovery
  • Control Plane Recovery

    Service management has its own Backup and recovery path as well.

    • Backup / Restore
    • PITR
    • Upgrade / rollback
Technical reference

Architecture, workflows and operations in detail

For engineers who want to know how the product works underneath: components, boundaries, failure behavior and the operations it runs.

06Architecture

The Control Plane decides; the Data Plane moves the mail.

Identity, Authorization, Tenant state and lifecycle live in the Control Plane; SMTP, Queue and Protection run on the mail nodes.

  1. EXPERIENCE
    Admin / Customer UI & APIDomain, Campaign, Routing, Inbound policy and operator actions.
  2. CONTROL
    Mail Control PlanePostgreSQL, Identity, Authorization and Secret workflows.
  3. OPERATIONS
    Durable OperationsProvisioning, Approval, Activation, Rollback and recovery.
  4. DATA PLANE
    Mail NodesKumoMTA/SMTP, Queue, Receiver, Protection and the Delivery runtime.
PlaneComponentResponsibilityOperational boundary
ControlPostgreSQL + Product Authorization / Keycloak IdentityTenant, Domain, policy, IAM, durable jobs and auditMail delivery does not depend on a live Control Plane for normal serving
OutboundKumoMTASMTP submission, queue/spool, routing, shaping and Internet deliveryNode-local spool; there is no shared spool
TransportHAProxyStable internal transport and selected HA endpointsThe proxy does not take over product ownership or queue semantics
Inbound ProtectionRspamd + ClamAVSpam/policy evaluation and malware scanningThe protection chain runs before backend/quarantine
DNS / Runtime StateUnbound + ValkeyProduct-controlled resolver path and shared runtime authority where neededResolver path and runtime state stay under product control
RuntimeLinux / VM Mail NodesKumoMTA, SMTP, sending IPs, DKIM and the queue data planeKubernetes is not a prerequisite for the Mail Data Plane
TECH

Control-plane Security Contract. Mail Gateway keeps Identity, Authorization and the Secret lifecycle separate from the Mail Data Plane, and binds high-risk mutations to a durable job and human approval.

DomainComponent / AuthorityTechnical contract
Control APIRust Control API + PostgreSQLTenant/Domain/Policy/Job/Audit state persists in the Product database.
IdentityKeycloakThe OIDC subject carries the user identity; browser or MCP credentials never stand in for the user identity.
AuthorizationOpenFGA + Product permission modelUnknown actions/routes fail closed, and permission is evaluated in resource scope.
SecretsOpenBaoSecret material and the recovery workflow are kept separate from ordinary configuration and UI state.
High-risk IAMDurable PostgreSQL JobRequest, human approval, execute-time reauthorization and authoritative post-check are separate steps.
MCPDelegated OIDC + scoped product toolsMCP can pass requests/diagnostics through product authority; it has no self-approval or generic Admin API.
ObservabilityPrometheus + Grafana + product probesQueue, TLS, routing and deliverability are shown from real telemetry; missing data is never presented as fabricated health.
07Workflows and failure

The panel, the API and AI agents all go through the same controlled workflow.

For administrative operations, the Plan and the impact of a change are visible before execution, and high-risk approval is kept separate from execution.

  1. 01DiscoverLIST ACTIONS
  2. 02PlanCREATE PLAN
  3. 03ImpactPRECONDITIONS
  4. 04ApproveHUMAN APPROVAL
  5. 05ExecuteDURABLE JOB
  6. 06VerifyPOST-CHECK
OUTBOUND FEEDBACK LOOP

Queue → Delivery → Feedback

Delivery is not the final outcome; bounces and telemetry feed back into policy.

SUBMISSION
→
QUEUE /
SPOOL
↓
POLICY
LOOP
↑
INTERNET
DELIVERY
←
BOUNCE /
TELEMETRY
routing · shaping · DKIM · delivery feedback
Node-local spool is not lost when the Control Plane goes down.
INBOUND BRANCH

Deliver / Quarantine / Reject

Inbound mail reaches an explicit outcome after auth and content gates.

SMTP RECEIVE
↓
SPF · DKIM · DMARC
↓
RSPAMD + CLAMAV
↓
DELIVER
QUARANTINE
REJECT
A protection failure is never bypassed; it goes to a policy-defined outcome.
APPROVAL GATE

High-risk IAM with Human Approval

Plan, Approval and execute-time reauthorization are kept separate.

PLAN + IMPACT
↓
HUMAN
APPROVAL
↓
REAUTHORIZE
↓
KEYCLOAK WRITE
authoritative post-check closes the durable job
MCP or an agent is not allowed to self-approve or perform generic admin mutations.
  1. Flow 01

    Domain Onboarding

    A domain follows one workflow from ownership to delivery readiness.

    1. Tenant / Domain
    2. Ownership
    3. DKIM
    4. DNS Readiness
    5. Routing Policy
    6. Activate

    Failure and recoveryIncomplete validation or DNS readiness stops activation.

  2. Flow 02

    Outbound Delivery

    Queue/spool is part of an independent Data Plane.

    1. Submission
    2. Policy
    3. Queue / Spool
    4. Routing / Shaping
    5. DKIM Sign
    6. Internet Delivery

    Failure and recoveryNode-local spool is preserved; a Control Plane failure does not erase the queue.

  3. Flow 03

    Inbound Protection

    Inbound messages pass through several gates.

    1. SMTP Receive
    2. SPF / DKIM / DMARC
    3. Rspamd
    4. ClamAV
    5. Route / Quarantine
    6. Delivery

    Failure and recoveryA protection failure sends the message to a policy-defined outcome, not a bypass.

  4. Flow 04

    DKIM Rotation

    Rotation runs with a secret boundary and a post-check.

    1. Rotate Request
    2. Authorization
    3. Key Material
    4. DNS Stage
    5. Signer Switch
    6. Verify

    Failure and recoveryOld/new overlap and rollback stay within the owner workflow.

  5. Flow 05

    High-risk IAM

    Approval is separate from execution.

    1. Plan
    2. Impact
    3. Human Approval
    4. Reauthorize
    5. Keycloak Write
    6. Authoritative Post-check

    Failure and recoveryExpired or revoked authorization is rejected at execution time.

  6. Flow 06

    Mail Node Lifecycle

    Node mutation takes spool and service role into account.

    1. Preflight
    2. Provision / Drain
    3. Fence
    4. Service Mutation
    5. Queue Check
    6. Runtime Verify

    Failure and recoveryA switchover is declared successful only after Queue Check and Runtime Verify.

Additional operational flows

Queue incidents and Routing/Shaping are independent, high-risk Day‑2 changes.

  1. Flow 07

    Queue Incident Recovery

    A backlog or delivery incident is investigated while preserving the truth of the node-local spool.

    1. Detect Backlog
    2. Scope Tenant / Route
    3. Inspect Spool
    4. Freeze Risky Change
    5. Typed Queue Action
    6. Delivery Post-check
    7. Unfreeze / Record

    Failure and recoveryQueue state is never blindly replayed or purged; that node’s spool and the operation history are the basis for recovery.

  2. Flow 08

    Routing / Shaping Change

    Delivery policy goes through Impact and Telemetry before and after it is applied.

    1. Plan Provider / Domain
    2. Impact Preview
    3. Authorize
    4. Persist Policy
    5. KumoMTA Apply
    6. Observe Queue / TLS
    7. Delivery Verify

    Failure and recoveryA failed post-check keeps the change in a Failed/Reconcile state; changes outside Product Authority are not allowed.

Action / FlowAdmission / PreconditionsExecution / LockSuccess CriterionFailure / Recovery
Domain OnboardingValid Tenant/Domain ownership, authorization and policy inputTyped owner action; config/runtime mutation goes through the Control APIDomain/DKIM/routing readiness from Product state and runtime read-backValidation failure before activation; partial state is tracked through workflow recovery
DKIM RotationDomain scope, signer identity and rotation preconditionsDurable mutation with audit and bounded secret handlingActive key/signing state and DNS-facing readiness are verifiedOld/new key overlap and rollback are owner-specific; secret material is never shown in MCP/UI
Queue / Delivery ActionExact tenant/queue/message scope and permissionTyped queue action; there is no shell/raw SQL/direct Kumo admin proxyQueue/history post-check shows the result of that same actionAn unknown outcome requires read-back; replay follows the owner’s idempotency semantics
Routing / Shaping / SuppressionProvider/domain/resource scope + risk/permission contractRegistry-backed action with Product policy authorityEffective route/pool/suppression state is read back after the mutationUnknown action fails closed; historical risk downgrade is not allowed
IAM User LifecycleDelegated OIDC subject and Product authorization; high-risk impact previewRequest → independent human approval → execute-time reauthorization → Keycloak WriterAuthoritative Keycloak post-check confirms enabled/session/group stateMCP has no approve/execute bypass; stale/revoked authorization is rejected again at execute time
Mail Node LifecyclePinned target/release identity, preflight and runtime readinessProvision/Drain/Fence/Switchover tied to durable lifecycle/evidenceNode role, queue/spool and service health are verified from runtimeNode-local spool is assumed; a switchover failure is never hidden behind an assumed shared spool or fabricated success
FLOW

The Management MCP lifecycle is explicitly list actions → create plan → inspect impact/preconditions → human approval → execute → post-check. An agent cannot approve its own proposal and has no general-purpose shell, raw SQL, filesystem or secret-export tool.

08Operations catalog

From Domain to Queue and recovery, operations in one Workbench.

Operators should be able to see sending and receiving status and take the necessary action without switching between separate tools.

  • Domain OnboardingDomain registration, identity verification and sending/receiving Policy.
  • DKIM LifecycleCreation, activation and Rotation of the domain signing identity.
  • Queue OperationsVisibility and actions on the Queue and History.
  • Routing & ShapingRoute, Pool and limit selection matched to each Provider.
  • QuarantineReview, Release, Delete and Expiry of held messages.
  • SuppressionManagement of invalid or high-risk recipients and Feedback.
  • Node LifecycleProvisioning, Drain, Fence and Switchover of Mail Nodes.
  • Backup / RecoveryProtection and recovery of the Control Plane and operational state.

Run email as a critical data plane.

4SO Mail Gateway brings sending, receiving and operations together in one self-hosted, traceable product.