Facteur and Mailpit
Mailpit is software you run yourself. Here is what it publishes, then what Facteur does, which is a hosted service.
What Mailpit publishes
Each line is something Mailpit publishes. It carries the address of the page where we read it and the date we read it. What we could not check is not here. These pages change: read the source again before you decide.
-
01
Mailpit is published under the MIT license.
-
02
Mailpit acts as an SMTP server, offers a web interface to view intercepted emails and a REST API for integration testing.
-
03
Mailpit runs from a single static binary or multi-architecture Docker images.
-
04
By default, the web interface listens on port 8025 and the SMTP server on port 1025.
-
05
Mailpit also offers POP3, a spam check using a SpamAssassin server, SMTP relaying of messages and a "Chaos" feature that simulates SMTP errors.
-
06
Its repository says Mailpit was originally inspired by MailHog, which is no longer maintained.
-
07
Mailpit's API specification lists messages with GET /api/v1/messages, whose response carries a messages array, and searches them with GET /api/v1/search and the query parameter. A message summary carries fields such as ID, Subject, To, From, Created and Snippet.
https://github.com/axllent/mailpit/blob/develop/server/ui/api/v1/swagger.json ·
The same test, with one then the other
There is no library to translate: Mailpit is queried over HTTP, like Facteur. What changes is not the shape of the call. There is no service to run next to your tests any more, and no code to extract from the message.
// Mailpit runs next to the tests: SMTP on port 1025,
// web interface and API on port 8025.
const response = await fetch('http://localhost:8025/api/v1/messages');
const { messages } = await response.json();
// The code is still to be found in Snippet, or in the full message.
// No Facteur package to install: one HTTP call that waits.
const search = new URLSearchParams({
inbox: 'j3k9x2mq',
sentTo: address,
wait: '30000',
});
const response = await fetch('https://api.facteur.eu/v1/messages?' + search, {
headers: { authorization: 'Bearer ' + process.env.FACTEUR_API_KEY },
});
const { messages } = await response.json();
// The code is already extracted, in a field of its own.
const code = messages[0].otp;
Four steps, both services side by side
-
Step 01
Create an account and an inbox
The inbox is hosted and its addresses can be reached from outside: an identity provider or a partner can write to it, not only your code.
-
Step 02
Take the service out of the pipeline
The container, its ports and its readiness wait leave the continuous integration. There is nothing to start before the tests any more.
-
Step 03
Replace the HTTP call
Reading /api/v1/messages and sorting the array become a Facteur search, which waits for the right message and returns the code already extracted.
-
Step 04
Keep Mailpit locally, if you like
Many teams keep Mailpit on the development machine and only move the continuous integration: the two uses do not get in each other's way.
What changes, row by row
Each cell about Mailpit links to the sentence of the sources it comes from. A row that no source lets us write is not in the table.
| Topic | Facteur | Mailpit |
|---|---|---|
| To run | Nothing: a service hosted at OVHcloud. | A static binary or a Docker image, to run yourself. source |
| Reception | Any address of the inbox's domain, reachable from any mail server. | SMTP on port 1025, interface and API on port 8025, by default. source |
| Reading a message | GET /v1/messages, which waits for the message five minutes at most. | GET /api/v1/messages to list, GET /api/v1/search to search. source |
| Cost of the software | A subscription, with a free plan: the Pricing page gives the prices. | MIT license. source |
| Extra features | No POP3, no spam score, no SMTP relay. | POP3, SpamAssassin spam score, SMTP relay and simulated SMTP errors. source |
What a free tool costs
Mailpit costs nothing to install. Its cost is elsewhere: the machine that runs it, its monitoring, its upgrades, and the time of the person who looks after it the day it goes down while the pipeline waits.
What Facteur does
These lines describe Facteur as its product pages and help centre give it.
One address per test
Everything before the at sign is free. Two tests writing to inscription+run-42 and inscription+run-43 each get their own message, in the same inbox.
Wait for the message in one request
The search accepts a wait of five minutes at most. If nothing arrives, it answers an empty list, not an error.
The code, already extracted
The otp field holds the most likely one-time code. When nothing announces it, Facteur leaves it empty rather than guess.
Reading costs nothing
Only a received, kept message counts against your plan. A test that receives 3 emails and reads them 40 times uses 3.
Deleted when its time is up
Each message is deleted when your plan's duration has passed, with its raw file and attachments.
Hosted at OVHcloud
The application and its database are hosted at OVHcloud, and billing is in euros. The data centre is in France.
SMS are not received yet
The connection to the carrier that delivers SMS is not in service. An assigned number receives no real SMS today.
Frequently asked questions
When to look at Mailpit?
Mailpit is run by yourself, from a binary or a Docker image, under the MIT license. If you want a local tool with no hosted service, that is its ground. Facteur is a hosted service: you install nothing, and your test emails arrive at Facteur.
What needs to change in the tests to migrate?
Little: the call to /api/v1/messages becomes Facteur's search, the code extraction goes away, and the container leaves the pipeline.
Can I use both?
Yes. Keep Mailpit on your machine to work offline, and use Facteur in your pipelines, where several runs share the same inboxes and mail comes from outside.
Where are Facteur's prices?
On the Pricing page, which reads Facteur's grid. No Facteur price is written here.
The other tools
The same approach for each tool: what it publishes, sourced and dated, then what Facteur does.
Facteur and Mailisk
What Mailisk publishes about its namespaces, its SMS and its free plan, and what Facteur does.
Facteur and Mailtrap
What Mailtrap publishes about its email sandbox, HTML previews and plans, and what Facteur does.
Facteur and MailSlurp
What MailSlurp publishes about its plans, inboxes and phone numbers, and what Facteur does.
Facteur and Mailosaur
What Mailosaur publishes about its plans, its daily limit, its SMS and its API, and what Facteur does.
Migrate from Mailosaur
The mapping of the API calls, one by one, and the ones that have no equivalent at Facteur.
Try Facteur without an account
The trial receives a test email, with no sign-up. Prices are on the Pricing page.