Mailpit
Capture test emails in a web inbox with an API.
- testing
Run it
briq run mailpitbriq_run({ recipe: "mailpit", wait: true })curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipe": "mailpit",
"wait": true
}'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "SMTP_HOST": "…" }, … }
# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
-H "Authorization: Bearer $BRIQ_API_KEY"stack: app
services:
mailpit:
recipe: mailpit
# its defaults, each a field you can set:
# image: axllent/mailpit:latest
# size: nanoFields
| Name | Type | Options | Default |
|---|---|---|---|
| image | string | — | "axllent/mailpit:latest" |
| env | record | { key: string | { secret, value?, literal?, scope?, hosts?, locations? } } | {} |
| cmd | string | string[] | — | — |
| size | enum | nano, small | "nano" |
| files | record | { key: string | { base64 } } | — |
| egress | object | { hosts } | — |
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
| Briq | Image | Ports | Size | Volume |
|---|---|---|---|---|
| mailpit | axllent/mailpit:latest | 1025, 8025 | nano | — |
When to use it
- Your tests must assert on the emails your app sends: recipients, subject, body, attachments.
- You want to see what a flow sends without sending anything real.
Point the app at SMTP_HOST/SMTP_PORT (no auth, no TLS).
Tips
- Assert through the API at
MAILPIT_API: search with/api/v1/search?query=to:alice@example.com, read one message at/api/v1/message/<id>. - Clear between tests:
DELETEonMAILPIT_API. - Inbox for a human:
briq_run({ recipe: "mailpit", expose: "private" }).