Homelab & Self-Hosting

Receive OSS app emails at home with Mailpit and forward them to Discord

When you run open source apps on a home server, you often need to send email for things like sign-ups and password resets. Sending mail directly from home, however, means setting up an SMTP server and configuring a sending domain, which takes more effort than you might expect. This article, which I found on Qiita, solves the problem by simply accepting the trade-off with Mailpit and Discord.

Mailpit was originally a tool for testing outgoing mail. It works as an SMTP server and comes with a test API. If you configure a webhook, it can also call an external application as soon as a message arrives. The article uses this feature to build a setup that posts the contents of incoming mail to Discord.

The setup is just two containers, Mailpit and a webhook-handler, run with Docker Compose. The webhook-handler is a small Python app written in FastAPI. It receives webhooks from Mailpit, formats the sender and recipient, and forwards them to a Discord webhook. The notification can also include a link to the Mailpit web UI, so you can check the message when you need to. Settings such as the webhook URL are kept in a separate .env file.

Even without sending any mail to the outside world, being able to tell right away that a password reset email has arrived looks handy. For anyone running several apps in a homelab, gathering all mail in one place should make management much easier. The post is from August 2026.

Source: Qiita

Comments 0

Leave the first comment, in any language.

Log in to comment