briqbriq
Dashboard

cookbook / mailpit

Mailpit

Catches outgoing email for tests, with a web inbox and a JSON API.

Run it

briq_run({
  recipe: "mailpit",
  params: {
    "size": "nano"
  },
  wait: true
})

Parameters

NameTypeOptionsDefault
sizeenumnano, small"nano"

Outputs

Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

SMTP_HOST
mailpit.<stack>.internal
SMTP_PORT
1025
SMTP_URL
smtp://mailpit.<stack>.internal:1025
MAILPIT_UI
http://mailpit.<stack>.internal:8025
MAILPIT_API
http://mailpit.<stack>.internal:8025/api/v1/messages

What it runs

BriqImagePortsSizeVolume
mailpitaxllent/mailpit:latest1025, 8025nano

When to use it

  • Your application sends email and the test suite must assert on what was sent: recipients, subject, HTML body, attachments.
  • You want to see the emails a flow produces without sending anything real.

Point the application at SMTP_HOST/SMTP_PORT (no auth, no TLS). Every message lands in the inbox and is readable through the JSON API.

Tips

  • Assert through the API. briq_exec with wget -qO- "$MAILPIT_API?query=to:alice@example.com" returns JSON; or read a message body at /api/v1/message/<id>.
  • Clear between tests with a DELETE on /api/v1/messages.
  • Show it to a human. briq_expose port 8025 with mode: "token" gives a browsable inbox.
  • It is tiny. nano is the default size and enough for thousands of messages.