Skip to content
Facteur
/ Comparison

Facteur and Mailpit

Mailpit is software you run yourself. Here is what it publishes, then what Facteur does, which is a hosted service.

Sources

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.

  1. 01

    Mailpit is published under the MIT license.

    https://github.com/axllent/mailpit ·

  2. 02

    Mailpit acts as an SMTP server, offers a web interface to view intercepted emails and a REST API for integration testing.

    https://mailpit.axllent.org/docs/ ·

  3. 03

    Mailpit runs from a single static binary or multi-architecture Docker images.

    https://mailpit.axllent.org/docs/ ·

  4. 04

    By default, the web interface listens on port 8025 and the SMTP server on port 1025.

    https://github.com/axllent/mailpit ·

  5. 05

    Mailpit also offers POP3, a spam check using a SpamAssassin server, SMTP relaying of messages and a "Chaos" feature that simulates SMTP errors.

    https://github.com/axllent/mailpit ·

  6. 06

    Its repository says Mailpit was originally inspired by MailHog, which is no longer maintained.

    https://github.com/axllent/mailpit ·

  7. 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 ·

Translating your tests

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.

Before, with Mailpit JavaScript
// 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.
Every call of Mailpit shown here comes from its documentation: the Sources section gives the page and the date it was read.
After, with Facteur TypeScript
// 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;
Facteur publishes no library yet: the test calls the API over HTTP. The developers' portal plays this call against the service.
The migration, step by step

Four steps, both services side by side

  1. 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.

  2. 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.

  3. 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.

  4. 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.

The switch, in short

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
The real cost

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.

Facteur

What Facteur does

These lines describe Facteur as its product pages and help centre give it.

01

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.

02

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.

03

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.

04

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.

05

Deleted when its time is up

Each message is deleted when your plan's duration has passed, with its raw file and attachments.

06

Hosted at OVHcloud

The application and its database are hosted at OVHcloud, and billing is in euros. The data centre is in France.

07

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.

Choosing

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.

Try Facteur without an account

The trial receives a test email, with no sign-up. Prices are on the Pricing page.