Sunday, March 5, 2023

MailCrab

"Did we really need a replacement for MailCatcher or MailHog?" I'm glad I asked. The answer is yes. See, a colleague had a hard time running Mailhog on his new Macbook, since there are no official docker builds for arm64. So partly to solve this issue, and partly because I simply wanted to write and maintain a small and handy program like Mailhog myself, the idea for MailCrab was born. The inspiration to write the whole thing in Rust came to me when I went to EuroRust in October 2022.

And here it is: better, smaller, faster.

MailCrab - mail test server in Rust

The advantages

  • As you might expect, there is a web interface that allows you to view all incoming email. You will see the formatted email by default, but the raw mail contents as well as the headers and file attachements can also be viewed in the same interface.

  • MailCrab runs on the amd64 and arm64 platforms using docker.

  • This docker image is tiny. It's only 7.77 MB.

  • It maintains an open websocket connection to the selected servers, meaning there is almost no latency.

  • There is a simple API to retrieve messages - which is handy for your automatic tests.

  • Install procedure is short and simple. Tiny program, tiny readme.

More cool stuff

  • The backend is entirely in Rust, and uses Axum;

  • The frontend is entirely in Rust, using Yew;

  • That means the whole thing is in Rust, and yes, that deserves it's own bullet.

Try it out!

It is ready to use! So please do. In fact, please try it out:

docker run --rm -p 1080:1080 -p 1025:1025 marlonb/mailcrab:latest

and let me know if you have any feature requests!



from Hacker News https://ift.tt/6JkbZ7Y

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.