Migration from Mailosaur / MailSlurp / Mailtrap

June 6, 2026 · View on GitHub

Brief mapping of MailAgent concepts ↔ classic email testing APIs.

Concepts

Other serviceMailAgent
Inbox / inbox idPOST /v1/inboxesid, address
Email addressaddress (*@your-inbox-domain)
Wait for emailGET /v1/inboxes/:id/wait or SDK waitForVerification
Get OTP / linksGET /v1/inboxes/:id/extract
List messagesGET /v1/inboxes/:id/messages
Delete inboxDELETE /v1/inboxes/:id
Tags / metadatalabel on create
Allowlist senderservice or expectFrom

Mailosaur

// Mailosaur
const serverId = "...";
const email = `anything@${serverId}.mailosaur.net`;
const msg = await mailosaur.messages.get(serverId, { sentTo: email });

// MailAgent
const inbox = await mail.createInbox({ label: "test-1", service: "auth0" });
// signup with inbox.address
const v = await mail.waitForVerification(inbox.id, { subjectContains: "verify" });
// v.otp, v.primaryLink

MailSlurp

// MailSlurp
const inbox = await inboxesApi.createInbox();
await waitController.waitForLatestEmail(inbox.id, 120_000);

// MailAgent
const { inboxId, verification } = await mail.open({
  label: "ci-1",
  subjectContains: "code",
  timeoutSeconds: 120,
});

Mailtrap (testing inbox)

Mailtrap is often used as SMTP sandbox — mail does not go out. MailAgent accepts real inbound via Resend on your domain. For CI without SMTP use npm run test:contract:qa (simulate in DB).

Playwright / Cypress

Mailosaur npmMailAgent
Installmailosaur@mailagent/qa
CI secretMAILOSAUR_API_KEYMAILAGENT_API_KEY
Parallel runsrandom addressmail.runLabel("ci") + cleanup

Migration checklist

  1. Replace env: MAILAGENT_API_URL, MAILAGENT_API_KEY
  2. Remove polling on third-party API → waitForVerification or open
  3. Set service for your staging From (QA-PRESETS.md)
  4. Add cleanup: cleanupRun(GITHUB_RUN_ID) or DELETE ?labelPrefix=
  5. On 429 check headers X-RateLimit-*, Retry-After

See QA.md, QA-ONBOARDING.md.