跳到正文
cccskills
免费在 GitHub 公开

mailpit-testing

The email-testing home: configures and runs Mailpit - modern dev-mailbox server for SMTP testing with built-in REST API for assertions; default SMTP `1025` + Web UI `8025`; Chaos mode (configurable SMTP errors for resilience testing), message tagging, search filters. Carries the end-to-end email-flow workflow (multipart body, link-rewrite resolution, unsubscribe per RFC 8058, bounce + complaint webhooks) in references/email-flows.md and the legacy MailHog capture patterns + migration path in references/mailhog-legacy.md. Use when developing or testing email-sending code locally / in CI - SMTP capture, full-flow assertions, or migrating an existing MailHog deployment.

中文简介正在准备中。当前显示原文说明。

testland/qa星标 13(GitHub 13 + cccskills 0)
集成工具Docker

实测评分 未实测

查看安装方法

包含的文件(15)

  • SKILL.md7.7 KB
  • .tessl-plugin/plugin.json807 B
  • evals/auditor-checklist-half-of-which-we-cannot-verify-here/criteria.json7.1 KB
  • evals/auditor-checklist-half-of-which-we-cannot-verify-here/task.md10.4 KB
  • evals/four-workers-wiping-each-others-inbox/criteria.json6.5 KB
  • evals/four-workers-wiping-each-others-inbox/task.md13.6 KB
  • evals/green-suite-while-reset-links-shipped-broken/criteria.json5.5 KB
  • evals/green-suite-while-reset-links-shipped-broken/task.md7.4 KB
  • evals/retry-queue-written-after-the-relay-outage/criteria.json5.2 KB
  • evals/retry-queue-written-after-the-relay-outage/task.md8.3 KB
  • evals/smtp-auth-typo-that-only-staging-caught/criteria.json5.0 KB
  • evals/smtp-auth-typo-that-only-staging-caught/task.md7.2 KB
  • references/email-flows.md7.9 KB
  • references/mailhog-legacy.md6.1 KB
  • references/migrating-to-mailpit.md1.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

mailpit-testing

Overview

Per mailpit.axllent.org/docs/:

"Mailpit is packed full of features for developers wanting to test SMTP and emails. It acts as an SMTP server, provides a modern web interface to view & test intercepted emails."

Per mp-docs the differentiated features:

  • "Chaos feature to enable configurable SMTP errors for testing application resilience."
  • "Message tagging, including manual tagging or automated tagging using filtering and 'plus addressing'."
  • "A REST API for integration testing"

Mailpit succeeded MailHog as the de facto OSS dev mailbox in the mid-2020s; new projects start with Mailpit by default.

When to use

  • The repo has email-sending code (transactional emails, password reset, notifications) that needs local + CI testing.
  • Tests assert on captured email content (subject, body, headers, attachments).
  • The team needs Chaos mode to test app resilience to SMTP errors (bounce, timeout, rate-limit).
  • The full email flow needs coverage beyond capture - headers, multipart body, links, unsubscribe, bounces - per references/email-flows.md.
  • Migrating from MailHog (Mailpit is API-compatible at the SMTP layer + has a richer REST API) - per references/mailhog-legacy.md.

Step 1 - Install

Per github.com/axllent/mailpit:

# macOS
brew install mailpit

# Docker (Linux, macOS, Windows, CI) - per the [mp-docker][mp-docker] image page
docker run -d --name=mailpit --restart unless-stopped -p 8025:8025 -p 1025:1025 axllent/mailpit

Docker is the recommended path for CI. mp-gh also documents a shell install script that writes to /usr/local/bin with sudo; prefer the image or a release binary so a test setup never pipes remote code into a root shell.

Step 2 - Start

Per mp-gh:

"The Mailpit web UI listens by default on http://0.0.0.0:8025 and the SMTP port on 0.0.0.0:1025."

Foreground:

mailpit
# Web UI: http://localhost:8025
# SMTP:   localhost:1025

As a background service on macOS:

brew services start mailpit

Discover all options:

mailpit -h

Step 3 - Configure your app's SMTP

Point the application's SMTP config at Mailpit:

# example: Rails action_mailer config
smtp_settings:
  address: localhost
  port: 1025
  domain: localhost
  authentication: nil   # Mailpit accepts unauthenticated SMTP by default

Equivalent envs work for Django (EMAIL_HOST=localhost, EMAIL_PORT=1025), Spring (spring.mail.host=localhost, spring.mail.port=1025), Node nodemailer, etc.

Step 4 - Assert via REST API

Per mp-docs Mailpit ships a "REST API for integration testing." The canonical endpoints (consult mp-docs for current paths per release) follow this shape:

import requests

BASE = "http://localhost:8025"

def test_password_reset_sends_email():
    # 1. Clear inbox before the test
    requests.delete(f"{BASE}/api/v1/messages")

    # 2. Trigger the email send
    trigger_password_reset("alice@example.com")

    # 3. Poll until the email lands (typical: <1s)
    msg = poll_for_message(BASE, to="alice@example.com", timeout=5)

    # 4. Assert
    assert msg["Subject"] == "Reset your password"
    assert "/reset?token=" in msg["Text"]
    assert msg["To"][0]["Address"] == "alice@example.com"
def poll_for_message(base, to, timeout):
    import time
    deadline = time.time() + timeout
    while time.time() < deadline:
        response = requests.get(f"{base}/api/v1/search", params={"query": f"to:{to}"})
        messages = response.json().get("messages", [])
        if messages:
            return requests.get(f"{base}/api/v1/message/{messages[0]['ID']}").json()
        time.sleep(0.1)
    raise AssertionError(f"No email to {to} within {timeout}s")

The exact endpoint paths may evolve - always check the live API schema at http://localhost:8025/api/v1/ (Mailpit ships an OpenAPI schema for self-introspection).

Step 5 - Chaos mode

Per mp-docs: "Chaos feature to enable configurable SMTP errors for testing application resilience."

Use cases for app-level resilience testing:

  • Verify retry-with-backoff works when SMTP returns 421 / 451
  • Verify dead-letter handling for permanent failures (5xx)
  • Verify rate-limit handling (server returns 421 4.7.0)

Per mp-docs, Chaos is configurable per-recipient or globally; consult the live docs for current Chaos API shape.

Step 6 - Tagging + plus-addressing

Per mp-docs: "automated tagging using filtering and 'plus addressing'."

Pattern for test-isolation: each test sends to alice+test-${test_id}@example.com; Mailpit auto-tags by the +test-... suffix; tests filter by tag to isolate their email batch from concurrent test runs:

import uuid
test_id = uuid.uuid4().hex[:8]
to_addr = f"alice+test-{test_id}@example.com"
trigger_email(to_addr)
msg = requests.get(
    f"{BASE}/api/v1/search",
    params={"query": f'tag:"test-{test_id}"'},
).json()["messages"][0]

Step 7 - CI integration

services:
  mailpit:
    image: axllent/mailpit:latest
    ports: [1025:1025, 8025:8025]

steps:
  - run: pytest tests/integration/email/ -v
    env:
      SMTP_HOST: localhost
      SMTP_PORT: 1025

Anti-patterns

Anti-patternWhy it failsFix
Skip per-test inbox clearStale messages cause false-positivesDELETE /api/v1/messages in setup (Step 4)
Assume Mailpit handles authenticated SMTPDefault config is unauthenticated; auth tests need explicit configConfigure --smtp-auth-allow-insecure or proper auth config
Hardcode message IDs in testsIDs are random per send; tests failSearch by recipient/subject (Step 4)
Skip polling; assert immediatelySub-second SMTP delivery isn't guaranteedPoll with timeout (Step 4)
Test only happy pathMisses retry/dead-letter scenariosUse Chaos mode (Step 5)

Limitations

  • Mailpit does NOT actually deliver email - it only captures. For end-to-end deliverability tests, use a real-mail-with-test-domain service (Mailtrap, Mailosaur).
  • Some advanced SMTP features (DKIM signing assertion, SPF lookup) are not Mailpit's focus; verify via separate tooling.
  • The REST API surface evolves between Mailpit releases; pin a specific version in CI (axllent/mailpit:v1.20.0 not :latest).

References

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Builds a CI gate that fails the build on **new** WCAG / a11y violations introduced by a PR while grandfathering pre-existing violations on a per-rule / per-page baseline. Aggregates verdicts from axe-core / pa11y / Lighthouse a11y / WAVE / IBM Equal Access scans. Use when a project has accumulated a11y debt and a strict "zero violations" gate would block every PR - the ratchet pattern lets the team ship while preventing regressions.

中文简介正在准备中。当前显示原文说明。

testland/qa132026年10月20日 更新

Workflow skill that builds an A/B-test validity checklist from an experiment proposal, walking the canonical design-correctness gates - pre-registered OEC/power/guardrails, randomization unit + SRM check, assignment integrity, telemetry, peeking discipline, novelty/primacy, post-experiment SRM re-check - into a per-experiment checklist + sign-off form. Use when launching, auditing, or governing an experiment. For pitfall mechanics (guardrails, peeking) see experiment-results-interpreter's references; to read an already-valid result use experiment-results-interpreter; for per-SDK harness tests use experiment-sdk-testing - this gates DESIGN, not SDK code.

中文简介正在准备中。当前显示原文说明。

testland/qa132026年10月20日 更新

The single install-flow skill: the reference contract for the PWA install flow (installability gate fields, `beforeinstallprompt` handshake, per-platform paths - Android WebAPK / iOS Share menu / Firefox no-op - and the `display-mode` post-install signal, in references/install-flow-reference.md) plus the build-an-X workflow that emits the Add-to-Home-Screen suite. Walks the four-stage timeline, emitting one test per gate cell per [web.dev/articles/install-criteria][install-criteria], the deferred-prompt → `prompt()` → `userChoice` chain per [web.dev/articles/customize-install][customize-install], the iOS Safari manual-metadata branch (`apple-touch-icon`) per [web.dev/learn/pwa/installation][learn-pwa], and the post-install `(display-mode: standalone)` MQ assertion. Output: a Playwright spec with per-stage cells plus a coverage matrix. Use when a PWA's manifest, icons, or install handler change, when install conversion drops at an unknown stage, or when triaging a flaky install assertion.

中文简介正在准备中。当前显示原文说明。

testland/qa132026年10月20日 更新

Build-an-X workflow that uses an LLM to map existing tests to spec sections - given a spec doc + the test suite, the LLM identifies which tests cover which sections, surfaces uncovered sections (gap), and recommends specific tests to add. Output is a coverage matrix per spec ID. Scope is mapping tests that already exist and naming the gaps, not authoring tests for new acceptance criteria. Use when a spec doc and a test suite both exist but nobody can say which requirements are actually covered - before a release sign-off, an audit, or a decision about where to spend the next round of test effort.

中文简介正在准备中。当前显示原文说明。

testland/qa132026年10月20日 更新

Generates tests from natural-language specs (acceptance criteria, user stories, requirements) using an LLM, with confidence scoring per test case (LLM self-assessment plus heuristics: assertion quality, naming, completeness), batching uncertain cases for human review, and integration with the team's existing test framework. Use when the user asks to generate unit tests from acceptance criteria, convert user stories to test cases, automate test creation from requirements, or augment a spec-driven test suite with AI-generated stubs that are then curated before merge.

中文简介正在准备中。当前显示原文说明。

testland/qa132026年10月20日 更新

Configures Allure Report (test-runner adapter install, `allure-results` directory wiring, `categories.json` for failure classification, `history-trend.json` retention via the copy-history-between-runs pattern), runs the Allure CLI to convert `allure-results` to a static HTML site, and uploads the report as a CI artifact. Use when the team needs richer test reporting than JUnit XML - step-level attachments, per-test history, retry tracking, and severity / epic / feature labeling across framework-agnostic adapters (pytest, Jest, JUnit, TestNG, NUnit, Mocha). As a rich static HTML report generator, it is the open-source alternative to the sunset ExtentReports (JVM/.NET per-test HTML narrative); for hosted cross-run flakiness analytics rather than a static per-run report use currents-integration.

中文简介正在准备中。当前显示原文说明。

testland/qa132026年10月20日 更新

查看 testland 的全部技能

报告此技能的问题