Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Mailpit – An email and SMTP testing tool with API (github.com/axllent)
119 points by qa-guy on June 23, 2023 | hide | past | favorite | 24 comments



I’ve used mailcatcher for years and love it. It is perfect.


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.



Per mailpit author mailhog is not actively developed and has performance issues. Hence developed this alternative


Ah, I did not know that, sorry.


I've been using https://github.com/maildev/maildev, and it has worked fine for me.


smtp4dev https://github.com/rnwood/smtp4dev - works well in docker, has api, can selectively forward to a real smtp


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!


I’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/


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]

    setcap cap_net_bind_service=+ep /path/to/mailpit
[1] - https://stackoverflow.com/questions/413807/is-there-a-way-fo...


I 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/


I find mailtrap.io really handful, how anybody would prefer this option? genuine question


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.

    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

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.


mailtrap has a send limit on the free plan.


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.



is 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.


I use it on daily basis. Wonderful tool. Supports attachements. A must have.


Would be nice if this thing also handled common non-SMTP APIs (e.g. SES).


SES 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.ht...


I am aware. There are numerous reasons why switching may be risky, difficult or otherwise a bad idea, however.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: