Almost every time I build a web gadget, I need to send a few emails. Making sure those messages are sent when they should and look the way they should is a real weak point of django tooling, IMO. Mailpit is an easy way to run past that.

The main reason I’m writing this down and posting it is that I keep forgetting about it and rediscovering it. It feels like a very intense need for a very brief time as I’m building things.

Mailpit is a single executable file, built with go, that listens for SMTP on port 1025 and displays it in a nice web UI on port 8025. It’s both more pleasant and more informative than fishing the text of emails out of the django console, and when I’m making sure password resets or magic links work right, it helps me work faster.

The documentation is excellent. On my mac, all I needed to do was

brew install mailpit
brew service start mailpit

then configure django to use smtp via mailpit. As a bonus, since I tend to use Zeptomail’s SMTP interface for production servers, it keeps my development and production setups closer together.


I’ve got 3 or 4 other posts more than half completed right now, but they’re stuck behind a couple of other projects. This one was inspired by needing to look up the Mailpit ports and the hope that writing it down myself will make me remember next time.