Same, I'm using it in CI/CD for full E2E tests of web apps in combination with Playwright for app interaction, and it's awesome. Same test flow can nicely simulate user interactions and verify that emails with the correct content go out from the backend, all in seconds within a normal Gitlab CI test job.
May take a look at Mailpit though. It has the advantage of having a native Docker image build, whereas for Mailcatcher I'm using a third-party Alpine-based image.
Really recommend this, it's very useful to us at work for capturing email from local dev environments for email testing - we run it as part of our dockerised dev setup. Means we don't have to worry about ever accidentally hitting real mail systems, while still letting us actually exercise our email sending code.
Also makes it very easy to see rendered HTML, HTML source, the text/plain part of a mailer, etc.
And as an excellent plus, the author is responsive to reasonable PRs!
This looks very useful. In the past I've used smtp-sink which is part of Postfix-(stone) and logs to syslog but having a web interface that shows attachments is a big improvement over the smtp-sink method. I could see also using this to replace my SMTP tarpits which are just Postfix logging to single text files per node. I could envision a few other unorthodox uses for this as well.
With an optional installation step this could run on port 25 as a regular person. Or authbind [1]
My work machine is prohibited from connecting to port 25 outside of the accepted work systems. When on VPN, I can't even connect to port 25 within the local networks.
What is the cost to forward 500 emails this week? And again next week?
---
Mailpit (and its predecessor Mailhog) were not difficult at all to spin up and test. Any developer with docker running on their machine can do local testing without any issues. Data never leaves the machine or intranet - this makes security types sweat less.
I prefer mailtrap because I can show others what mails I produce in testing looks like in their browser. Also nice for staging environments that aren't local dev environments. Zero infrastructure setup. But yeah it depends on your business needs.
Fwiw, I use mailtrap.io for non-prod environments outside of my local machine. Locally, this is a better option when other people don’t need access to it.
At work we use AWS’s Simple Email Service to dump all emails to S3 buckets that expire after a few days. It’s nice if you need to very that emails are working correctly in end-to-end tests.
Mail Catcher https://mailcatcher.me/
Lunatic SMTP https://github.com/anlar/lunaticsmtp
Green Mail https://greenmail-mail-test.github.io/greenmail/