Posted on ::

tl;dr

  • Not for email clients (like Thunderbird).
  • Only supports sending emails (for scripts or self-hosted apps).
  • Still in beta.
  • Not an official Tuta project.

Stonebridge

I self-host almost everything except for email, as I feel at peace having my email hosted with Tuta.

Due to the end-to-end encrypted nature of Tuta Mail, it does not support standard SMTP. While great for security, this makes it difficult to use Tuta for automated homelab emails.

To solve this, I built Stonebridge: an SMTP bridge for Tuta Mail.

Stonebridge does NOT serve as a bridge for full email clients like Thunderbird. Its sole purpose is to enable automated emails for your homelab. In other words, it allows self-hosted services - like Nextcloud or Immich — to send notification emails to users via a Tuta account.

Disclaimer: While I do work at Tuta, this is an unofficial personal project created to scratch my own itch.

How it works

The architecture of the project is split into two components: stone-bridge (the SMTP server) and tuta-bridge (the client).

  1. stone-bridge accepts incoming SMTP messages from your self-hosted apps and parses the MIME data.
  2. tuta-bridge is a minimal, logged-in Tuta CLI client. It receives the parsed message over a Unix socket and dispatches it as an email through Tuta.

Both the SMTP server and the MIME parser are built from scratch. I have implemented enough for them to be stable and cover the most common use cases, though they are not yet feature-complete. I expect plenty of edge cases to pop up in the future.

Building a lightweight client like tuta-bridge that runs in the Node.js runtime only recently became possible, thanks to ongoing modularization efforts in the main tutanota codebase.

If you try Stonebridge out and run into unsupported formats, bugs, or questions, please feel free to open an issue on GitHub.

Trivia

  • This is the second iteration of the project. My first approach used the Tuta Rust SDK, but it was missing a few features required for sending emails. Since we at Tuta are shifting focus away from that SDK anyway, I decided to go with a more future-proof TypeScript option.
  • The name Stonebridge is an obscure reference to Robert Jordan's The Wheel of Time. Let me know if you get it :)
Table of Contents