Email is one of the most critical user flows in any product — yet it’s routinely tested with fake SMTP servers that bear almost no resemblance to real delivery infrastructure. Welcome to MailFork: an email testing platform built on actual email infrastructure, not a simulation of it.
The problem with mocked email
When you use a mock SMTP library in your tests, you’re essentially asserting: “a function was called with these arguments.” That’s useful for unit tests. For end-to-end coverage of an email flow — password resets, magic links, onboarding sequences, order confirmations — it falls short.
Mocked email can’t tell you:
- Whether your MIME structure renders correctly in real clients
- Whether your DKIM signature survives the round trip
- Whether attachments are encoded and named correctly
- Whether your HTML/plain-text multipart structure is well-formed
These are exactly the things that break in production and never break in mocks.
What MailFork does differently
MailFork gives your tests a real inbox with a real email address — [email protected] — that accepts actual SMTP delivery. Your app sends email to that address the same way it sends to any user. Haraka accepts it, parses it, stores it, and makes it available via API within seconds.
Your test then:
- Triggers the email flow (e.g. calls
/auth/forgot-password) - Polls the MailFork API for the email to arrive
- Extracts the magic link from the parsed body
- Follows the link to complete the flow
No mocking. No stubbing. The same code path that sends email to your users sends email to your test inbox.
Inboxes, aliases, and CI isolation
For CI pipelines, ephemeral aliases keep test runs from colliding:
const alias = await mf.inboxes.createAlias({
inbox: '[email protected]',
ttlHours: 1,
onExpire: 'delete',
});
// alias.address is unique per run — no cross-contamination
Each alias is a unique tagged address on a shared inbox. When the TTL expires, the alias and its emails are cleaned up automatically.
What’s next
MailFork is in early access. We’re focused on making inbound email testing as frictionless as possible for teams running CI on GitHub Actions, GitLab CI, and CircleCI. Read the Quick Start guide to get your first test inbox in under five minutes.