Skip to content
Skills Library
Programming · Testing

mailsim

/mailsim

Catch, read and assert on the emails the LangWatch stack sends, using mailsim, haven's local mail sink. Use when someone says 'haven mail', 'did the email send', 'where is the verification mail', 'invite link', 'wait for the email', 'mailsim', 'the mail sink', 'haven sim mail', 'test the reset email', or needs to load-test SMTP.

Repository
langwatch ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Catch, read and assert on the emails the LangWatch stack sends, using mailsim, haven's local mail sink. Use when someone says 'haven mail', 'did the email send', 'where is the verification mail', 'invite link', 'wait for the email', 'mailsim', 'the mail sink', 'haven sim mail', 'test the reset email', or needs to load-test SMTP.

Triggers from the description

s local mail sink. Use when someone saysdid the email sendwhere is the verification mailinvite linkwait for the emailmailsimthe mail sinkhaven sim mail
Original author description

Catch, read and assert on the emails the LangWatch stack sends, using mailsim, haven's local mail sink. Use when someone says 'haven mail', 'did the email send', 'where is the verification mail', 'invite link', 'wait for the email', 'mailsim', 'the mail sink', 'haven sim mail', 'test the reset email', or needs to load-test SMTP.

How it works

  1. Run it
  2. Inspect and assert (HTTP)
  3. Seed and reset
  4. Tests and load
  5. From a terminal or agent
Original SKILL.md headings · 54 lines, 351 words
SKILL.md preview
---
name: mailsim
description: "Catch, read and assert on the emails the LangWatch stack sends, using mailsim, haven's local mail sink. Use when someone says 'haven mail', 'did the email send', 'where is the verification mail', 'invite link', 'wait for the email', 'mailsim', 'the mail sink', 'haven sim mail', 'test the reset email', or needs to load-test SMTP."
user-invocable: true
---

# mailsim

A local SMTP sink plus inbox. It catches every message the stack sends and relays
nothing, whatever the recipient domain. Code: `services/sims/mailsim`, console
`apps/sims/src/mail`.

## Run it

- On by default in haven (`haven up`; `-mail` turns it off). Runs in the `go` lane by default (see `sims`).
- URL: `https://mail.<slug>.langwatch.localhost` (console); `haven status` shows the
  loopback HTTP port (`MAILSIM_HTTP_ADDR`) and the SMTP port (`MAILSIM_SMTP_ADDR`).
- The app's own mail is routed at it (`SMTP_HOST=127.0.0.1`) unless `.env` names a provider.
- No mail provider at all (even one `.env` names): `haven up --no-mail --force` blanks every mail setting for that run; `haven up --force` restores it. It restarts the stack.
- Standalone: `make service svc=mailsim` (HTTP :5580, SMTP :5581).

## Inspect and assert (HTTP)

```
GET    /api/messages?to=&subject=            newest first; case-insensitive substring filters
GET    /api/messages/{id}    /{id}/html      one message: text, html, headers, links
GET    /api/messages/wait?to=&subject=&after=<id>&timeout=30s
                                             long poll; 200 message, 204 on timeout
DELETE /api/messages   |   DELETE /api/messages/{id}
GET    /api/inbox                            stack, own address, SMTP address, persistence
GET|PUT /_sim/api/settings                   {"forcedError": 0|4xx|5xx}: SMTP MAIL FROM refused with that code
```

Test pattern: trigger the action, then `curl ".../api/messages/wait?to=a@x.test&subject=verify&timeout=20s"`
and read `links[0]`. Use `after=<newest id>` to ignore older mail.

## Seed and reset

- `MAILSIM_SEED=1` (haven sets it) delivers three sample messages at start.
- Reset with `DELETE /api/messages`. `MAILSIM_DATA_DIR` (haven sets it per slug) persists
  mail across restarts.

## Tests and load

- Send with any SMTP client to the SMTP port; no auth needed.
- Bounded: `MAILSIM_MAX_MESSAGES` (default 10000) keeps the newest and evicts the oldest;
  `MAILSIM_MAX_MESSAGE_BYTES` (default 10 MiB) caps one message. Id and recipient lookups
  are indexed. Benchmark: `go test -bench . -benchmem ./services/sims/mailsim`.

## From a terminal or agent

`--json` on every read (default in agent mode); non-zero exit on failure; a `wait` timeout exits 66.

```
haven sim mail address | status | list [--to] [--subject] | get <id> [--html] | links <id>
haven sim mail fault <4xx|5xx|off>               # SMTP sends refused with that reply code (4xx retry, 5xx permanent); off clears it
haven sim mail wait [--to] [--subject] [--after <id>] [--timeout 30s] | delete <id> | clear
```

Versions

The database has no other skills named mailsim.

Database snapshot: 13.11.2026 · package version aa1b9ed7af8f (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100mail-template
    Add or change one transactional email LangWatch sends — the props schema, the fixtures, the subject, the component on the shared expressive layout, the registry line, and the bound scenario. Covers the preview studio (pnpm --filter @langwatch/mail dev), why mail uses the…
  • 90sims
    Map of LangWatch's local simulators and how they run: llmsim, mailsim, storagesim, analyticssim, idpsim, voicesim, outboundsim, paymentsim, telemetrysim, lambdasim and mcpsim, the haven sim lane, the single Go mono-binary (`service combined`), the ADR-160 consoles and load runs.…
  • 100email-smtp-send
    Send emails through SMTP with optional local attachments and optional IMAP APPEND sync to Sent mailbox. Use when tasks need reliable outbound email delivery, attachment sending, SMTP connectivity checks, or cross-client sent-mail visibility (for example appending to "Sent Items" after SMTP send).
  • 100mailpit-testing
    Use for any question or task about testing email your code sends, including one password-reset or signup email and broken links in sent mail: capture messages in Mailpit's local SMTP server (port 1025), assert on subject, body and links through its REST API, test SMTP failures…
  • 100sending-emails
    Use when integrating, configuring, or troubleshooting Mailtrap live email sending (Email API or SMTP). Use when wiring outbound mail from an application or choosing how to send.
  • 100spring-mail
    Spring Mail for sending emails in Spring Boot 3.x. Covers JavaMailSender, SimpleMailMessage, MimeMessage, HTML emails, attachments, templates (Thymeleaf/FreeMarker), async sending, and testing. USE WHEN: user mentions "spring mail", "JavaMailSender", "email Spring Boot", "send…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.