Why a local SMTP catcher is not an email integration test
Your Playwright test fills the signup form. The app sends the confirmation email. Mailpit shows the message with the right subject and link. The test passes. Then staging sends the same email to a real address and nothing arrives. The local catcher did its job. It proved the app opened an SMTP connection, built a MIME message, and rendered the template. It did not prove the message could reach an…
A local SMTP catcher, such as Mailpit or MailHog, is not sufficient for comprehensive email integration testing. While these tools are useful for catching template errors, missing links, broken HTML, and incorrect recipient addresses, they do not verify whether the email actually reaches the recipient's inbox. They sit inside your network and cannot see issues related to DNS, MX records, DKIM key rotation, SPF or DMARC misalignment, or sandboxed providers.
To obtain a more accurate test result, create a real inbox specifically for testing purposes and use its address in the signup form. Wait for the message, assert its contents, and then delete the inbox. Use a different real inbox for each test run to ensure accurate results. This approach will catch failures that only occur when the message leaves your network, such as misaligned SPF or DMARC settings, or when the message is filtered or rejected by the recipient's provider.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.