5 ms·
Mailpit – An email and SMTP testing tool with API
- LinuxBender 3y agoThis 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] setcap cap_net_bind_service=+ep /path/to/mailpit [1] - https://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-on-linux https://stackoverflow.com/questions/413807/is-there-a-way-fo...
- jslakro 3y agoI find mailtrap.io really handful, how anybody would prefer this option? genuine question
- shagie 3y agoMy 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. docker run -d --name=mailpit --restart unless-stopped -p 8025:8025 -p 1025:1025 axllent/mailpit I can connect to port 1025 just fine. --- This test data isn't something that should be leaving the local network either. Can you run mailtrap.io on your local machine or in your data center? --- Oops, I accidentally set it to send all the emails. How much does it cost to handle 500 email in the next few minutes? Mailpit is free. --- That 500 test email that were sent to mailpit, they're correct and should be sent out to the testers. https://github.com/axllent/mailpit/wiki/SMTP-relay https://github.com/axllent/mailpit/wiki/SMTP-relay 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.
- francislavoie 3y agoI 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.
- brightball 3y agoFwiw, 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.
- jawngee 3y agomailtrap has a send limit on the free plan.
- minimaul 3y agoReally 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!
- mustardo 3y agoA couple others Mail Catcher https://mailcatcher.me/ https://mailcatcher.me/ Lunatic SMTP https://github.com/anlar/lunaticsmtp https://github.com/anlar/lunaticsmtp Green Mail https://greenmail-mail-test.github.io/greenmail/ https://greenmail-mail-test.github.io/greenmail/
- jayknight 3y agoI've been using https://github.com/maildev/maildev https://github.com/maildev/maildev, and it has worked fine for me.
- mbork_pl 3y agoAlso, Mailhog: https://github.com/mailhog/MailHog https://github.com/mailhog/MailHog
- andrei_says_ 3y agoI’ve used mailcatcher for years and love it. It is perfect.
- olex 3y agoSame, 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.
- lfconsult 3y agoI use it on daily basis. Wonderful tool. Supports attachements. A must have.
- pydry 3y agoWould be nice if this thing also handled common non-SMTP APIs (e.g. SES).
- supriyo-biswas 3y agoSES has a SMTP interface[1], so one way would be to switch over your app to that instead. [1] https://docs.aws.amazon.com/ses/latest/dg/send-email-smtp.html https://docs.aws.amazon.com/ses/latest/dg/send-email-smtp.ht...
- pydry 3y agoI am aware. There are numerous reasons why switching may be risky, difficult or otherwise a bad idea, however.
- 2Gkashmiri 3y agois there some foss email inbound software that can take email "in" using wildcards or restricted email ids and dumps the same into a DB? i have to apply regex to the email body and other stuff and keep only the relevant bit . i see the managed softwares but i want something on my own vps.
- cebert 3y agoAt 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.
- moltar 3y agoFYI there’s also a simulator available: https://docs.aws.amazon.com/ses/latest/dg/send-an-email-from-console.html https://docs.aws.amazon.com/ses/latest/dg/send-an-email-from...
- moltar 3y agoI’ve been using Ethereal [1] for ages. It works great and has an API. Also totally free. Downside: - it’s hosted, which may not be for everyone if your test emails contain sensitive information. Altho I think it never should. - it sometimes is down - it requires an internet connection [1] https://ethereal.email/ https://ethereal.email/
- npteljes 3y agoI have used FakeSMTP a long time ago, and it seems like it's still around. This one comes as a single jar. http://nilhcem.com/FakeSMTP/ http://nilhcem.com/FakeSMTP/