overview
On this page

Introduction

A brief introduction into what Relais is and who it’s for.

Relais” (French for the word “relay”), is an open-source project aimed at being a guideline as well as a plug-and-play solution for routing custom domains through Gmail. It provides comprehensive, flexible deployment targets (from using AWS SES, to Cloudflare email routing, all the way to your own self-hosted mail server deployed on a VPS (via StalwartExternal link), depending on desired technical complexity.

With that being said, at the time of writing, Relais does not aim to be a standalone, dedicated mail server, although it could be configured to be one, thanks to Stalwart.

Due to a new domain and IP, Relais currently uses AWS SES for outbound mail, using Stalwart as a relay server. This is why you might recognize some DNS records containing amazonses.com. You can learn more in the How it Works section.


Commonly, developers aiming to self-host a mail server for their custom domains would use technologies like PostfixExternal link (as a Mail Transfer Agent, MTA) and DovecotExternal link (as a Mail Delivery Agent, MDA), which can be self-hosted privately on a VPS or your very own home server.

  1. Postfix (MTA): Handles SMTP (outbound) traffic.
  2. Dovecot (MDA): Provides IMAP/POP3 (inbound) access.

Relais replaces this stack with StalwartExternal link, a modern, all-in-one mail server written in Rust that handles both MTA and MDA responsibilities. Rather than accessing mail through a dedicated client, Relais uses Stalwart’s MTA Hook webhooks and the Gmail API to place received emails directly into your existing Gmail inbox, and Gmail’s “Send As” feature to send outbound mail through Stalwart over SMTP, with proper DKIM, SPF, and DMARC protcols.

In short, you get:

  • Inbound mail routed to your Gmail inbox via webhooks, no polling or other forwarding hacks.
  • Outbound mail sent from Gmail using your custom domain, relayed through Stalwart and AWS SES.
  • No Google Workspace required, it works with your free, personal Gmail account.

If you’re interested in running this yourself, check out the Self-Hosting guide.


Security

Relais aims to store as little information as possible: your email should pass through and not be stored. Email content is never written to disk or a database. Instead, it flows from the mail server to your Gmail inbox via the API and is immediately discarded. OAuth tokens are encrypted at rest. The entire pipeline is open source and auditable. See the Security & Privacy (/docs/security/architecture) section for the full details.


LLMs.txt

Relais provides an LLMs.txt, which can be used to help AI models understand how to self-host as well as use this project.