VaultSandbox: ZeroâTrust InâVPC Email Testing for ProductionâParity CI
VaultSandbox provides a zeroâtrust, inâVPC email testing platform that mirrors real SMTP, TLS, DNS, SPF/DKIM, and DMARC validation while keeping all customer data strictly inside your infrastructure. By swapping the recipient address, CI pipelines run against real email services with deterministic waits and no reliance on flaky mocks, eliminating blind spots that cause production failures. Deploy it with a single DockerâCompose file and benefit from instant ACME certificates, encrypted sandboxes, and enterpriseâgrade governance for as little as a public IP and the required ports.
VaultSandbox offers a productionâgrade email testing environment that runs entirely inside your VPC, yet exposes every authentication and transport check you face in live deployments.
---
## The Problem
*Mocks hide the exact email failures that break production*
In many projects the email client is mocked to keep CI fast and flaky tests minimal. The mock often skips critical transport validation â TLS negotiation, DNS MX lookup, and SPF/DKIM/DMARC signatures â and may even disable certificate checks (`rejectUnauthorized: false`). As a result, a build that passes in CI may bounce in production, or worse, leak customer data when sent to a public SaaS inbox.
Typical pitfalls:
- "Works on My Machine" shortcuts: fake SMTP that does not enforce TLS, MX records, or real DNS.
- Polling and `sleep()` constructs that produce flaky pipelines.
- Public cloud tools that expose test data to thirdâparty services.
- Authentication failures that surface only when real domains are used.
- Rendering differences between plainâtext viewers and modern HTML clients.
---
## The Solution â VaultSandbox
VaultSandbox removes blind spots by letting CI and QA run against a sandbox that behaves exactly like a real SMTP gateway. You keep your production provider (Postmark, SendGrid, SES, Resend, etc.) and simply change the recipient to a sandbox address. Email is sent over real TLS, the DNS stack is fully validated, and authentication checks (SPF, DKIM, DMARC, rDNS) are performed on every message.
Key benefits:
- **Zero risk to customer data** â encrypted inâmemory storage, no persistent logs.
- **True isolation** â inbound mail is hardâblocked once it leaves the container.
- **Deterministic CI** â no polling or `sleep()`, thanks to serverâside SSE and automatic cleanup.
- **Data sovereignty** â all traffic remains inside your VPC.
- **Complianceâready** â optional enterprise controls such as SSO, audit logs, and retention.
---
## Architecture Overview
### Prerequisites
- Public IP address.
- Ports 25, 80, 443 open to the Internet.
- Either a fullyâmanaged domain name with A and MX records pointing to the containerâs IP, or use the zeroâconfig `vsx.email` subdomain (your IP is encoded in the host). Subdomains are supported.
### AutoâProvisioning
- ACME (Letâs Encrypt) certificates for SMTP (STARTTLS) and HTTPS are generated automatically.
- DNS, SPF, DKIM, DMARC, and rDNS checks run on every injected email.
### Storage & Security
- Emails never reach disk; they are encrypted inâmemory on receipt.
- Private keys are generated locally and never leave the client.
- The server cannot decrypt email even if compromised â a true zeroâknowledge architecture.
---
## Use Cases
1. **Signup Flow Testing** â A tester creates a sandbox address, signs up, and verifies the confirmation email without exposing real credentials.
2. **PasswordâReset Integration** â CI triggers a real passwordâreset via Postmark, vaultsandbox receives and extracts the link, and the test âclicksâ it for an endâtoâend verification.
3. **DKIM/SPF Rotation Checks** â After rotating keys, a single test email is sent to the sandbox and validity is verified instantly.
4. **Rendering Tests** â HTML emails are parsed for MIME boundaries, attachments, and structural correctness before rendering.
---
## Deployment â OneâLine DockerâCompose
```yaml
services:
vaultsandbox:
image: vaultsandbox/gateway:latest
ports:
- "25:25"
- "80:80"
- "443:443"
environment:
VSB_VSX_DNS_ENABLED: 'true' # Autoâprovision TLS & Domain
volumes:
- vsb_data:/app/data
volumes:
vsb_data:
```
**Why this works** â The container binds to SMTP, HTTP, and HTTPS, autoâinstalls Letâs Encrypt certs, and exposes a simple HTTP API for inbox management.
---
## Roadmap
1. **Phase 1 â Core Foundation** â Complete API, SDKs (Java, .NET, Go, Python, Node), 100% test coverage, and full documentation.
2. **Phase 2 â Enterprise Control Plane** â SSO via OIDC/SAML, audit logs, data retention policies, and enterpriseâgrade deployment options.
3. **Phase 3 â Feature Extensions** â Rate limiting, inbound filtering, integration hooks, and optional hardâmode blocking.
---
## Frequently Asked Questions
- **Do I need a dedicated public IP?** Yes â ports 80, 443 for ACME, and 25 for inbound SMTP.
- **Is the core gateway free?** The AGPLv3 core is openâsource and has no limits. Only optional enterprise features (SSO, audit) come at a cost.
- **What about spam?** The SMTP server rejects nonâconfigured domains, validates RCPTâŻTO against existing inboxes, and enforces perâIP rate limits.
- **What happens on container restart?** Inâmemory emails are cleared; configuration, API keys, and certificates persist.
- **Can I use the REST API directly?** Absolutely; SDKs wrap the API and automate key generation and decryption.
---
## Get Started
Spin up VaultSandbox in minutes with Docker Compose, point your transactional email provider to a sandbox address, and run your CI pipeline against real SMTP. Stop guessing whether your emails will land â the only blind spot left is yourself.
---
**Stay in the loop** â Subscribe to our newsletter for product updates, security releases, and deep dives on building productionâgrade email testing inside your VPC.