# Postern documentation > Postern is a self-hosted mail client in two parts: the Hub, one small Go server you run on your own Linux machine (Docker or systemd), and web, desktop (macOS, Windows, Linux), iOS and Android apps that sign in to it. It connects to the mailboxes you already have (Gmail, Microsoft 365, iCloud, Yahoo, Fastmail, any IMAP/SMTP, JMAP); it is not a mail server. Unified inbox, Spaces, search, rules that run on the Hub while devices are off, push through a relay you run. No telemetry. Source-available under PolyForm Noncommercial 1.0.0. Beta: no published releases yet; build from source. All 73 pages, in the order of the sidebar. Index: https://docs.posternmail.app/llms.txt --- # Postern documentation > The documentation of Postern, a self-hosted mail client for all your mailboxes. Install the Hub, connect your mailboxes and apps, write rules and run it safely. Source: https://docs.posternmail.app/ Postern is a mail client for the web, your desktop and your phone, with a small server you run yourself. You install the **Hub** on your own machine, connect your mailboxes to it once, and every app signs in to your Hub. Your mail and your mailbox passwords never touch the project's servers. > [!WARNING] > Postern is in beta. Features are still missing, behaviour changes between versions, and no > releases are published yet: you build it from source. Keep your mail at your provider; > Postern never needs to be the only copy. ## Where to start | If you want to | Read | |---|---| | Understand what you are about to install | [How Postern works](https://docs.posternmail.app/how-it-works/) and [Requirements](https://docs.posternmail.app/requirements/) | | Install a Hub | [Setup guide](https://docs.posternmail.app/setup/), with a selector for Docker Compose, Debian, Ubuntu, Fedora, Raspberry Pi OS or the desktop app | | Let an AI coding agent install it | [Set up with an AI agent](https://docs.posternmail.app/setup-with-ai/) | | Reach the Hub from your phone and laptop | [Reaching your Hub](https://docs.posternmail.app/reach/) | | Add Gmail, Outlook, iCloud or any IMAP mailbox | [Connect mailboxes](https://docs.posternmail.app/providers/) | | Get the apps | [Apps](https://docs.posternmail.app/apps/) and [Pairing a device](https://docs.posternmail.app/apps/pairing/) | | Filter, forward or redirect mail automatically | [Rules](https://docs.posternmail.app/rules/) | | Look up a setting or command | [Configuration](https://docs.posternmail.app/configuration/) and [Command line](https://docs.posternmail.app/reference/cli/) | | Fix something | [Troubleshooting](https://docs.posternmail.app/troubleshooting/) | ## The sections - **Start here**: what Postern is, what you need, and the setup guide. - **Reaching your Hub**: Tailscale, a reverse proxy with your own domain, Cloudflare Tunnel, LAN only, and HTTPS. - **Connect mailboxes**: one page per provider, with the exact steps and server settings. - **Apps**: web, desktop, iOS and Android, pairing, and what works offline. - **Using Postern**: the unified inbox and Spaces, search, compose, snooze and send later, the screener, tags, shortcuts, notifications and settings. - **Rules**: conditions, steps, Test mode, the activity log, the sending queue, limits, alerts and webhooks. - **Push relay**: how notifications reach phones and how to run your own relay. - **Administration**: users, sign-in methods, the admin panel, backups, upgrades, logs and `doctor`. - **Reference**: every environment variable, every command, ports and paths, the HTTP API and capabilities, and building from source. - **Security**: the threat model, encryption, how mail is displayed safely, and a hardening checklist. ## For AI agents and scripts Every page is also available as plain Markdown at its address with `.md` instead of the trailing slash, for example [`/docs/setup.md`](https://docs.posternmail.app/setup.md). [`/llms.txt`](https://docs.posternmail.app/llms.txt) lists all pages and [`/llms-full.txt`](https://docs.posternmail.app/llms-full.txt) holds all of them in one file. Agents that set up a Hub should start with [For AI agents](https://docs.posternmail.app/agents/). ## Words used in these docs | Term | Meaning | |---|---| | **Hub** | The server program you run (`postern-hub`). It holds your account, your mailbox sign-ins (encrypted), settings and rules, and watches your inboxes. One Hub can hold several people. | | **App** | The web, desktop, iOS or Android client. The desktop and phone apps connect to your mail providers directly and keep their own copy of your mail. | | **Mailbox** | One connected email account, such as a Gmail address or an IMAP account. | | **Space** | A group of mailboxes with its own unified inbox, such as "Work" or "Personal". | | **Push relay** | A small service that forwards "new mail" wake-ups to phones through Apple and Google. Optional. | | **Pairing** | Signing in a new device by scanning a QR code or typing a short code shown on a device that is already signed in. | The source code is at [github.com/TheOriUHD/postern](https://github.com/TheOriUHD/postern). These pages are built from the Markdown files in its `docs/` folder. --- # How Postern works > The parts of Postern (the Hub, the apps, the optional push relay), who keeps which data, and what happens when mail arrives, when you send, and when the Hub is down. Source: https://docs.posternmail.app/how-it-works/ Postern has two parts: one small server program you run, the **Hub**, and the **apps** that sign in to it. A third, optional part, the **push relay**, carries notifications to phones. This page explains what each part does and where your data lives, so the rest of the docs make sense. Postern is not a mail server. It hosts no addresses and receives no mail over SMTP. Your mail stays at Gmail, Outlook, iCloud, Fastmail or your own mail server, and Postern connects to those mailboxes like any mail client does. ```text Your devices: real mail clients Your server (Linux box, NAS, Pi, VPS) ┌───────────────────────────────┐ ┌──────────────────────────────────────────┐ │ Desktop / Mobile app │ account, │ Hub (one Go binary) │ │ ┌─────────────────────────┐ │ settings, │ accounts · devices · credentials vault │ │ │ mail engine (same Go │◀─┼─────────────┤ settings · rules · tags · drafts · marks│ │ │ code as the Hub) │ │ sign-ins, │ inbox watcher (instant IMAP IDLE) │ │ │ local copy of your mail │ │ snoozes… │ push · send later · snooze wake-ups │ │ └───────────┬─────────────┘ │ │ web app (+ full mail copy while used) │ │ Web app ─────┼────────────────┼────────────▶└───────────────┬──────────────────────────┘ └──────────────┼────────────────┘ │ watches inboxes only │ connects directly │ (no copy of your mail) ▼ ▼ Gmail · Outlook · iCloud · Yahoo · Fastmail · any IMAP/SMTP (or JMAP) ``` ## The Hub The Hub is one program, `postern-hub`, with one data folder and one master key. You run it on a machine that stays on: a home server, a NAS, a Raspberry Pi or a VPS. It is the **control plane** of your setup: - **Your account.** You sign in to the Hub with a password plus a second factor, a passkey or single sign-on. One Hub can hold several people, each with their own mailboxes, settings and encryption key. - **Your mailbox sign-ins.** You connect each mailbox once, on the Hub. The passwords and tokens are encrypted at rest and handed only to devices you approved. - **Everything you set up.** Spaces, identities, signatures, tags, rules, templates, drafts, settings, and the state of each conversation (snoozed, pinned, muted, follow-up) live on the Hub and sync to every device. - **The work that must happen while your devices are off.** The Hub watches each inbox with an instant IMAP IDLE connection, sends push notifications, runs your rules, wakes snoozed conversations, reminds you of follow-ups and sends scheduled mail. - **The web app.** The Hub serves the web app at its own address. A browser cannot talk to mail servers, so the web app uses the Hub's mail engine. While you use it, the Hub keeps a full copy of your mail. The Hub listens on `127.0.0.1:8080` by default, so only the machine itself can reach it. You decide how your devices reach it: [Reaching your Hub](https://docs.posternmail.app/reach/). ## The apps | App | How it gets your mail | Without the Hub | |---|---|---| | **Web** | Through the Hub's engine | Does not work | | **Desktop** (macOS, Windows, Linux) | Directly from your providers, with its own copy on the computer | Keeps working, including sending | | **iOS and Android** | Directly from your providers, with its own copy on the phone | Keeps working, including sending | The desktop and phone apps run the **same mail engine as the Hub**, compiled into the app. They get the mailbox sign-ins from the Hub, then talk to Gmail, Outlook or your IMAP server themselves. This is called **direct mode**. Everything that is not mail itself (settings, rules, drafts, snoozes) still goes through the Hub, so every device stays in sync. See [Apps](https://docs.posternmail.app/apps/) and [Offline behaviour](https://docs.posternmail.app/apps/offline/). New devices sign in with **pairing**: a device that is already signed in shows a QR code, the new one scans it, and you approve it. See [Pairing a device](https://docs.posternmail.app/apps/pairing/). ## The push relay Apple and Google only deliver push notifications that are signed with the app developer's keys. A Hub you run cannot hold those keys, so it sends a short "new mail" message to a **push relay**, which forwards it to Apple or Google. The relay is optional; without it, phones catch up when you open the app. With previews on, the message carries the sender, the subject and the first line; with previews off it carries no mail content. See [How push works](https://docs.posternmail.app/relay/) and [What the relay sees](https://docs.posternmail.app/relay/what-it-sees/). ## What happens when **New mail arrives.** The provider's IMAP IDLE connection tells the Hub within seconds. The Hub runs your rules on it, then sends a push notification and tells every signed-in app over a WebSocket. Desktop and phone apps fetch the message from the provider themselves. **You send a message.** A desktop or phone app sends it itself, through your provider, after the undo send window. A message scheduled with send later is handed to the Hub, which sends it on time even when every device is off. The web app sends through the Hub. **The Hub is down.** Desktop and phone apps keep reading and sending mail. Changes to settings, snoozes and drafts wait on the device and sync when the Hub is back. The web app, push notifications, rules and scheduled sends wait for the Hub. **A device is lost.** Revoke it in **Settings → Devices** on any other device. Its session ends, and the app deletes the mail it kept for that Hub the next time it reaches the Hub. ## Where your data lives | Data | Where | |---|---| | Your mail | At your provider. A copy on each desktop and phone app. A full copy on the Hub only while you use the web app (or always, if you turn that on). | | Mailbox passwords and tokens | Encrypted in the Hub's database. Sealed copies on devices you approved. | | Settings, rules, tags, drafts, snoozes | In the Hub's database, mirrored to each device. | | The master key | One file next to the data folder (not inside it). Back it up separately. | | Backups | In the Hub's data folder by default, every 24 hours. | Details: [Encryption at rest](https://docs.posternmail.app/security/encryption/) and [Backups and restore](admin/backups.md). ## What Postern does not do - **Host your mail.** You need a mailbox at a provider or on your own mail server. - **Run as a service for you.** There is no hosted Postern; you run the Hub. - **Phone home.** The Hub and the apps have no telemetry. Their only connections are to your mail providers, your Hub and, if you use push, the relay. The full design, for developers, is in [docs/dev/DIRECT-MODE.md](https://github.com/TheOriUHD/postern/blob/main/docs/dev/DIRECT-MODE.md). --- # Requirements > What you need to run a Postern Hub and the apps: the machine, its system, memory, disk, network and clock, your mailboxes and the apps. Source: https://docs.posternmail.app/requirements/ What you need before the [setup guide](https://docs.posternmail.app/setup/). The short version: a 64-bit Linux machine that stays on, and a way for your devices to reach it. ## The Hub's machine | | | |---|---| | **System** | 64-bit Linux on amd64 (x86-64) or arm64 (aarch64). The installer supports Debian 12 or newer, Ubuntu 22.04 or newer, Raspberry Pi OS (64-bit), Fedora 40 or newer, and RHEL, Rocky Linux and AlmaLinux 9 or newer. Other Linux systems work with Docker. 32-bit systems are not supported. | | **Docker or systemd** | The installer runs the Hub in Docker (it installs Docker if needed) or as a systemd service. Docker needs Docker Engine 23 or newer with the Compose plugin. | | **Memory** | 1 GB is enough for a household. On machines with less, choose the native service instead of Docker. The design target is about 5 people and 20 mailboxes in roughly 150 MB for the Hub itself; that is a goal, not a measurement. | | **Disk** | A few GB for most people. The Hub keeps a copy of your mail (bodies of the last 30 days are fetched ahead, older ones on demand) and its daily backups. Prefer an SSD over an SD card: the Hub writes its database often. | | **Network** | Outbound connections to your mail providers (IMAP, SMTP, HTTPS) and to Postern's download server for updates. No inbound port is needed for mail, so the Hub works behind a home router and CGNAT. | | **Clock** | Accurate time (NTP, on by default on every supported system). Two-step codes, certificates and schedules depend on it. | | **Always on** | Rules, snoozes, follow-ups, scheduled sends and push notifications only happen while the Hub runs. | Good machines: a Raspberry Pi 4 or 5, an old PC or laptop, a NAS that runs Docker, or a small VPS. A Mac is not supported as a server: it sleeps, and Docker Desktop needs a signed-in user. ## Reaching the Hub Your devices need a way to reach the Hub. The installer sets up one of these: | Way | You need | |---|---| | **This machine's address on your network** | Nothing. Plain HTTP, so no passkeys and no Google sign-in; phones only at home. | | **A domain with HTTPS (Caddy)** | A domain that points at the machine, and ports 80 and 443 open to it. | | **Behind your own reverse proxy** | Your proxy (nginx, Caddy, Traefik, ...) and a domain. | | **Only on Tailscale** | A free Tailscale account, and Tailscale on every device that uses Postern. | | **Cloudflare Tunnel** | A domain on Cloudflare. Cloudflare can read the traffic. | Passkeys, signing in with Google for Gmail, Microsoft's browser sign-in and browser notifications need HTTPS. See [Reaching your Hub](https://docs.posternmail.app/reach/) for the details of each way. ## Mailboxes Any mailbox you can reach over IMAP and SMTP works, plus Gmail and Microsoft 365 through their APIs and Fastmail through JMAP. Some providers need preparation: | Provider | You need | |---|---| | Gmail, Google Workspace | 2-Step Verification and an app password, or your own Google Cloud OAuth client | | Microsoft 365, Outlook.com | Your own app registration in Microsoft Entra (free) | | iCloud, Yahoo, AOL | 2-factor authentication and an app-specific password | | Fastmail | An API token or an app password | Details per provider: [Connect mailboxes](https://docs.posternmail.app/providers/). ## The apps | App | Needs | |---|---| | Web | A current browser. Your Hub serves it. | | Mac | macOS 15 or later, Apple silicon or Intel. | | Windows | Windows 10 (version 1809 or later) or 11, x64 or ARM64. | | Linux | A `.deb` for Debian and Ubuntu, or an AppImage for any distribution, x86-64 or ARM64. | | iPhone, iPad, Apple Watch | Coming to the App Store. | | Android | Built from source for now. | Downloads are on [the download page](https://posternmail.app/download/). See [Apps](https://docs.posternmail.app/apps/). ## Push notifications on phones Optional. Phones get notifications through a push relay that holds the Apple and Google push credentials for the app build. The official relay (`https://relay.posternmail.app`) serves the App Store and TestFlight app on Apple devices; for a self-built app or Android you run your own, which needs an Apple Developer account (iOS) or a Firebase project (Android). See [How push works](https://docs.posternmail.app/relay/). ## Building from source Not needed for the installer. To build the Hub or the apps yourself you need Git, Go and Node.js with pnpm; the exact versions come from `hub/go.mod` and `package.json`. See [Build from source and development](https://docs.posternmail.app/development/). --- # Setup guide > Install a Postern Hub from scratch with one command, choose how your devices reach it, create your account, add your first mailbox and get the apps. Source: https://docs.posternmail.app/setup/ The Hub is the small server that Postern's apps connect to. It runs on a machine of yours, keeps your mailboxes in sync and holds your settings, rules and sign-ins. This guide takes you from an empty machine to your first mailbox. It takes about 15 minutes. If you would rather have an AI coding agent do this for you, see [Set up with an AI agent](https://docs.posternmail.app/setup-with-ai/). ## What you need **A machine that stays on.** Rules, snoozes, scheduled sends and notifications only happen while the Hub runs. Any of these works: - a Raspberry Pi 4 or 5 with Raspberry Pi OS (64-bit), ideally with a USB SSD instead of an SD card; - an old PC or laptop with Debian or Ubuntu; - a small virtual server (VPS) from a hosting company, with 1 GB of memory or more; - a NAS, if it runs Docker and lets you log in over SSH as an administrator. The installer supports these systems, on 64-bit Intel or AMD (amd64) and 64-bit ARM (arm64): | System | Versions | |---|---| | Debian | 12 or newer | | Ubuntu | 22.04 or newer | | Raspberry Pi OS | 64-bit, Bookworm or newer | | Fedora | 40 or newer | | RHEL, Rocky Linux, AlmaLinux | 9 or newer | Plan for 1 GB of memory and a few GB of free disk. More details: [Requirements](https://docs.posternmail.app/requirements/). **A terminal on that machine** with a user who may use `sudo`. Logging in over SSH from your own computer is fine. **Your mailboxes' passwords or app passwords.** Some providers need a little preparation, see [step 7](https://docs.posternmail.app/setup/#7-add-your-first-mailbox). ## 1. Open a terminal on the machine Sit at the machine, or log in to it from your computer. On macOS, Linux and Windows the command is the same; replace the user and the machine's name or IP address with yours: ```sh ssh pi@raspberrypi.local ``` > **Check:** you see a prompt on the machine, for example `pi@raspberrypi:~ $`. > **If it did not work:** "Could not resolve hostname" means your computer does not know the > name: use the machine's IP address instead (your router's device list shows it). > "Connection refused" means SSH is off on the machine: on a Raspberry Pi, turn it on in > Raspberry Pi Imager's settings or in `sudo raspi-config` under **Interface Options**. ## 2. Run the installer ```sh curl -fsSL https://updates.posternmail.app/install | sudo sh ``` `sudo` asks for your password. The installer then looks at the machine and asks a few questions, one screen each: **Machine**, **Access**, **Options** and **Review**. Nothing changes until you confirm on the **Review** screen. Press **Enter** to take the suggested answer. What the installer does when you confirm: - installs Docker, if you chose Docker and it is missing; - downloads the Hub from Postern's download server and checks its signature, so only a Hub signed by Postern is installed ([how that works](https://docs.posternmail.app/updates/#where-updates-come-from)); - starts the Hub and, depending on your answers, Caddy, Tailscale or a Cloudflare Tunnel; - waits until the Hub answers, then shows its address and a setup code. Every command it runs is written to `/var/log/postern-install.log`. > [!TIP] > To read the installer before you run it, download it first: > > ```sh > curl -fsSLo install.sh https://updates.posternmail.app/install > less install.sh > sudo sh install.sh > ``` > **Check:** the screen shows **Postern Hub setup** and the steps > **Machine › Access › Options › Review › Install › Finish**, then a summary of the machine. > **If it did not work:** "curl: command not found" means curl is missing: install it with > `sudo apt install curl` (Fedora and RHEL: `sudo dnf install curl`). "this is a 32-bit ARM > system" means the Raspberry Pi runs the 32-bit system: install Raspberry Pi OS (64-bit) and > start again. ## 3. Answer the questions ### How should the Hub run? | Choice | Pick it when | |---|---| | **Docker (recommended)** | Almost always. The Hub runs in a container and updates arrive as new images. If Docker is missing, the installer installs it with Docker's own script. | | **Native service** | The machine has little memory (under 1 GB), or you don't want Docker. The Hub is one program and a systemd service called `postern-hub`. | Both update themselves and keep the same data. You cannot switch later without [uninstalling](https://docs.posternmail.app/setup/#start-over-or-remove-the-hub) first; your data stays when you do. ### How will you and your devices reach the Hub? This decides the address you open Postern at. You can change it later by running the installer again. | Choice | Good for | You need | |---|---|---| | **This machine's address on your network** | Trying Postern at home on a computer. | Nothing. But: plain HTTP, so no passkeys and no Google sign-in, and phones only reach it at home. | | **A domain with HTTPS (Caddy)** | A Hub on a server on the internet, at your own address. | A domain name that points at this machine, and ports 80 and 443 open to the internet. | | **Behind my own reverse proxy** | You already run nginx, Caddy, Traefik or similar. | Your proxy and a domain. The installer shows what to add to the proxy. | | **Only on Tailscale (recommended)** | Most people at home. Private, with HTTPS, and it works on your phone away from home. | A free Tailscale account, and the Tailscale app on each device that uses Postern. | | **Cloudflare Tunnel** | A public address without opening ports on your router. | A domain on Cloudflare. Cloudflare can read the traffic that passes through it. | **Not sure? Pick Only on Tailscale.** It needs no domain and no open ports, nobody outside your own devices can reach the Hub, and you get HTTPS, which passkeys and Google sign-in need. What each choice asks, and what to prepare: - **This machine's address on your network:** the address devices use. The installer suggests the machine's IP address. A name your router gives it, like `hub.lan`, also works and is better for Android phones ([why](https://docs.posternmail.app/reach/lan/#phones)). Give the machine a fixed IP address in your router, so the address doesn't change. - **A domain with HTTPS (Caddy):** the domain, like `mail.example.com`, and optionally an email address for certificate notices. Before you start, create a DNS record (A or AAAA) that points the domain at the machine, and forward ports 80 and 443 to it if it is behind a router. Caddy gets the certificate from Let's Encrypt and renews it. - **Behind my own reverse proxy:** the domain, and whether the proxy runs on this machine or on another one. At the end the installer shows what to forward and a ready Caddy example. For nginx and Traefik see [Reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/). - **Only on Tailscale:** nothing to type. First, in the Tailscale admin console under [DNS](https://login.tailscale.com/admin/dns), turn on **MagicDNS** and **HTTPS Certificates**. If Tailscale is not on the machine yet, the installer installs it and shows a link: open it and sign in. The Hub's address is then `https://..ts.net`. - **Cloudflare Tunnel:** the host name, and the tunnel's token. Create the tunnel in the Cloudflare dashboard (**Zero Trust**, **Networks**, **Tunnels**) and copy the token from the install command it shows. If `cloudflared` already runs on this machine, leave the token empty. Details: [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/). ### Options and review **Options** asks for the Hub's port on this machine (8080 unless something else uses it), the folder for the Docker files (`/opt/postern`) and the update channel (**Stable updates**, or **Beta updates** for new versions a little earlier). **Review** lists what will happen. Press **Enter** to install. > **Check:** the last screen says **Postern Hub 0.9.1 is running.** (with the current version), > followed by **Open** with the address and **Setup code** with a code like `K7QF-2M9X-H4TC`. > Write the code down. > **If it did not work:** the installer shows the step that failed and its last lines of > output; `/var/log/postern-install.log` has everything. Fix the cause and run the same command > again: it picks up where things are and keeps your data. Common causes are in > [When something goes wrong](https://docs.posternmail.app/setup/#when-something-goes-wrong). ## 4. Open the address Open the address from the **Open** line in a browser, on any device that can reach the Hub: - **Network address:** a device on the same network. - **Tailscale:** a device signed in to the same tailnet. - **Domain with Caddy:** any device, once the DNS record works. The first visit can take a few seconds while Caddy gets the certificate. - **Your own proxy** or **Cloudflare Tunnel:** first finish the step the installer printed under **Point your proxy at the Hub** or **In Cloudflare**. > **Check:** you see **Set up your Hub**. > **If it did not work:** see [I cannot open the Hub from another device](https://docs.posternmail.app/troubleshooting/#i-cannot-open-the-hub-from-another-device). > To try the Hub right away, forward its port over SSH from your computer and open > `http://localhost:8080` there (the port only works while SSH stays open): > > ```sh > ssh -L 8080:127.0.0.1:8080 pi@raspberrypi.local > ``` ## 5. Create your admin account The setup page has three steps. The first account becomes the Hub's administrator. 1. **Name your Hub.** Type a **Hub name**, for example "Ellis Family Mail", and the **Setup code** from the installer. Click **Continue**. 2. **Create your account.** **Your name**, an **Email** and a **Password** of at least 10 characters. The email is your sign-in name; it doesn't have to be a mailbox you'll connect. Click **Create account**. 3. **Add a mailbox.** Click **Add your first mailbox**, or **Skip for now** and do it later. Lost the setup code? Show it again: | Hub runs in | Command | |---|---| | Docker | `cd /opt/postern && sudo docker compose exec hub postern-hub setup-code` | | Native service | `sudo cat /var/lib/postern/setup-code` | > **Check:** you see your inbox (empty until you add a mailbox), and **Settings** has an > **Admin** section. > **If it did not work:** "That setup code isn't right" means a typo or an old code: show it > again with the command above. "Cross-origin request rejected" means the address in the > browser differs from the one the installer set up: open exactly the address from the > **Open** line. ## 6. Back up the master key The Hub encrypts your data with a master key that it created on its first start. Without the key, your data and every backup are unreadable, to a thief and to you. Copy it now and keep it somewhere else, for example in your password manager. | Hub runs in | Copy the key to your home folder | |---|---| | Docker | `cd /opt/postern && sudo docker compose cp hub:/key/hub.key ~/hub.key` | | Native service | `sudo install -m 0600 -o "$USER" /var/lib/postern-key/hub.key ~/hub.key` | Move `~/hub.key` off the machine (for example with `scp`, or open it and paste the text into your password manager), then delete it there with `rm ~/hub.key`. > **Check:** the key is stored somewhere other than the machine, and not next to your data > backups. > **If it did not work:** "No such file" means the Hub has not started yet: go back to > [step 3](https://docs.posternmail.app/setup/#3-answer-the-questions). ## 7. Add your first mailbox Click **Add your first mailbox** after the setup, or later **Settings → Mailboxes → Add mailbox**. The dialog asks **Where does your mail live?**: pick **Google**, **Microsoft**, **iCloud** or **Other**, type your address and click **Continue** (for Google and Microsoft the button says **Sign in with Google** or **Sign in with Microsoft**). The Hub finds the server settings itself and offers the ways to sign in, the best one marked **Recommended**. What each provider needs: | Provider | Easiest way | Guide | |---|---|---| | Gmail | An app password. Needs 2-Step Verification on the Google account. | [Gmail](https://docs.posternmail.app/providers/gmail/) | | Outlook.com, Microsoft 365 | A free app registration in Microsoft Entra, once per Hub. Passwords don't work at Microsoft. | [Microsoft](https://docs.posternmail.app/providers/microsoft/) | | iCloud, Yahoo, AOL | An app-specific password. | [iCloud](https://docs.posternmail.app/providers/icloud/), [Yahoo](https://docs.posternmail.app/providers/yahoo/) | | Fastmail | An app password or an API token. | [Fastmail](https://docs.posternmail.app/providers/fastmail/) | | Any other provider | Your normal password, or an app password if the provider asks for one. | [Any IMAP mailbox](https://docs.posternmail.app/providers/imap/) | > **Check:** the dialog says the mailbox is connected and shows a progress bar while your mail > downloads. Recent mail appears first; older mail keeps arriving in the background. > **If it did not work:** "The sign-in was rejected" usually means the provider wants an app > password. "This way of signing in isn't set up on your Hub" means Google or Microsoft sign-in > needs the app details in **Settings → Admin** first; the provider's guide shows how. More in > [Connect mailboxes](https://docs.posternmail.app/providers/#errors-while-adding). ## 8. Install the apps The web app is already there: it is the address you just opened. For your computer and phone, get the apps from [the download page](https://posternmail.app/download/). - **Desktop app:** enter the Hub's address when it asks, then sign in. - **Phone:** in the web app, open **Settings → Devices → Connect a device** and scan the QR code with the Postern app. See [Pair a device](https://docs.posternmail.app/apps/pairing/). With **Only on Tailscale**, every device needs the Tailscale app, signed in to your tailnet. With **This machine's address on your network**, phones connect only at home, see [LAN only](https://docs.posternmail.app/reach/lan/#phones). ## Updates The Hub updates itself. It looks for a new version every 10 minutes, checks its signature, waits until no mail is being sent or synced, then installs it and restarts. If the new version does not start, it goes back to the old one. [Updates](https://docs.posternmail.app/updates/#the-hub) explains it, and how to turn it off. To update right now, run the installer with `--update`: ```sh curl -fsSL https://updates.posternmail.app/install | sudo sh -s -- --update ``` To change how the Hub is reached, its port or the update channel, run the installer again without options and choose **Change how it is set up**. Your data stays. ## Backups The Hub backs itself up every 24 hours and keeps the last 7 backups. They sit next to its data, so they don't help if the disk dies: copy them to another place. Everything the Hub has is in two places, kept apart on purpose: | Hub runs in | Data and backups | Master key | |---|---|---| | Docker | the Docker volume `postern_postern-data` (folder `/var/lib/docker/volumes/postern_postern-data/_data`, backups in `backups/`) | the volume `postern_postern-key` | | Native service | `/var/lib/postern` (backups in `backups/`) | `/var/lib/postern-key` | Copy the data folder somewhere else regularly; copy the key once, as in [step 6](https://docs.posternmail.app/setup/#6-back-up-the-master-key), and keep it apart from the data. A backup without the key is useless, and the key alone does nothing. [Backups and restore](https://docs.posternmail.app/admin/backups/) shows how to copy backups off the machine automatically and how to restore one. ## When something goes wrong **The installer stopped with an error.** It shows the step that failed and the last lines of its output. The whole log is `/var/log/postern-install.log`. It is safe to run the installer again once the cause is fixed. Frequent causes: | Message | What to do | |---|---| | "something already listens on port 8080" | Another program uses the port. Choose another port in **Options**, or add `--port 8081`. | | "port 80 is in use, and Caddy needs it" | A web server already runs on the machine. Choose **Behind my own reverse proxy** and add the Hub to that server. | | "Install Docker (get.docker.com) did not work" | Docker's script does not support this system. Install Docker with [Docker's instructions](https://docs.docker.com/engine/install/), or choose **Native service**. | | "Tailscale sign-in did not finish" | Run `sudo tailscale up`, open the link, then run the installer again. | | "the signature ... does not match" | The download was changed or damaged. Nothing was installed. Try again later; if it stays, report it. | **The Hub stopped answering.** Look at its status and log: | Hub runs in | Status | Log | |---|---|---| | Docker | `cd /opt/postern && sudo docker compose ps` | `cd /opt/postern && sudo docker compose logs -f hub` | | Native service | `systemctl status postern-hub` | `journalctl -u postern-hub -f` | Then run the Hub's own check, which tests the settings, the data and the connections to your mail providers, and says what to change: | Hub runs in | Command | |---|---| | Docker | `cd /opt/postern && sudo docker compose exec hub postern-hub doctor` | | Native service | `sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec /usr/local/bin/postern-hub doctor'` | See [Doctor](https://docs.posternmail.app/admin/doctor/) and [Troubleshooting](https://docs.posternmail.app/troubleshooting/) for what its messages mean. ### Start over or remove the Hub ```sh curl -fsSL https://updates.posternmail.app/install | sudo sh -s -- --uninstall ``` This stops and removes the Hub but keeps your data, the master key and the settings, so installing again brings everything back. It prints the command to delete the data for good, which cannot be undone. ## Installing without questions Every answer has an option, and `--yes` runs the installer without asking anything, for scripts or a second machine. Options go after `sh -s --`: ```sh curl -fsSL https://updates.posternmail.app/install | sudo sh -s -- \ --docker --access domain --domain mail.example.com --email you@example.com --yes ``` | Option | Meaning | |---|---| | `--docker`, `--native` | How the Hub runs. Default: Docker. | | `--access MODE` | `lan`, `domain`, `proxy`, `tailscale` or `cloudflare`. Required with `--yes`. | | `--address HOST` | `lan`: the address devices use. Default: the machine's IP address. | | `--domain NAME` | `domain`, `proxy`, `cloudflare`: the host name. | | `--email ADDRESS` | `domain`: email for certificate notices (optional). | | `--proxy-elsewhere` | `proxy`: the proxy runs on another machine, so the Hub listens on the network. | | `--tunnel-token TOKEN` | `cloudflare`: the tunnel token. Also read from `POSTERN_TUNNEL_TOKEN`. | | `--port N` | The Hub's port on this machine. Default 8080. | | `--dir DIR` | Docker: the folder for `compose.yaml` and `.env`. Default `/opt/postern`. | | `--channel NAME` | `stable` (default) or `beta`. | | `--version X.Y.Z` | Install this version instead of the newest. | | `--yes` | Ask nothing; use the options and the defaults. | | `--update` | Update an installed Hub. | | `--uninstall` | Remove the Hub; data and settings stay. | Tailscale signs in without a browser when the environment variable `TS_AUTHKEY` holds an [auth key](https://tailscale.com/kb/1085/auth-keys). What the installer writes: | | Docker | Native service | |---|---|---| | Program | the image `ghcr.io/theoriuhd/postern-hub` | `/usr/local/bin/postern-hub` | | Settings | `/opt/postern/.env` | `/etc/postern/hub.env` | | Service | `/opt/postern/compose.yaml` | `/etc/systemd/system/postern-hub.service` | | Caddy (domain) | the `caddy` service in `compose.yaml` | `/etc/caddy/postern.caddy`, imported by `/etc/caddy/Caddyfile` | | Cloudflare Tunnel | `/opt/postern/compose.tunnel.yaml` | the `cloudflared` service | | The installer's answers | `/etc/postern/install.conf` | `/etc/postern/install.conf` | Every setting the Hub reads is in [Configuration](https://docs.posternmail.app/configuration/). ## Other ways to install - **Docker Compose by hand:** download [compose.yaml](https://github.com/TheOriUHD/postern/blob/main/deploy/docker/compose.yaml), set the variables in `.env` as described in [Configuration](https://docs.posternmail.app/configuration/), and run `docker compose up -d`. - **Build from source:** see [Build from source and development](https://docs.posternmail.app/development/). - **Inside the desktop app:** the desktop app can run a Hub of its own while it is open, for trying Postern on one computer. See [Desktop app](https://docs.posternmail.app/apps/desktop/). - **macOS:** the installer does not support Macs as servers. A Mac sleeps, and Docker Desktop needs a signed-in user. Use a Linux machine for a Hub that other devices rely on. --- # Set up with an AI agent > Ready-to-copy prompts that let an AI coding agent with shell access install a Postern Hub for you, one per install method, with what it must ask you, what it must never do and how it checks its work. Source: https://docs.posternmail.app/setup-with-ai/ A coding agent with shell access on the Hub's machine (Claude Code, Codex, Gemini CLI, Cursor and similar) can do the [setup guide](https://docs.posternmail.app/setup/) for you. Copy the prompt below into the agent, started on the machine where the Hub should run. The prompt follows the install method chosen in the selector above. The agent asks you a few questions first, then works through the steps and checks each one. You stay in charge of three things it must not do for you: creating your admin account in the browser, storing the master key backup, and connecting your mailboxes. > [!WARNING] > An agent with shell access can change anything your user can change, and with `sudo` > anything at all. Run it on the machine you mean, read the commands it proposes before you > approve them, and do not give it passwords, app passwords or tokens. Nothing in this setup > needs them. ## The prompt **Docker Compose:** ```prompt You are setting up a Postern Hub on this Linux machine with Docker Compose. Postern is a self-hosted mail client; the Hub is its server. No releases or container images are published yet, so you build the image from source. Documentation (plain Markdown, read these before you start and follow them over your own assumptions): - https://docs.posternmail.app/agents.md (rules and facts for agents) - https://docs.posternmail.app/setup.md (the setup guide; follow the "Docker Compose" variant) - https://docs.posternmail.app/llms.txt (index of every page) Before you change anything, ask me in one message: 1. Is this the machine that should run the Hub, and does it stay on? 2. How should my devices reach the Hub: Tailscale (recommended), a reverse proxy with my own domain (which domain?), Cloudflare Tunnel (which hostname?), or my home network only? 3. Which mailboxes do I want to connect (for example Gmail, Outlook, iCloud, an IMAP server)? You only need this to tell me what to prepare; I connect them myself. Then wait for my answers. Do the work in this order, and after every step run its "Check" from the guide and show me the result: 1. Check that Docker Engine 23+ and the Compose plugin work (docker compose version) and that Git is installed. If Docker is missing, tell me and point me to https://docs.docker.com/engine/install/ instead of piping a script into a shell. 2. git clone https://github.com/TheOriUHD/postern.git ~/postern-src 3. In ~/postern-src: docker build -f deploy/docker/Dockerfile -t ghcr.io/theoriuhd/postern-hub:local --build-arg VERSION="$(git describe --tags --always)" --build-arg COMMIT="$(git rev-parse HEAD)" . 4. mkdir -p ~/postern, copy deploy/docker/compose.yaml there, write .env with POSTERN_VERSION=local, run docker compose up -d. Check: docker compose ps shows (healthy) and curl -fsS http://127.0.0.1:8080/api/v1/info answers. 5. Set up the access method I chose, following https://docs.posternmail.app/reach.md and its sub-page. Set POSTERN_PUBLIC_URL to the exact address I will use, and POSTERN_TRUST_PROXY=true only if a proxy or tailscale serve sits in front. Variables that compose.yaml does not pass through go in ~/postern/compose.override.yaml. Apply with docker compose up -d. 6. Run: docker compose exec hub postern-hub doctor and fix every problem it reports that is within this setup. 7. Tell me how to open the setup page (the public address, or ssh -L 8080:127.0.0.1:8080 to this machine) and the command that shows the setup code (docker compose exec hub postern-hub setup-code), so I can create my admin account myself. 8. Tell me to back up the master key, with the command (docker compose cp hub:/key/hub.key ./hub.key.backup) and the reminder to move it off this machine and delete the local copy. Never: - publish the Hub's plain HTTP port to the internet (no POSTERN_BIND=8080 or 0.0.0.0 on a machine with a public address, no router port forwarding to 8080, no tailscale funnel unless I ask for it); - print, copy into chat, log or commit secrets: the master key, the setup code, POSTERN_*_SECRET values, tokens, passwords; - skip or weaken a checksum, signature or TLS verification, or pipe a downloaded script into a shell without showing it to me first; - set POSTERN_DEV, run postern-hub keygen --force, or delete Docker volumes (postern_postern-data, postern_postern-key); - create the admin account, choose passwords for me, or enter mailbox credentials. When something fails, read the logs (docker compose logs hub), look it up in https://docs.posternmail.app/troubleshooting.md, and explain the cause before you try a fix. Finish with a short report: what you installed and where, the Hub's address, the output of doctor, and what I still have to do. ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```prompt You are setting up a Postern Hub on this Linux machine as a systemd service. Postern is a self-hosted mail client; the Hub is its server. No releases or packages are published yet, so you build the Hub from source. Documentation (plain Markdown, read these before you start and follow them over your own assumptions): - https://docs.posternmail.app/agents.md (rules and facts for agents) - https://docs.posternmail.app/setup.md (the setup guide; follow the variant for this distribution: "Debian and Ubuntu", "Fedora and RHEL" or "Raspberry Pi OS") - https://docs.posternmail.app/llms.txt (index of every page) Before you change anything, ask me in one message: 1. Is this the machine that should run the Hub, and does it stay on? 2. How should my devices reach the Hub: Tailscale (recommended), a reverse proxy with my own domain (which domain?), Cloudflare Tunnel (which hostname?), or my home network only? 3. Which mailboxes do I want to connect (for example Gmail, Outlook, iCloud, an IMAP server)? You only need this to tell me what to prepare; I connect them myself. Then wait for my answers. Do the work in this order, and after every step run its "Check" from the guide and show me the result: 1. Confirm the system: uname -m must be x86_64 or aarch64 (on a Raspberry Pi, a 64-bit OS), systemd must be running. 2. Install git, curl, jq, xz and tar with the system package manager (apt or dnf). Install Go (1.27 or newer) from https://go.dev/dl/ and Node.js 24 from https://nodejs.org/dist/latest-v24.x/ exactly as the guide shows, verifying each download's SHA-256 against the published checksum before unpacking, then enable pnpm with corepack. 3. git clone https://github.com/TheOriUHD/postern.git ~/postern, then in ~/postern: pnpm install --frozen-lockfile --filter "@postern/web..." and scripts/build-hub.sh. Check: hub/bin/postern-hub version. 4. Install it as the guide's step 4 shows: binary to /usr/local/bin/postern-hub, system user and group postern, /etc/postern (root:postern 0750) with hub.env from deploy/systemd/hub.env (0640, only if it does not exist yet), /var/lib/postern and /var/lib/postern-key (postern, 0700), the unit from deploy/systemd/postern-hub.service with ExecStart changed to /usr/local/bin/postern-hub, then systemctl daemon-reload and enable --now. Check: systemctl status and curl -fsS http://127.0.0.1:8080/api/v1/info. 5. Set up the access method I chose, following https://docs.posternmail.app/reach.md and its sub-page. Keep POSTERN_LISTEN=127.0.0.1:8080 unless I chose home network only. Set POSTERN_PUBLIC_URL in /etc/postern/hub.env to the exact address I will use, and POSTERN_TRUST_PROXY=true only if a proxy or tailscale serve sits in front. Restart with systemctl restart postern-hub. 6. Run doctor as the service user: sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec /usr/local/bin/postern-hub doctor' and fix every problem it reports that is within this setup. 7. Tell me how to open the setup page (the public address, or ssh -L 8080:127.0.0.1:8080 to this machine) and the command that shows the setup code (the same sudo form with setup-code), so I can create my admin account myself. 8. Tell me to back up the master key /var/lib/postern-key/hub.key: give me the command to copy it to my home folder with mode 0600, and remind me to move it off this machine and delete the local copy. Never: - expose the Hub's plain HTTP port to the internet (no POSTERN_LISTEN=0.0.0.0 on a machine with a public address, no firewall rule or router forwarding for 8080, no tailscale funnel unless I ask for it); - print, copy into chat, log or commit secrets: the master key, the setup code, POSTERN_*_SECRET values, tokens, passwords; - skip or weaken a checksum, signature or TLS verification, or pipe a downloaded script into a shell without showing it to me first; - set POSTERN_DEV, run postern-hub keygen --force, or delete /var/lib/postern or /var/lib/postern-key; - use sudo where it is not needed (building runs as my user), or disable SELinux or the firewall; - create the admin account, choose passwords for me, or enter mailbox credentials. When something fails, read the logs (sudo journalctl -u postern-hub -n 100 --no-pager), look it up in https://docs.posternmail.app/troubleshooting.md, and explain the cause before you try a fix. Finish with a short report: what you installed and where, the Hub's address, the output of doctor, and what I still have to do. ``` **Desktop app (built-in Hub):** ```prompt You are building the Postern desktop app from source on this computer, so that I can use its built-in Hub ("No server? Run a Hub on this computer"). Postern is a self-hosted mail client. No signed installers are published yet. Documentation (plain Markdown, read these before you start and follow them over your own assumptions): - https://docs.posternmail.app/agents.md (rules and facts for agents) - https://docs.posternmail.app/setup.md (the setup guide; follow the "Desktop app (built-in Hub)" variant) - https://docs.posternmail.app/apps/desktop.md (building and installing the desktop app) Before you change anything, tell me in one message what the built-in Hub can and cannot do (it runs only while the app is open, only this computer can reach it, phones cannot connect to it) and ask whether that is what I want, or whether I would rather run the Hub on a server. Then wait for my answer. Then: 1. Check the tools: git, Go 1.27 or newer, Node.js 24, pnpm 11 (via corepack enable). On Windows use Git Bash. If something is missing, tell me which official installer to use (git-scm.com, go.dev/dl, nodejs.org); do not install toolchains from unofficial sources. 2. git clone https://github.com/TheOriUHD/postern.git and, inside it: pnpm install, scripts/build-hub.sh --web-only, pnpm --filter @postern/desktop bundle-hub, pnpm --filter @postern/desktop dist. 3. Check that apps/desktop/release/ holds the installer for this system, and tell me which file to open and what macOS or Windows will say about an unsigned app. 4. Tell me to open Postern, choose "No server? Run a Hub on this computer", create my account, and then copy hub-key/hub.key from the app's data folder to a safe place. Never: - print, copy into chat, log or commit secrets: the master key, tokens, passwords; - skip or weaken a checksum, signature or TLS verification, or pipe a downloaded script into a shell without showing it to me first; - use sudo or administrator rights except where the documentation says so; - create my account, choose passwords for me, or enter mailbox credentials. When something fails, explain the cause before you try a fix. Finish with a short report: what you built, where the installer is, and what I still have to do. ``` ## What the agent will ask you | Question | Why | |---|---| | Is this the right machine? | The Hub should run on a machine that stays on. | | How do your devices reach the Hub? | Decides between Tailscale, a reverse proxy, Cloudflare Tunnel and LAN only, and with that `POSTERN_PUBLIC_URL`. See [Reaching your Hub](https://docs.posternmail.app/reach/). | | Which mailboxes? | Some providers need preparation, such as an app password or your own OAuth app. See [Connect mailboxes](https://docs.posternmail.app/providers/). | ## What stays with you - **Creating the admin account.** You open the setup page, enter the setup code and choose your password. The agent only tells you where. - **The master key backup.** The agent gives you the command; you move the copy somewhere safe, apart from your data backups. - **Mailboxes and devices.** You connect mailboxes and pair your phone in the apps. ## After the agent is done Read its report, then check the result yourself: **Docker Compose:** ```sh cd ~/postern docker compose ps docker compose exec hub postern-hub doctor ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh systemctl status postern-hub --no-pager sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub doctor' ``` **Desktop app (built-in Hub):** Open Postern and choose **No server? Run a Hub on this computer**. The setup page opens in the app window. Then continue with [step 5 of the setup guide](https://docs.posternmail.app/setup/#5-create-your-admin-account). ## Writing your own prompt If you adapt the prompt, keep its three parts: what to ask first, the order of steps with a check after each, and the list of things never to do. [For AI agents](https://docs.posternmail.app/agents/) has the facts an agent needs (paths, commands, invariants) in one page, and every page of these docs is available as Markdown at its address with `.md`, so an agent can read exactly what you read. --- # Reaching your Hub > How your devices reach the Hub, why it only listens on 127.0.0.1 by default, and how to choose between Tailscale, a reverse proxy, Cloudflare Tunnel, LAN only and the Hub's own TLS. Source: https://docs.posternmail.app/reach/ This page explains how your phone, your laptop and your browser get to the Hub, compares the ways to make that happen and helps you pick one. Each way has its own step-by-step page. ## With the installer The [installer](https://docs.posternmail.app/setup/) asks how you want to reach the Hub and sets it up. Each choice has a page here for doing the same by hand, or for changing it: | Installer choice | What it sets up | By hand | |---|---|---| | **This machine's address on your network** | The Hub listens on the network at `http://
:8080`. | [LAN only](https://docs.posternmail.app/reach/lan/) | | **A domain with HTTPS (Caddy)** | Caddy in front of the Hub, with a Let's Encrypt certificate. | [Reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/#caddy) | | **Behind my own reverse proxy** | The Hub's side; it prints what to add to your proxy. | [Reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/) | | **Only on Tailscale** | Tailscale and `tailscale serve`, at `https://..ts.net`. | [Tailscale](https://docs.posternmail.app/reach/tailscale/) | | **Cloudflare Tunnel** | `cloudflared` with your tunnel token. | [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/) | To switch, run the installer again and choose **Change how it is set up**. Your data and accounts stay. Passkeys are tied to the Hub's domain, so they stop working when the domain changes: see [Changing the domain later](https://docs.posternmail.app/reach/https/#changing-the-domain-later). ## Why the Hub only listens on 127.0.0.1 After a fresh install the Hub answers only on the machine it runs on: **Docker Compose:** `compose.yaml` publishes the Hub's port as `127.0.0.1:8080` on the host (the `POSTERN_BIND` setting in `.env`: `/opt/postern/.env` with the installer, `~/postern/.env` in these pages). Inside the container the Hub listens on `:8080`, but Docker only forwards connections that arrive on the host's loopback address. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** The systemd unit and `/etc/postern/hub.env` set `POSTERN_LISTEN=127.0.0.1:8080`. Only programs on the same machine can connect. **Desktop app (built-in Hub):** The desktop app starts its built-in Hub on `127.0.0.1` with a port it picks itself, and sets the Hub's address to `http://localhost:`. Nothing outside your computer can connect to it, and none of the options on this page change that. If you want your phone or a second computer to use your Hub, move the Hub to a server: see [Set up Postern](https://docs.posternmail.app/setup/). The rest of this page is about Hubs installed with Docker or systemd. This is on purpose. Out of the box the Hub speaks plain HTTP, and plain HTTP carries your password, your session and your mail readable by anyone on the way. A Hub that is reachable before you finish the setup wizard can also be claimed by someone else (the setup code protects against that, but there is no reason to take the chance). So the Hub stays private until you put something in front of it that adds encryption, or decide that your home network is enough. The Hub never needs inbound connections for mail. It connects out to your mail providers and to the push relay. That is why it works behind a home router, behind CGNAT and on a laptop. The only thing that needs a way in is your own devices. ## The options | | [Tailscale](https://docs.posternmail.app/reach/tailscale/) | [Reverse proxy and a domain](https://docs.posternmail.app/reach/reverse-proxy/) | [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/) | [LAN only](https://docs.posternmail.app/reach/lan/) | [Built-in TLS](https://docs.posternmail.app/reach/https/) | |---|---|---|---|---|---| | **Who can reach the Hub** | Only devices signed in to your tailnet | Anyone on the internet (then the Hub's sign-in) | Anyone on the internet, or only you with Cloudflare Access | Devices on your home network | Anyone on the internet | | **HTTPS** | Yes, a real certificate for `*.ts.net` | Yes (Let's Encrypt through Caddy, certbot or Traefik) | Yes, Cloudflare's certificate | No | Yes (Let's Encrypt, or your own certificate) | | **Passkeys, Google sign-in, Web Push** | Yes | Yes | Yes | No | Yes | | **Phones away from home** | Yes, with the Tailscale app on the phone | Yes | Yes | No | Yes | | **Open ports on your router** | None | 80 and 443 | None | None | 80 and 443 | | **You need** | A free Tailscale account | A domain, a public IP address | A domain on Cloudflare | Nothing | A domain, a public IP address | | **Who sees your traffic** | Nobody (end to end WireGuard) | Nobody | Cloudflare (it decrypts in transit) | Anyone on your network | Nobody | | **Effort** | Low | Medium | Medium | Lowest | Medium | [HTTPS and passkeys](https://docs.posternmail.app/reach/https/) also covers your own certificates and why self-signed certificates do not work with the apps. ## What needs HTTPS Several features only work when the Hub is reached over HTTPS, or on `localhost` of the same machine: | Feature | Without HTTPS | Why | |---|---|---| | **Passkeys** | Not offered. Settings → Security says "Passkeys only work when your Hub is opened over a secure (https) address." The Hub answers a passkey request with "Passkeys need a secure connection: open the Hub over HTTPS (set POSTERN_PUBLIC_URL) or via localhost." | Browsers only allow WebAuthn in a secure context, bound to a domain name. The Hub never offers passkeys on an IP address, even over HTTPS. | | **Google sign-in for Gmail** (your own OAuth client) | "Google sign-in needs the Hub to be reachable over HTTPS (or on localhost). Use an app password with IMAP instead, or set up HTTPS." | Google only accepts `https://` redirect addresses, or loopback. | | **Microsoft sign-in in the browser** | "Microsoft sign-in in the browser needs the Hub to be reachable over HTTPS (or on localhost). Use the sign-in with a code instead." | Same rule for redirect addresses. The code sign-in still works. | | **Web Push** (browser notifications) and the web app's service worker | The browser does not offer them. | Browsers only allow both in a secure context. | | **Phones** | Possible only on your home network, and with limits (see [LAN only](https://docs.posternmail.app/reach/lan/)). | iOS and Android refuse plain HTTP to most addresses. | Password with TOTP works everywhere, also over plain HTTP. ## Two settings you need with every option ### POSTERN_PUBLIC_URL The address people type to open your Hub: scheme, host name and, if it is not 443 or 80, the port. No trailing slash, no path. Examples: `https://mail.example.com`, `https://hub.tailnet-1234.ts.net`, `http://192.168.1.20:8080`. The Hub uses it for: - links in invites and in pairing QR codes, - the redirect addresses for Google, Microsoft and single sign-on, - passkeys (the host name becomes the passkey's domain), - the same-origin check that protects every change you make in the web app. A request whose `Origin` does not match this host is refused with "Cross-origin request rejected". When it is empty the Hub guesses the address from each request. That works on `localhost`, but invite links then use whatever address the inviting browser used, passkeys only work on localhost, and `postern-hub doctor` warns: "POSTERN_PUBLIC_URL is not set: invite and pairing links use whatever address a browser used, and passkeys only work on localhost". The Hub refuses to start with a value that is not an absolute `http://` or `https://` URL: ```text error: POSTERN_PUBLIC_URL must be an absolute http(s) URL, got "mail.example.com" ``` ### POSTERN_TRUST_PROXY Off by default. Turn it on (`true`) when something in front of the Hub passes requests on to it: `tailscale serve`, Caddy, nginx, Traefik or `cloudflared`. The Hub then believes the `X-Forwarded-Proto`, `X-Forwarded-Host` and `X-Forwarded-For` headers that the proxy adds, so it knows that the browser used HTTPS, which host name it used, and which IP address the visitor has (for rate limits, the security log and the device list). It only believes those headers from the addresses in `POSTERN_TRUSTED_PROXIES` (by default loopback and private networks: `127.0.0.0/8,::1/128,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7`). Leave `POSTERN_TRUST_PROXY` off when nothing proxies the Hub, for example with [LAN only](https://docs.posternmail.app/reach/lan/) or [built-in TLS](https://docs.posternmail.app/reach/https/). Otherwise any device that talks to the Hub directly could claim to be someone else. The full rules are in [Configuration](https://docs.posternmail.app/configuration/). ### Where to set them **Docker Compose:** Both are passed through by `compose.yaml`, so they go into `~/postern/.env`: ```sh POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=true ``` Apply with: ```sh cd ~/postern && docker compose up -d ``` Other variables (`POSTERN_TRUSTED_PROXIES`, `POSTERN_CLIENT_IP_HEADER`, the TLS and Access settings) are not passed through by `compose.yaml`. Put them into `~/postern/compose.override.yaml`: ```yaml services: hub: environment: POSTERN_CLIENT_IP_HEADER: CF-Connecting-IP ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Edit `/etc/postern/hub.env`: ```sh sudoedit /etc/postern/hub.env ``` ```ini POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=true ``` One `KEY=value` per line, and no comments after a value (systemd would keep them as part of the value). Apply with: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** The desktop app sets these itself and you cannot change them. Its Hub is only for this computer. ## How to decide 1. **Do you only want to use Postern on one computer?** The desktop app's built-in Hub is enough. You do not need anything on this page. 2. **Should only your own devices reach the Hub?** Use [Tailscale](https://docs.posternmail.app/reach/tailscale/). It is the recommended choice: nothing is exposed to the internet, you get a real certificate, and it works on phones on mobile data. Everyone who uses the Hub needs the Tailscale app. 3. **Do you want a normal web address that works from any browser, without an app?** Use a [reverse proxy with your own domain](https://docs.posternmail.app/reach/reverse-proxy/) if you can open ports 80 and 443 on your router or run the Hub on a VPS. If you cannot open ports (CGNAT, a landlord's router), use [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/) and accept that Cloudflare sees the traffic. Add Cloudflare Access to keep strangers away from the sign-in page. 4. **Is the Hub on a server with a public IP and nothing else on ports 80 and 443?** The Hub's [built-in TLS](https://docs.posternmail.app/reach/https/) saves you a separate proxy. 5. **Is everything at home and you do not care about passkeys or Google sign-in?** [LAN only](https://docs.posternmail.app/reach/lan/) is the quickest. Phones only sync at home. You can change your mind later. Switching means a new `POSTERN_PUBLIC_URL`. Two things move with it: devices must be pointed at the new address (sign them in again or pair them again), and passkeys are tied to the old host name, so add new ones. See [Changing the domain later](https://docs.posternmail.app/reach/https/#changing-the-domain-later). ## Check what the Hub thinks Two places show how the Hub sees itself: - In the web app, **Settings → Admin → Status** lists **Web address** (your `POSTERN_PUBLIC_URL` or "Not set") and **Secure connection (https)**. Warnings appear above, for example "No HTTPS public URL: passkeys and Google sign-in unavailable." - `postern-hub doctor` fetches `POSTERN_PUBLIC_URL/api/v1/info` from the server itself and checks the certificate: **Docker Compose:** ```sh cd ~/postern && docker compose exec hub postern-hub doctor ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub doctor' ``` **Desktop app (built-in Hub):** Not available for the built-in Hub. Its address is always `http://localhost:`. Look at the **Network** section: ```text Network ✓ https://mail.example.com is reachable (Hub 0.9.0) ✓ TLS certificate for mail.example.com valid until 2027-03-02 ``` `✓` is fine, `!` is a warning, `✗` is a problem. More about the report: [Doctor](https://docs.posternmail.app/admin/doctor/). --- # Reach your Hub with Tailscale > Reach your Hub from your own devices over Tailscale, with a real HTTPS certificate and nothing exposed to the internet. Source: https://docs.posternmail.app/reach/tailscale/ This page puts your Hub on your Tailscale network (your "tailnet"), so every device you sign in to Tailscale reaches it at an address like `https://hub.tailnet-1234.ts.net`, with a valid certificate, while nobody else on the internet can connect at all. It is the recommended way for most people. For other options see [Reaching your Hub](https://docs.posternmail.app/reach/). > [!TIP] > **Used the [installer](https://docs.posternmail.app/setup/)?** It does this for you when you choose **Only on > Tailscale**. It installs Tailscale if needed, signs the machine in, runs `tailscale serve` and > sets the Hub's address. To switch later, run the installer again and choose **Change how it is > set up**. > This page is for doing it by hand, or for understanding what was set up. With the installer, the > Docker files are in `/opt/postern` instead of `~/postern`, and the program is > `/usr/local/bin/postern-hub`. What you get: - HTTPS with a real certificate, so passkeys, Google sign-in and Web Push work. - No open ports on your router. It also works behind CGNAT. - Phones reach the Hub on mobile data, as long as the Tailscale app is connected. - Push notifications keep working, because the Hub sends them over outbound connections. What it costs: every person and every device that uses the Hub needs the Tailscale app and a Tailscale login (your own, or a machine you share with them). Tailscale's free plan covers a household. **Docker Compose:** You need Tailscale on the **host** that runs Docker, not in the container. `tailscale serve` forwards to `127.0.0.1:8080`, which `compose.yaml` publishes by default. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** You need Tailscale on the machine that runs the Hub. `tailscale serve` forwards to `127.0.0.1:8080`, where the Hub listens by default. **Desktop app (built-in Hub):** This does not work with the desktop app's built-in Hub: it only accepts connections from your own computer, and its address is fixed to `http://localhost:`. To reach a Hub from your phone, run it on a server (a Raspberry Pi is enough) as described in [Set up Postern](https://docs.posternmail.app/setup/), then come back to this page and pick that method above. ## 1. Turn on MagicDNS and HTTPS in your tailnet 1. Create a Tailscale account at if you do not have one. 2. Open the [admin console](https://login.tailscale.com/admin/dns), page **DNS**. 3. Turn on **MagicDNS** if it is off. It gives every machine a name like `hub.tailnet-1234.ts.net`. 4. Further down, under **HTTPS Certificates**, select **Enable HTTPS**. The part `tailnet-1234.ts.net` is your tailnet's DNS name. It is shown at the top of the DNS page. > [!NOTE] > Certificates are public. When Tailscale issues one, the machine's full name > (`hub.tailnet-1234.ts.net`) appears in public Certificate Transparency logs. The Hub itself > stays unreachable from outside your tailnet, but pick a machine name you do not mind being > seen. > **Check:** the DNS page shows MagicDNS as enabled and HTTPS Certificates as enabled. > **If it did not work:** only the tailnet's Owner or an Admin can change DNS settings. Ask > them, or use your own tailnet. ## 2. Install Tailscale on the Hub machine **Docker Compose:** Install Tailscale on the Docker host with Tailscale's install script. It detects the distribution and adds Tailscale's own package repository (apt on Debian, Ubuntu and Raspberry Pi OS, dnf on Fedora), so later updates come with your normal system updates: ```sh curl -fsSL https://tailscale.com/install.sh | sh ``` If you prefer to add the repository by hand, follow the instructions for your distribution linked from . **Debian and Ubuntu and Raspberry Pi OS:** Install Tailscale with its install script. On Debian, Ubuntu and Raspberry Pi OS it adds Tailscale's apt repository and installs the `tailscale` package, so updates come with `sudo apt upgrade`: ```sh curl -fsSL https://tailscale.com/install.sh | sh ``` You can read the script first (), or add the apt repository by hand following the instructions for your release linked from . **Fedora and RHEL:** Install Tailscale with its install script. On Fedora it adds Tailscale's dnf repository and installs the `tailscale` package, so updates come with `sudo dnf upgrade`: ```sh curl -fsSL https://tailscale.com/install.sh | sh ``` You can read the script first (), or add the dnf repository by hand following the Fedora instructions linked from . **Desktop app (built-in Hub):** Not applicable to the built-in Hub. Then start Tailscale and sign in. The command prints a link; open it in any browser and sign in with your Tailscale account: **Docker Compose, Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo systemctl enable --now tailscaled sudo tailscale up ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. Give the machine a short name in the admin console (**Machines** → the machine → **Edit machine name**), for example `hub`. That name becomes the first part of the Hub's address. > **Check:** `tailscale status` lists the machine with a `100.x.y.z` address, and the admin > console shows it as connected. > > ```sh > tailscale status > ``` > **If it did not work:** `sudo systemctl status tailscaled` shows why the daemon does not run. > If `tailscale up` hangs, the machine cannot reach Tailscale's servers: check the clock > (`timedatectl`) and outbound internet access. ## 3. Keep the Hub on localhost The Hub should keep listening on `127.0.0.1:8080` only, which is the default. Tailscale forwards to it from the same machine, so nothing else needs to reach port 8080. **Docker Compose:** In `~/postern/.env`, `POSTERN_BIND` should be missing or `127.0.0.1:8080`: ```sh grep POSTERN_BIND ~/postern/.env ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** In `/etc/postern/hub.env`, `POSTERN_LISTEN` should be `127.0.0.1:8080`: ```sh sudo grep POSTERN_LISTEN /etc/postern/hub.env ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** on the Hub machine, `curl -s http://127.0.0.1:8080/api/v1/info` prints a short JSON > document with `"apiVersion":1` and your Hub's name. > > ```sh > curl -s http://127.0.0.1:8080/api/v1/info > ``` > **If it did not work:** the Hub is not running. Start it and look at its log (see > [Troubleshooting](https://docs.posternmail.app/troubleshooting/#the-hub-does-not-start)). ## 4. Serve the Hub over HTTPS on your tailnet On the Hub machine: **Docker Compose, Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo tailscale serve --bg 8080 ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. This tells Tailscale to accept HTTPS on port 443 of the machine's tailnet address and pass the requests to `http://127.0.0.1:8080`. `--bg` keeps it running in the background and across reboots. Tailscale gets the certificate for the MagicDNS name by itself and renews it. It forwards WebSockets (the Hub's live updates on `/api/v1/ws`) without extra settings, and it adds the `X-Forwarded-*` headers the Hub reads. See what is served: ```sh tailscale serve status ``` It lists the HTTPS address (`https://hub.tailnet-1234.ts.net`), notes that it is reachable from the tailnet only, and shows that `/` is proxied to `http://127.0.0.1:8080`. > **Check:** from another device in your tailnet (your laptop with Tailscale connected), open > `https://hub.tailnet-1234.ts.net` in a browser. The Hub's sign-in page (or the setup wizard) > appears, with a valid padlock. The first request can take a few seconds while Tailscale gets > the certificate. > **If it did not work:** > - "HTTPS is not enabled" or a certificate error: step 1 is not done, or MagicDNS is off. > - The name does not resolve: the other device is not connected to Tailscale, or it uses > another tailnet. Run `tailscale status` there. > - "502 Bad Gateway": the Hub does not listen on `127.0.0.1:8080` (step 3). > - To undo everything and start over: `sudo tailscale serve reset`. ## 5. Tell the Hub its address Set the public URL to the exact address from `tailscale serve status`, and tell the Hub that a proxy is in front of it: **Docker Compose:** Add to `~/postern/.env`: ```sh POSTERN_PUBLIC_URL=https://hub.tailnet-1234.ts.net POSTERN_TRUST_PROXY=true ``` Apply: ```sh cd ~/postern && docker compose up -d ``` `tailscale serve` connects to the published port, so the Hub sees the request coming from Docker's network gateway (a private address such as `172.17.0.1`). The default `POSTERN_TRUSTED_PROXIES` already trusts private networks, so leave it unset. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add to `/etc/postern/hub.env` (`sudoedit /etc/postern/hub.env`): ```ini POSTERN_PUBLIC_URL=https://hub.tailnet-1234.ts.net POSTERN_TRUST_PROXY=true POSTERN_TRUSTED_PROXIES=127.0.0.1,::1 ``` `tailscale serve` connects from the same machine, so only loopback has to be trusted. Apply: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** run `postern-hub doctor` (see [Doctor](https://docs.posternmail.app/admin/doctor/) for the command for your > install). The **Network** section shows `✓ https://hub.tailnet-1234.ts.net is reachable` and a > valid certificate. In the web app, **Settings → Admin → Status** shows the address and > **Secure connection (https)**: **Yes**. > **If it did not work:** > - Saving anything in the web app fails with "Cross-origin request rejected": > `POSTERN_PUBLIC_URL` does not match the address in the browser, or `POSTERN_TRUST_PROXY` > is missing. Compare letter by letter with `tailscale serve status`. > - doctor says "is not reachable from this machine": the Hub machine itself must be able to > resolve its MagicDNS name. Check that `tailscale status` works on it and that MagicDNS is on. ## 6. Finish setup and connect your apps If you have not set up the Hub yet, open `https://hub.tailnet-1234.ts.net` and follow the setup wizard with the setup code from the Hub's log ([Set up Postern](https://docs.posternmail.app/setup/)). Then, on every device that should use Postern: 1. Install Tailscale and sign in to the same tailnet. On phones, use the Tailscale app from the App Store or Google Play and leave it connected (Tailscale's VPN switch on). 2. Open the Postern app and connect to `https://hub.tailnet-1234.ts.net`, or pair it with a QR code from a device that is already signed in ([Pairing](https://docs.posternmail.app/apps/pairing/)). To let family members in without adding them to your tailnet, share the Hub machine with them from the admin console (**Machines** → the machine → **Share**). They see only that machine. > **Check:** the phone shows your inbox with Tailscale connected on mobile data (Wi-Fi off). > **If it did not work:** see [Phones away from home](https://docs.posternmail.app/reach/tailscale/#phones-away-from-home) below. ## Phones away from home The phone reaches the Hub only while the Tailscale app is connected. If you turn Tailscale off, the Postern app keeps working with the mail it has (it talks to your mail providers directly), and syncs settings with the Hub again when Tailscale is back. See [Offline and direct mode](https://docs.posternmail.app/apps/offline/). **Push notifications still arrive** with Tailscale off. The Hub sends a wake-up to the push relay over an ordinary outbound connection, and the relay passes it on through Apple or Google. Nothing has to reach the Hub from outside for that. See [Push relay](https://docs.posternmail.app/relay/). ## Tailscale Funnel: use with care `tailscale funnel` makes a port reachable from the **public internet**, not only from your tailnet. Postern does not need it: apps reach the Hub over the tailnet, and push goes out through the relay. Use Funnel only if you have a reason to open the Hub to everyone (for example a browser you cannot install Tailscale on), and then only if every account uses a strong password with TOTP or a passkey and you keep the Hub up to date. If you do, the Hub is as exposed as with a public [reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/); read [Hardening](https://docs.posternmail.app/security/hardening/). ## Remove it again ```sh sudo tailscale serve reset ``` Then remove `POSTERN_PUBLIC_URL` and `POSTERN_TRUST_PROXY` (or replace them for your next option) and restart the Hub. --- # Reach your Hub through a reverse proxy > Put Caddy, nginx or Traefik in front of the Hub to reach it at your own domain over HTTPS, with the full configuration files, firewall commands and checks. Source: https://docs.posternmail.app/reach/reverse-proxy/ This page publishes your Hub at your own domain, for example `https://mail.example.com`, with a certificate from Let's Encrypt. A reverse proxy (Caddy, nginx or Traefik) accepts HTTPS from the internet and passes requests to the Hub on `127.0.0.1:8080`. Use this when you want a normal web address that works in any browser without installing anything. For other options see [Reaching your Hub](https://docs.posternmail.app/reach/). > [!TIP] > **Used the [installer](https://docs.posternmail.app/setup/)?** It does this for you when you choose **A domain with > HTTPS (Caddy)**. It installs Caddy and writes its configuration. With **Behind my own reverse > proxy** it sets up the Hub's side and prints what to add to your proxy. To switch later, run the > installer again and choose **Change how it is set up**. > This page is for doing it by hand, or for understanding what was set up. With the installer, the > Docker files are in `/opt/postern` instead of `~/postern`, and the program is > `/usr/local/bin/postern-hub`. You need: - a domain (or subdomain) whose DNS you control, - a public IP address on the Hub machine, or a router where you can forward ports 80 and 443 to it (not possible behind CGNAT: use [Tailscale](https://docs.posternmail.app/reach/tailscale/) or [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/) then), - nothing else listening on ports 80 and 443 on that machine, unless it is the proxy you configure here. Once this works, the Hub's sign-in page is on the public internet. That is fine for a Hub that is kept up to date and whose users have strong passwords with TOTP or passkeys. Read [Hardening](https://docs.posternmail.app/security/hardening/) too. **Docker Compose:** With Docker Compose the simplest path is the `caddy` profile that is already in `compose.yaml` (step 3, Caddy). nginx or Traefik on the host work too. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Pick one proxy. **Caddy** is the least work: it gets and renews certificates by itself. Take nginx if you already run it, or Traefik if you already run it. **Desktop app (built-in Hub):** This does not work with the desktop app's built-in Hub: it only accepts connections from your own computer, and its address is fixed to `http://localhost:`. To reach a Hub from other devices, run it on a server as described in [Set up Postern](https://docs.posternmail.app/setup/), then pick that method above. ## Requirements for any proxy The ready-made configurations below do all of this. If you write your own, it must: | Requirement | Why | Hub setting | |---|---|---| | Pass WebSocket upgrades on `/api/v1/ws` (`Upgrade` and `Connection` headers, HTTP/1.1 to the Hub) | Live updates in the web and desktop apps. Without it, new mail only appears after a reload. | none | | Pass the original `Host` header, or set `X-Forwarded-Host` | The Hub's same-origin check compares the browser's `Origin` with this host. | `POSTERN_PUBLIC_URL`, `POSTERN_TRUST_PROXY=true` | | Set `X-Forwarded-Proto: https` | So the Hub knows the browser used HTTPS (security headers, HSTS). | `POSTERN_TRUST_PROXY=true` | | Set `X-Forwarded-For` (appending to what is there) or `X-Real-IP` | The visitor's IP for rate limits, the security log and the device list. | `POSTERN_TRUSTED_PROXIES` | | Allow request bodies of at least 30 MB | Attachments up to `POSTERN_MAX_UPLOAD_MB` (25 MB by default) plus MIME overhead. Raise both together. | `POSTERN_MAX_UPLOAD_MB` | | Keep WebSocket connections open for an hour or more | Clients ping every 30 seconds; the Hub closes a connection after 2 minutes of silence. A proxy timeout of 60 seconds drops it constantly. | none | | Do not buffer responses or uploads | Downloads and uploads stream through. | none | | No password prompt (HTTP basic authentication) in front of the Hub | The apps cannot pass it. The desktop app says "asks for a password first". Use Tailscale or Cloudflare Access instead. | none | The Hub sets its own security headers (HSTS, `X-Frame-Options`, `Referrer-Policy` and others). Do not add a second, different set in the proxy. ### POSTERN_TRUSTED_PROXIES With `POSTERN_TRUST_PROXY=true` the Hub reads the visitor's IP from the forwarding headers, but only for requests that come from an address in `POSTERN_TRUSTED_PROXIES`. It reads `X-Forwarded-For` from the right and takes the first address that is not a trusted proxy, so an address a visitor makes up on the left is never used. The default trusts loopback and private networks (`127.0.0.0/8,::1/128,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7`). | Setup | Setting | |---|---| | Proxy on the same machine, Hub installed with systemd | `POSTERN_TRUSTED_PROXIES=127.0.0.1,::1` | | Hub in Docker, proxy on the host or in the same Compose project | leave it unset (Docker's networks are private addresses) | | Proxy on another machine | that machine's IP address, for example `192.168.1.5` | ## 1. Point your domain at the server At your DNS provider, create records for the name you want to use: | Type | Name | Value | |---|---|---| | `A` | `mail` (for `mail.example.com`) | the server's public IPv4 address | | `AAAA` | `mail` | the server's public IPv6 address, if it has one | At home, the public IPv4 address is your router's. Find it with `curl -4 https://ifconfig.me` on the Hub machine. If it changes from time to time, use your router's dynamic DNS feature or your DNS provider's updater. Only add an `AAAA` record if IPv6 actually reaches the server; a wrong one breaks certificates for clients that prefer IPv6. > **Check:** `dig +short mail.example.com` (or `nslookup mail.example.com`) prints the address > you entered. DNS changes can take a few minutes. > **If it did not work:** check for typos in the record name. Some DNS providers want the full > name (`mail.example.com.`), others only the part before the domain. ## 2. Open ports 80 and 443 Let's Encrypt checks your domain over port 80 (or 443), and visitors use 443. At home, forward TCP ports 80 and 443 on your router to the Hub machine's LAN address (give it a fixed address in the router first, see [LAN only](https://docs.posternmail.app/reach/lan/#1-give-the-hub-a-fixed-address)). Never forward port 8080: that is the Hub's plain HTTP port. Then open the ports in the machine's firewall: **Docker Compose:** With the Caddy profile or Traefik, Docker publishes ports 80 and 443 and adds its own firewall rules for them. Docker's rules bypass ufw and firewalld, so there is nothing to open. With nginx on the host, open the ports like on any server: on Debian, Ubuntu or Raspberry Pi OS, if you use ufw: ```sh sudo ufw allow 80/tcp sudo ufw allow 443/tcp ``` On Fedora (firewalld): ```sh sudo firewall-cmd --permanent --add-service=http --add-service=https sudo firewall-cmd --reload ``` **Debian and Ubuntu and Raspberry Pi OS:** Debian and Raspberry Pi OS have no firewall turned on by default; Ubuntu has `ufw`, inactive until you enable it. If you use ufw: ```sh sudo ufw allow 80/tcp sudo ufw allow 443/tcp ``` If you do not use a firewall on this machine, there is nothing to do. **Fedora and RHEL:** Fedora uses firewalld: ```sh sudo firewall-cmd --permanent --add-service=http --add-service=https sudo firewall-cmd --reload ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** `sudo ss -tlnp` lists nothing on ports 80 and 443 yet, or only the proxy you are > about to configure. > **If it did not work:** if another web server already uses the ports, put the Hub behind that > one instead (add a site for `mail.example.com` that proxies to `127.0.0.1:8080`), or stop it. ## 3. Set up the proxy Choose one of the three. Each section has the complete configuration from the repository's `deploy/` folder. ### Caddy Caddy gets a certificate for your domain on its first start and renews it by itself. **Docker Compose:** `compose.yaml` has a `caddy` service in the profile `caddy`. It runs `caddy reverse-proxy --from $POSTERN_DOMAIN --to hub:8080`, which does the same as [`deploy/caddy/Caddyfile`](https://github.com/TheOriUHD/postern/blob/main/deploy/caddy/Caddyfile): automatic HTTPS, WebSockets and the `X-Forwarded-*` headers. It publishes ports 80 and 443 (and 443/udp for HTTP/3) and keeps its certificates in the volume `caddy-data`. Add to `~/postern/.env`: ```sh POSTERN_DOMAIN=mail.example.com POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=true ``` Start the Hub and Caddy together: ```sh cd ~/postern && docker compose --profile caddy up -d ``` From now on, always add `--profile caddy` when you run `docker compose up -d`, or Caddy stops being managed. Caddy reaches the Hub over the Compose network, so the Hub's port does not need to be published on the host; leaving `POSTERN_BIND` at its default `127.0.0.1:8080` does no harm. Watch Caddy get the certificate: ```sh cd ~/postern && docker compose logs -f caddy ``` If `POSTERN_DOMAIN` is missing, Caddy stops at once with "caddy profile: set POSTERN_DOMAIN in .env". **Debian and Ubuntu and Raspberry Pi OS:** Install Caddy. Debian 12 and later (and Raspberry Pi OS based on it) and Ubuntu 24.04 have a `caddy` package: ```sh sudo apt update sudo apt install caddy ``` On older releases, or for the newest version, add Caddy's own repository as described on . **Fedora and RHEL:** Install Caddy from Fedora's repositories: ```sh sudo dnf install caddy sudo systemctl enable --now caddy ``` On RHEL and its relatives, follow . **Desktop app (built-in Hub):** Not applicable to the built-in Hub. #### Configure Caddy **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Replace the contents of `/etc/caddy/Caddyfile` with this file ([`deploy/caddy/Caddyfile`](https://github.com/TheOriUHD/postern/blob/main/deploy/caddy/Caddyfile)) and change `mail.example.com`: ```text # Postern Hub behind Caddy (automatic HTTPS). # # 1. Point mail.example.com at this server; open ports 80 and 443. # 2. Replace mail.example.com below and copy this file to /etc/caddy/Caddyfile. # 3. In /etc/postern/hub.env (or the container environment) set: # POSTERN_PUBLIC_URL=https://mail.example.com # POSTERN_TRUST_PROXY=true # POSTERN_LISTEN=127.0.0.1:8080 # 4. sudo systemctl reload caddy # # Caddy proxies WebSockets (/api/v1/ws) and sets X-Forwarded-For/-Proto/-Host # automatically. With Docker Compose, use the "caddy" profile instead # (deploy/docker/compose.yaml): it runs the same configuration. mail.example.com { encode zstd gzip # Attachments up to POSTERN_MAX_UPLOAD_MB (default 25 MB) plus MIME overhead. request_body { max_size 40MB } reverse_proxy 127.0.0.1:8080 { # Stream responses (downloads, long-lived requests) without buffering. flush_interval -1 } # No access log on purpose: request URLs can carry signed image-proxy tokens. # Add a `log` block if you need one. } ``` Check the file and load it: ```sh caddy validate --config /etc/caddy/Caddyfile sudo systemctl reload caddy ``` Watch Caddy get the certificate: ```sh sudo journalctl -u caddy -f ``` Then set the Hub's settings in [step 4](https://docs.posternmail.app/reach/reverse-proxy/#4-tell-the-hub-its-address). **Docker Compose:** The `caddy` profile needs no Caddyfile. Continue with the check below. **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** `curl -sI https://mail.example.com/api/v1/info` from any machine prints > `HTTP/2 200` (or `HTTP/1.1 200 OK`), and Caddy's log contains "certificate obtained > successfully". > **If it did not work:** > - Caddy's log shows an ACME error mentioning a timeout or "connection refused": Let's > Encrypt cannot reach port 80 or 443 from the internet. Check the router's port forwarding, > the firewall (step 2) and the DNS record (step 1). > - "too many certificates" or "rateLimited": Let's Encrypt limits how often you can request > certificates. Wait as long as the message says; do not restart Caddy in a loop. > - `502 Bad Gateway`: Caddy runs, the Hub does not answer on `127.0.0.1:8080` (or `hub:8080` > in Docker). Check the Hub's log. ### nginx nginx does not get certificates by itself. Use certbot from Let's Encrypt to get one first, then add the Hub's configuration. **Docker Compose:** Install nginx on the host, with certbot and its nginx plugin. On Debian, Ubuntu or Raspberry Pi OS: ```sh sudo apt update sudo apt install nginx certbot python3-certbot-nginx ``` On Fedora, use `sudo dnf install nginx certbot python3-certbot-nginx`, then `sudo systemctl enable --now nginx` and `sudo setsebool -P httpd_can_network_connect 1` (see the Fedora variant of this step for why). **Debian and Ubuntu and Raspberry Pi OS:** Install nginx and certbot with its nginx plugin: ```sh sudo apt update sudo apt install nginx certbot python3-certbot-nginx ``` **Fedora and RHEL:** Install nginx and certbot with its nginx plugin, and start nginx: ```sh sudo dnf install nginx certbot python3-certbot-nginx sudo systemctl enable --now nginx ``` SELinux blocks nginx from connecting to the Hub's port until you allow it: ```sh sudo setsebool -P httpd_can_network_connect 1 ``` Without this, every request ends in `502 Bad Gateway` and nginx's error log says "connect() to 127.0.0.1:8080 failed (13: Permission denied)". **Desktop app (built-in Hub):** Not applicable to the built-in Hub. #### Get a certificate and configure nginx **Docker Compose, Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Get the certificate. nginx must be running and reachable on port 80: ```sh sudo certbot certonly --nginx -d mail.example.com ``` certbot stores it in `/etc/letsencrypt/live/mail.example.com/` and installs a timer that renews it. Now create `/etc/nginx/conf.d/postern.conf` with this file ([`deploy/nginx/postern.conf`](https://github.com/TheOriUHD/postern/blob/main/deploy/nginx/postern.conf)) and change both `mail.example.com` lines and the certificate paths: ```nginx # Postern Hub behind nginx. # # 1. Get a certificate (e.g. `certbot certonly --nginx -d mail.example.com`). # 2. Replace mail.example.com and the certificate paths below, then copy this file to # /etc/nginx/conf.d/postern.conf (or sites-available + symlink on Debian). # 3. In /etc/postern/hub.env set: # POSTERN_PUBLIC_URL=https://mail.example.com # POSTERN_TRUST_PROXY=true # required: the Hub must honor X-Forwarded-* # POSTERN_LISTEN=127.0.0.1:8080 # 4. sudo nginx -t && sudo systemctl reload nginx # WebSocket upgrade: send "Connection: upgrade" only when the client asks for it. map $http_upgrade $postern_connection_upgrade { default upgrade; '' ''; } upstream postern_hub { server 127.0.0.1:8080; keepalive 32; } server { listen 80; listen [::]:80; server_name mail.example.com; return 301 https://$host$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; http2 on; server_name mail.example.com; ssl_certificate /etc/letsencrypt/live/mail.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/mail.example.com/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers off; ssl_session_cache shared:postern:10m; ssl_session_timeout 1d; # Attachments up to POSTERN_MAX_UPLOAD_MB (default 25 MB) plus MIME overhead. client_max_body_size 30m; # The Hub sets its own security headers (HSTS, CSP, X-Frame-Options, ...). location / { proxy_pass http://postern_hub; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; # WebSocket (/api/v1/ws) and keep-alive to the upstream. proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $postern_connection_upgrade; # WebSocket connections stay open for hours; clients ping every 30 s. proxy_read_timeout 1h; proxy_send_timeout 1h; # Stream uploads and downloads instead of buffering them on disk. proxy_request_buffering off; proxy_buffering off; } } ``` > [!IMPORTANT] > `http2 on;` needs nginx 1.25.1 or later. Debian 12, Raspberry Pi OS 12 and Ubuntu 24.04 ship > older versions, and `nginx -t` then fails with `unknown directive "http2"`. On those, delete > the line `http2 on;` and write the two `listen` lines as `listen 443 ssl http2;` and > `listen [::]:443 ssl http2;`. Check your version with `nginx -v`. Test and load the configuration: ```sh sudo nginx -t sudo systemctl reload nginx ``` With Docker Compose this works unchanged: `compose.yaml` publishes the Hub on `127.0.0.1:8080` of the host, which is where the `upstream` points. **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** `curl -sI https://mail.example.com/api/v1/info` prints status 200, and > `curl -sI http://mail.example.com/` answers `301` with a `Location: https://...` header. > **If it did not work:** > - `nginx -t` complains about a missing certificate file: certbot did not finish. Run the > certbot command again and read its message. > - `502 Bad Gateway`: the Hub does not listen on `127.0.0.1:8080`, or (on Fedora) the SELinux > switch above is off. `sudo tail /var/log/nginx/error.log` says which. > - `413 Request Entity Too Large` when sending an attachment: raise `client_max_body_size` > (and `POSTERN_MAX_UPLOAD_MB` if you want larger attachments). > - The web app shows mail but never updates by itself: the `Upgrade` and `Connection` lines > are missing or the `map` block was not loaded. ### Traefik Use Traefik if you already run Traefik v3. The repository has a Compose file with Docker labels for it. **Docker Compose:** [`deploy/traefik/compose.traefik.yaml`](https://github.com/TheOriUHD/postern/blob/main/deploy/traefik/compose.traefik.yaml) runs the Hub without publishing any port and attaches it to Traefik's network. It assumes: - an entrypoint named `websecure` (port 443), - a certificate resolver named `letsencrypt`, - Traefik's Docker provider watching an external network named `traefik`. Rename these in the labels if your Traefik uses other names. The file: ```yaml # Postern Hub behind Traefik v3 (Docker labels). # # Assumes an existing Traefik with: # - an entrypoint named "websecure" (:443) and a certificate resolver named "letsencrypt" # - the Docker provider watching an external network named "traefik" # Adjust the names to your setup. Start with: # POSTERN_DOMAIN=mail.example.com docker compose -f compose.traefik.yaml up -d # # Traefik forwards WebSockets and X-Forwarded-* headers by default. name: postern services: hub: image: ghcr.io/theoriuhd/postern-hub:${POSTERN_VERSION:-${MAILCLIENT_VERSION:-latest}} restart: unless-stopped environment: POSTERN_PUBLIC_URL: https://${POSTERN_DOMAIN:-${MAILCLIENT_DOMAIN:-mail.example.com}} POSTERN_TRUST_PROXY: "true" POSTERN_RELAY_URL: ${POSTERN_RELAY_URL:-${MC_RELAY_URL:-}} volumes: - postern-data:/data - postern-key:/key read_only: true tmpfs: - /tmp security_opt: - no-new-privileges:true cap_drop: - ALL networks: - traefik labels: traefik.enable: "true" traefik.docker.network: traefik traefik.http.routers.postern.rule: Host(`${POSTERN_DOMAIN:-${MAILCLIENT_DOMAIN:-mail.example.com}}`) traefik.http.routers.postern.entrypoints: websecure traefik.http.routers.postern.tls: "true" traefik.http.routers.postern.tls.certresolver: letsencrypt traefik.http.services.postern.loadbalancer.server.port: "8080" volumes: # Installs from before the rename: POSTERN_DATA_VOLUME=mailclient_mailclient-data and # POSTERN_KEY_VOLUME=mailclient_mailclient-key keep the old volumes (docs/migrating-from-mailclient.md). postern-data: name: ${POSTERN_DATA_VOLUME:-postern_postern-data} postern-key: name: ${POSTERN_KEY_VOLUME:-postern_postern-key} networks: traefik: external: true ``` It uses the same volumes as `compose.yaml`, so your data stays. Stop the normal stack first, copy the file next to your `.env`, and set the domain there: ```sh cd ~/postern && docker compose down ``` Copy `deploy/traefik/compose.traefik.yaml` from your source checkout into `~/postern/`. Then add to `~/postern/.env` (keep `POSTERN_VERSION=local`, the image you built; there is no published image yet): ```sh POSTERN_DOMAIN=mail.example.com ``` Start it: ```sh cd ~/postern && docker compose -f compose.traefik.yaml up -d ``` From now on, pass `-f compose.traefik.yaml` to every `docker compose` command (`exec`, `logs`, `up`), or Compose uses `compose.yaml` again. The file sets `POSTERN_PUBLIC_URL` and `POSTERN_TRUST_PROXY=true` itself. Variables you add in `compose.override.yaml` are not picked up with `-f`; add them to the `environment:` block of this file instead. Traefik forwards WebSockets and `X-Forwarded-*` headers without extra settings and does not limit request bodies. If you added a `buffering` middleware, allow at least 30 MB (`maxRequestBodyBytes: 31457280`). **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** The repository has no ready-made Traefik configuration for a Hub installed with systemd. If Traefik already runs on this machine, add a router and a service to its file provider (a dynamic configuration file), with your entrypoint and certificate resolver names: ```yaml http: routers: postern: rule: Host(`mail.example.com`) entryPoints: - websecure tls: certResolver: letsencrypt service: postern services: postern: loadBalancer: servers: - url: http://127.0.0.1:8080 ``` Then set the Hub's settings in [step 4](https://docs.posternmail.app/reach/reverse-proxy/#4-tell-the-hub-its-address). If you do not run Traefik yet, use Caddy instead: it is less to set up. **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** Traefik's dashboard lists the router `postern` without errors, and > `curl -sI https://mail.example.com/api/v1/info` prints status 200. > **If it did not work:** > - `404 page not found` from Traefik: the router rule does not match. Check `POSTERN_DOMAIN` > and that the Hub container is on the `traefik` network. > - `pull access denied` or `manifest unknown` for `ghcr.io/theoriuhd/postern-hub`: > `POSTERN_VERSION=local` is missing from `.env`, so Compose looks for a published image that > does not exist yet. > - A certificate error: the resolver name in the labels does not exist in your Traefik. ## 4. Tell the Hub its address **Docker Compose:** With the Caddy profile or Traefik you already set this. With nginx on the host, add to `~/postern/.env`: ```sh POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=true ``` and apply: ```sh cd ~/postern && docker compose up -d ``` Leave `POSTERN_TRUSTED_PROXIES` unset: the proxy's requests reach the Hub from a private Docker address, which the default trusts. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add to `/etc/postern/hub.env` (`sudoedit /etc/postern/hub.env`): ```ini POSTERN_LISTEN=127.0.0.1:8080 POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=true POSTERN_TRUSTED_PROXIES=127.0.0.1,::1 ``` and apply: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** `postern-hub doctor` (the command for your install is on [Doctor](https://docs.posternmail.app/admin/doctor/)) > shows in its **Network** section `✓ https://mail.example.com is reachable` and > `✓ TLS certificate for mail.example.com valid until ...`. Open `https://mail.example.com` in a > browser, sign in, and star a message: it works without "Cross-origin request rejected". > **If it did not work:** > - "Cross-origin request rejected" when you change something: `POSTERN_PUBLIC_URL` differs > from the address in the browser's address bar, or the proxy does not pass `Host`. > - Settings → Security says passkeys only work over https although you use HTTPS: > `POSTERN_PUBLIC_URL` is missing or starts with `http://`. > - Security log and device list show `127.0.0.1` or `172.x` for everyone: > `POSTERN_TRUST_PROXY` is off, or the proxy's address is not in `POSTERN_TRUSTED_PROXIES`. ## 5. Connect your apps Open `https://mail.example.com` in a browser and, if the Hub is new, follow the setup wizard ([Set up Postern](https://docs.posternmail.app/setup/)). Connect the desktop and mobile apps to the same address, or pair phones with a QR code ([Pairing](https://docs.posternmail.app/apps/pairing/)). If you used another address before (LAN or Tailscale), signed-in devices keep the old one. Sign them in again with the new address, and add new passkeys: passkeys are tied to the host name ([Changing the domain later](https://docs.posternmail.app/reach/https/#changing-the-domain-later)). --- # Reach your Hub with Cloudflare Tunnel > Publish your Hub at your own domain through Cloudflare Tunnel without opening ports, and lock it with Cloudflare Access and a service token for the apps. Source: https://docs.posternmail.app/reach/cloudflare/ This page publishes your Hub at a domain you manage on Cloudflare, for example `https://mail.example.com`, without opening any port on your router. A small program, `cloudflared`, runs next to the Hub and keeps an outbound connection to Cloudflare; Cloudflare sends visitors' requests down that connection. The second half of the page adds Cloudflare Access, so only you and your apps get past Cloudflare at all. For other options see [Reaching your Hub](https://docs.posternmail.app/reach/). > [!TIP] > **Used the [installer](https://docs.posternmail.app/setup/)?** It does this for you when you choose **Cloudflare > Tunnel**. It runs `cloudflared` with your tunnel token and sets the Hub's address and client IP > header. Cloudflare Access (below) stays a manual step. To switch later, run the installer again > and choose **Change how it is set up**. > This page is for doing it by hand, or for understanding what was set up. With the installer, the > Docker files are in `/opt/postern` instead of `~/postern`, and the program is > `/usr/local/bin/postern-hub`. You need: - a Cloudflare account (the free plan is enough), - a domain whose DNS is managed by Cloudflare (its name servers point to Cloudflare). **Docker Compose:** The simple path is `cloudflared` installed on the **host**, pointing at `127.0.0.1:8080`, which `compose.yaml` publishes by default. That is what this page describes. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** `cloudflared` runs on the same machine as the Hub and forwards to `127.0.0.1:8080`, where the Hub listens by default. **Desktop app (built-in Hub):** This does not work with the desktop app's built-in Hub: it only accepts connections from your own computer, and its address is fixed to `http://localhost:`. To reach a Hub from other devices, run it on a server as described in [Set up Postern](https://docs.posternmail.app/setup/), then pick that method above. ## The trade-off: Cloudflare sees your traffic With a tunnel, the HTTPS connection from your browser or phone ends at Cloudflare. Cloudflare decrypts it, then sends it through the tunnel to your Hub. So everything the apps send and receive passes through Cloudflare readable: your Hub password when you sign in, session tokens, and the mail you read in the web app. The desktop and mobile apps fetch mail directly from your providers, so their mail does not pass through the tunnel, but their sign-in and the mailbox logins they get from the Hub do. If that is not acceptable to you, use [Tailscale](https://docs.posternmail.app/reach/tailscale/) (end to end encrypted) or your own [reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/). ## 1. Install cloudflared Install `cloudflared` from Cloudflare's own package repository. The commands for each distribution, including the signing key, are on . **Docker Compose, Debian and Ubuntu and Raspberry Pi OS:** On Debian, Ubuntu and Raspberry Pi OS, follow the section **Any Debian Based Distribution (Recommended)**: it adds Cloudflare's apt repository and installs the `cloudflared` package. On a Docker host running Fedora, follow the Fedora instructions below instead. **Fedora and RHEL:** Fedora has no section of its own on that page. Use **RHEL Generic**: it adds Cloudflare's repository for dnf and installs the `cloudflared` package. **Desktop app (built-in Hub):** Not applicable to the built-in Hub. > **Check:** `cloudflared --version` prints a version. > **If it did not work:** Cloudflare changed its signing key in October 2025. If `apt update` or > `dnf` complains about a signature, repeat the key step from the current instructions on > . ## 2. Create the tunnel Sign in to Cloudflare. The command prints a link; open it, sign in and choose your domain: ```sh cloudflared tunnel login ``` This saves a certificate to `~/.cloudflared/cert.pem`. Create a tunnel named `postern` and a DNS record that points your hostname at it: ```sh cloudflared tunnel create postern cloudflared tunnel route dns postern mail.example.com ``` `tunnel create` prints the tunnel's ID and writes its credentials to `~/.cloudflared/.json`. `route dns` creates a proxied `CNAME` record for `mail.example.com` in your Cloudflare DNS. You do not need an `A` record. > **Check:** `cloudflared tunnel list` shows `postern`, and the DNS page of your domain in the > Cloudflare dashboard has a `CNAME` for `mail` pointing to `.cfargotunnel.com`. > **If it did not work:** `route dns` fails if a record for that name already exists. Delete > the old `A`, `AAAA` or `CNAME` record for `mail` in the dashboard and run it again. ## 3. Configure and start the tunnel as a service The service reads its configuration from `/etc/cloudflared/`. Copy the tunnel's credentials there: ```sh sudo mkdir -p /etc/cloudflared sudo cp ~/.cloudflared/.json /etc/cloudflared/ ``` Create `/etc/cloudflared/config.yml` (`sudoedit /etc/cloudflared/config.yml`): ```yaml tunnel: postern credentials-file: /etc/cloudflared/.json ingress: - hostname: mail.example.com service: http://127.0.0.1:8080 - service: http_status:404 ``` Replace `` with the ID from step 2. The last line answers every other hostname with 404. Install and start the service: **Docker Compose, Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo cloudflared service install sudo systemctl enable --now cloudflared ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. WebSockets (the Hub's live updates on `/api/v1/ws`) pass through the tunnel without extra settings. Cloudflare's free plan accepts request bodies up to 100 MB, well above the Hub's 25 MB attachment limit. > [!TIP] > If you prefer the dashboard, you can instead create the tunnel under **Zero Trust → Networks → > Tunnels**, add a public hostname `mail.example.com` with the service `http://localhost:8080`, > and install it with the `sudo cloudflared service install ` command the dashboard > shows. The Hub settings below are the same. > **Check:** `sudo systemctl status cloudflared` shows `active (running)`, and from any machine > `curl -s https://mail.example.com/api/v1/info` prints JSON with `"apiVersion":1`. > **If it did not work:** > - `502 Bad Gateway` or a Cloudflare error page "Bad gateway": the tunnel runs but the Hub does > not answer on `127.0.0.1:8080`. Check the Hub's log. > - Error 1033: the tunnel is not connected. `sudo journalctl -u cloudflared -f` shows why; > usually a wrong `credentials-file` path. ## 4. Hub settings The Hub must know its address, trust `cloudflared` as a proxy, and take the visitor's IP from Cloudflare's `CF-Connecting-IP` header: **Docker Compose:** Add to `~/postern/.env`: ```sh POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=true ``` `POSTERN_CLIENT_IP_HEADER` is not passed through by `compose.yaml`. Create `~/postern/compose.override.yaml` (or add to it): ```yaml services: hub: environment: POSTERN_CLIENT_IP_HEADER: CF-Connecting-IP ``` Leave `POSTERN_TRUSTED_PROXIES` unset. `cloudflared` connects to the published port, so the Hub sees it at Docker's gateway address (a private address the default trusts), not at `127.0.0.1`. Apply: ```sh cd ~/postern && docker compose up -d ``` If you run `cloudflared` as a container in the same Compose project instead, use `service: http://hub:8080` in its configuration; the settings above stay the same. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add to `/etc/postern/hub.env` (`sudoedit /etc/postern/hub.env`): ```ini POSTERN_LISTEN=127.0.0.1:8080 POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=true POSTERN_TRUSTED_PROXIES=127.0.0.1,::1 POSTERN_CLIENT_IP_HEADER=CF-Connecting-IP ``` Apply: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. `CF-Connecting-IP` carries the visitor's real address. The Hub only reads it from a trusted proxy and uses it for rate limits, the security log and the device list. > **Check:** open `https://mail.example.com`, sign in and look at **Settings → Security**: the > newest sign-in shows your own public IP address, not `127.0.0.1` or a `172.x` address. > `postern-hub doctor` shows `✓ https://mail.example.com is reachable`. > **If it did not work:** "Cross-origin request rejected" when you change something means > `POSTERN_PUBLIC_URL` does not match the address in the browser. A wrong IP in the security log > means `POSTERN_CLIENT_IP_HEADER` or `POSTERN_TRUST_PROXY` did not reach the Hub (Docker: check > `compose.override.yaml` is next to `compose.yaml`). ## Lock it with Cloudflare Access So far anyone who knows the address reaches your Hub's sign-in page. Cloudflare Access puts a second lock in front of it: browsers must pass Cloudflare's own login (for example a one-time code sent to your email), and the apps get in with a **service token** that the Hub hands to them after they sign in. It never replaces the Hub's own sign-in. The menu names below are those of the Cloudflare Zero Trust dashboard at the time of writing; Cloudflare renames them from time to time. ### 1. Create a service token In **Zero Trust → Access → Service credentials → Service tokens**, create a token, for example "Postern apps", with the duration **Non-expiring** (or an expiry you are willing to rotate). Copy the **Client ID** and the **Client Secret**. The secret is shown only once. ### 2. Create the Access application In **Access → Applications → Add an application → Self-hosted**: - Domain: `mail.example.com`, the whole host, with no path. A path-only application would leave the rest of the Hub open. - Identity provider: **One-time PIN**, or your own. - Session duration: as you like. Add two policies, **in this order**: | Order | Action | Include | Who it is for | |---|---|---|---| | 1 | **Service Auth** | **Service Token** = the token from step 1 | The apps | | 2 | **Allow** | **Emails** = your address(es), for example `you@example.com` | Browsers | Leave **Return 401 response for Service Auth policies** off. The apps recognize Access by its redirect to the Cloudflare sign-in page; a `401` would look to them like a revoked session. ### 3. Give the token to the Hub **Docker Compose:** Add to `~/postern/compose.override.yaml`, under `services: hub: environment:`: ```yaml services: hub: environment: POSTERN_CLIENT_IP_HEADER: CF-Connecting-IP POSTERN_ACCESS_CLIENT_ID: ".access" POSTERN_ACCESS_CLIENT_SECRET: "" ``` The file now holds a secret: `chmod 600 ~/postern/compose.override.yaml`. Apply: ```sh cd ~/postern && docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add to `/etc/postern/hub.env` (it is `root:postern`, mode `0640`, so other users cannot read the secret): ```ini POSTERN_ACCESS_CLIENT_ID=.access POSTERN_ACCESS_CLIENT_SECRET= ``` Apply: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** Not applicable to the built-in Hub. Both must be set together. With only one, the Hub refuses to start with `POSTERN_ACCESS_CLIENT_ID and POSTERN_ACCESS_CLIENT_SECRET must be set together`. The Hub hands the token only to apps that are already signed in: in the pairing QR code (shown in the signed-in web app), in the app sign-in redirect and in every sign-in result. The desktop and mobile apps then send `CF-Access-Client-Id` and `CF-Access-Client-Secret` on every request to the Hub, WebSockets included. ### 4. Connect your devices behind Access - **Browsers:** open `https://mail.example.com`, pass Cloudflare's login (email code), then sign in to the Hub as usual. - **Phones:** pair them by **scanning the QR code** in the web app (**Settings → Devices → Connect a device**). The QR code carries the token. Typing a pairing code cannot work behind Access, because the phone has no token yet and Cloudflare turns it away. See [Pairing](https://docs.posternmail.app/apps/pairing/). - **Desktop app and "sign in with the browser":** enter the address as usual. The sign-in window shows Cloudflare's email step once, then the app receives the token from the Hub. ### 5. Check it From outside your network, without the token every request is redirected to Cloudflare: ```sh curl -sI https://mail.example.com/api/v1/info | head -1 ``` ```text HTTP/2 302 ``` With the token you reach the Hub: ```sh curl -s -H "CF-Access-Client-Id: .access" -H "CF-Access-Client-Secret: " https://mail.example.com/api/v1/info ``` The answer is JSON with `"apiVersion":1`. `postern-hub doctor` does the same check with the configured token and reports `✓ https://mail.example.com is reachable through Cloudflare Access with the apps' service token`. > **If it did not work:** > - doctor says "Cloudflare Access in front of https://mail.example.com rejected the configured > service token (POSTERN_ACCESS_CLIENT_ID)": the token is not in the **Service Auth** policy, > is expired or revoked, or the ID or secret has a typo. > - doctor says "is behind an access gateway (Cloudflare Access) that turned this check away": > the two `POSTERN_ACCESS_*` variables did not reach the Hub. > - An app says "the access gateway in front of your Hub (Cloudflare Access) turned this device > away; pair it again to get a fresh access token": the device has an old token. Pair it again > with the QR code. The app keeps working with its local mail meanwhile and is not signed out. > - Browsers get in but apps do not: the **Allow** policy is above the **Service Auth** policy, > or **Return 401 response for Service Auth policies** is on. ### Rotating the token 1. Create a new service token. 2. Add it to the **Service Auth** policy next to the old one. 3. Put the new ID and secret into the Hub's settings and restart the Hub. 4. Pair every phone again by scanning the QR code, and sign in again on desktop apps. 5. Delete the old token in Cloudflare. Devices that still carry the old token after step 5 are turned away with the message above until you pair them again. --- # Reach your Hub on your home network only > Make the Hub reachable on your home network over plain HTTP, what stops working without HTTPS, and how to keep it safe. Source: https://docs.posternmail.app/reach/lan/ This page makes the Hub answer on your local network, for example at `http://192.168.1.20:8080`, without HTTPS and without anything reachable from the internet. It is the quickest option, and the most limited. For the others see [Reaching your Hub](https://docs.posternmail.app/reach/). > [!TIP] > **Used the [installer](https://docs.posternmail.app/setup/)?** It does this for you when you choose **This machine's > address on your network**. It makes the Hub listen on the network and sets its address. To > switch later, run the installer again and choose **Change how it is set up**. > This page is for doing it by hand, or for understanding what was set up. With the installer, the > Docker files are in `/opt/postern` instead of `~/postern`, and the program is > `/usr/local/bin/postern-hub`. ## What you give up Without HTTPS: | | On the LAN over HTTP | |---|---| | Web app, password with TOTP | Works | | **Passkeys** | Not available. The Hub never offers passkeys on plain HTTP, and never on an IP address. | | **Google sign-in for Gmail** | Not available. Use an app password with IMAP ([Gmail](https://docs.posternmail.app/providers/gmail/)). | | **Microsoft sign-in in the browser** | Not available. The sign-in with a code still works ([Microsoft](https://docs.posternmail.app/providers/microsoft/)). | | **Web Push** in the browser | Not available. | | **Phones** | Only at home, and on Android only with a local host name (see below). Mail itself keeps working away from home, because the apps talk to your providers directly; settings and new devices wait until you are back. | | **Desktop app** | Warns before it connects (see below). | | **Privacy on the network** | Your password, session and the mail you read in the web app cross your network unencrypted. Anyone on the same Wi-Fi can read them. | **Settings → Admin → Status** shows "No HTTPS public URL: passkeys and Google sign-in unavailable." and `postern-hub doctor` warns "POSTERN_PUBLIC_URL is not HTTPS: passkeys and Google sign-in are unavailable". Both are expected here. If any of this matters to you, use [Tailscale](https://docs.posternmail.app/reach/tailscale/) instead: it takes ten minutes more and gives you HTTPS at home and away. **Desktop app (built-in Hub):** The desktop app's built-in Hub cannot be opened to the network. It listens on `127.0.0.1` only and its address is fixed to `http://localhost:`, so other devices on your LAN cannot reach it. To share a Hub with your phone or other computers, run it on a server or an always-on machine as described in [Set up Postern](https://docs.posternmail.app/setup/), then pick that method above. **Docker Compose, Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** The steps below change the Hub to listen on your network, give it a fixed address, open the firewall and tell it its URL. ## 1. Give the Hub a fixed address Your phone and your apps remember the Hub's address. If the router hands the Hub machine a new IP address after a restart, they lose it. Give the machine a fixed address: 1. Find its current address on the Hub machine: ```sh hostname -I ``` 2. In your router's web interface, find the list of DHCP clients (often under **LAN**, **Network** or **DHCP**) and reserve the current address for this machine. Routers call this a static lease, an address reservation or "always assign this IP address". This page uses `192.168.1.20` as the example; use yours. > **Check:** restart the Hub machine. `hostname -I` shows the same address afterwards. > **If it did not work:** some routers apply a reservation only after the machine renews its > lease. Restart the machine once more, or set a static address in the machine's network > settings instead (outside the router's DHCP range). ## 2. Listen on the network **Docker Compose:** `POSTERN_BIND` decides which host address Docker publishes the Hub's port on. Add to `~/postern/.env`: ```sh POSTERN_BIND=0.0.0.0:8080 ``` `8080` alone means the same. To publish only on one network card, use its address: `POSTERN_BIND=192.168.1.20:8080`. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Change `POSTERN_LISTEN` in `/etc/postern/hub.env` (`sudoedit /etc/postern/hub.env`): ```ini POSTERN_LISTEN=0.0.0.0:8080 ``` `0.0.0.0` means every IPv4 address of the machine. To listen on one network card only, use its address: `POSTERN_LISTEN=192.168.1.20:8080`. For IPv4 and IPv6, use `:8080`. **Desktop app (built-in Hub):** Not available for the built-in Hub. ## 3. Tell the Hub its address Set the address exactly as you will type it, and leave `POSTERN_TRUST_PROXY` off: nothing proxies the Hub here, and with it on any device on your LAN could fake its IP address. **Docker Compose:** Add to `~/postern/.env`: ```sh POSTERN_PUBLIC_URL=http://192.168.1.20:8080 POSTERN_TRUST_PROXY=false ``` Apply: ```sh cd ~/postern && docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add to `/etc/postern/hub.env`: ```ini POSTERN_PUBLIC_URL=http://192.168.1.20:8080 ``` Remove any `POSTERN_TRUST_PROXY=true` line. Apply: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** Not available for the built-in Hub. If your router gives local names to machines (for example `hub.lan` or `hub.home.arpa`), or the machine announces itself with mDNS (Raspberry Pi OS does: `raspberrypi.local` by default), you can use the name instead of the IP address: `POSTERN_PUBLIC_URL=http://hub.lan:8080`. That helps Android, see [Phones](https://docs.posternmail.app/reach/lan/#phones). ## 4. Open the firewall for your network **Docker Compose:** Docker publishes the port with its own firewall rules, which bypass ufw and firewalld: with `POSTERN_BIND=0.0.0.0:8080` the port is open to every network the host is on, whatever ufw says. If the host is also reachable from the internet (a VPS, or a router that forwards ports to it), publish on the LAN address only (`POSTERN_BIND=192.168.1.20:8080`). **Debian and Ubuntu and Raspberry Pi OS:** If you use ufw, allow port 8080 from your home network only: ```sh sudo ufw allow from 192.168.1.0/24 to any port 8080 proto tcp ``` Use your own network range (the first three parts of the Hub's address, then `.0/24`, fits most home networks). Without a firewall there is nothing to do. **Fedora and RHEL:** firewalld blocks port 8080 on Fedora Server. Open it: ```sh sudo firewall-cmd --permanent --add-port=8080/tcp sudo firewall-cmd --reload ``` Fedora Workstation's default zone already allows ports above 1024, so it may work without this. **Desktop app (built-in Hub):** Not available for the built-in Hub. > **Check:** from another computer on your network, open `http://192.168.1.20:8080`. The > sign-in page or the setup wizard appears. Or, from that computer: > > ```sh > curl -s http://192.168.1.20:8080/api/v1/info > ``` > > prints JSON with `"apiVersion":1`. > **If it did not work:** > - "Connection refused": the Hub still listens on `127.0.0.1`. On the Hub machine, > `sudo ss -tlnp | grep 8080` must show `0.0.0.0:8080` (or `*:8080`), not `127.0.0.1:8080`. > - The browser waits and times out: a firewall drops the connection (step 4), or the other > computer is on a guest Wi-Fi that is separated from the main network. > - "Cross-origin request rejected" when you change something: you opened the Hub with a > different address than `POSTERN_PUBLIC_URL` (for example the name instead of the IP). Use > the same one everywhere. ## Desktop app When you enter `http://192.168.1.20:8080`, the desktop app checks the Hub and then warns: > **This connection isn't encrypted** > 192.168.1.20:8080 uses plain HTTP, so your password and mail travel unprotected over the > network. Prefer HTTPS (a reverse proxy) or Tailscale. Choose **Connect anyway** to continue. The app does not ask for `localhost` and Tailscale addresses (`*.ts.net`, `100.64.0.0/10`), which are already protected. See [Desktop app](https://docs.posternmail.app/apps/desktop/). ## Phones The phone apps allow plain HTTP only to addresses that are on the local network, and the rules differ between iOS and Android: | Address | iOS | Android (release builds) | |---|---|---| | `http://192.168.1.20:8080` (IP address) | Works | **Blocked** | | `http://hub.local:8080` (mDNS name) | Works | Works, if the phone resolves `.local` names | | `http://hub.lan:8080`, `http://hub.home.arpa:8080`, `http://hub.internal:8080` | Blocked | Works | | `http://hub:8080` (single-word name) | Works | Blocked | Android can only allow host names, not IP ranges, so a Hub reached by its LAN IP address over plain HTTP is refused there. If you use Android, give the Hub a `.lan` or `.home.arpa` name in your router, set that name as `POSTERN_PUBLIC_URL`, and pair with it. Or use HTTPS. Details: [iOS](https://docs.posternmail.app/apps/ios/), [Android](https://docs.posternmail.app/apps/android/). Away from home the phone cannot reach the Hub. The app keeps working with your mail (it talks to your providers directly) and catches up with the Hub when you are back. Push notifications still arrive, because the Hub sends them out through the push relay ([Push relay](https://docs.posternmail.app/relay/)). ## Never forward plain HTTP to the internet Do not add a port forwarding for 8080 on your router, and do not use a DMZ setting that sends everything to the Hub machine. Your password and your mail would then cross the internet readable, and anyone could try to sign in. If you want to reach the Hub from outside, use [Tailscale](https://docs.posternmail.app/reach/tailscale/), a [reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/) or [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/). --- # HTTPS and passkeys > Let the Hub serve HTTPS itself with Let's Encrypt or your own certificate, how passkeys are bound to your domain, changing the domain later, and why self-signed certificates do not work. Source: https://docs.posternmail.app/reach/https/ This page covers HTTPS without a separate proxy: the Hub can get a certificate from Let's Encrypt by itself, or use one you give it. It also explains how passkeys depend on your domain, what happens when you change the domain, and why self-signed certificates are not an option. If you already use [Tailscale](https://docs.posternmail.app/reach/tailscale/), a [reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/) or [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/), you have HTTPS and only need the passkey sections. > [!NOTE] > The [installer](https://docs.posternmail.app/setup/) does not set up the Hub's own HTTPS: it uses Caddy, Tailscale or > Cloudflare instead. The passkey sections below apply to every setup. ## Which way to HTTPS | Way | Certificate | Notes | |---|---|---| | [Tailscale](https://docs.posternmail.app/reach/tailscale/) | Automatic, for `*.ts.net` | Only devices in your tailnet. | | [Reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/) | Automatic (Caddy, Traefik) or certbot (nginx) | Best when the machine also serves other sites. | | [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/) | Cloudflare's | Cloudflare decrypts the traffic. | | [Built-in, Let's Encrypt](https://docs.posternmail.app/reach/https/#built-in-tls-with-lets-encrypt) | Automatic | The Hub needs ports 80 and 443 to itself. | | [Built-in, your own certificate](https://docs.posternmail.app/reach/https/#your-own-certificate) | Yours | You renew it and restart the Hub. | **Desktop app (built-in Hub):** None of this applies to the desktop app's built-in Hub. It runs at `http://localhost:`, which browsers treat as secure, so passkeys work there without a certificate. Other devices cannot reach it at all. For HTTPS that your phone can use, run the Hub on a server ([Set up Postern](https://docs.posternmail.app/setup/)) and pick that method above. **Docker Compose, Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** With built-in TLS nothing sits in front of the Hub, so `POSTERN_TRUST_PROXY` stays off (the default). ## Built-in TLS with Let's Encrypt With `POSTERN_TLS_DOMAIN` set, the Hub requests a certificate for that one domain from Let's Encrypt on the first HTTPS request, keeps it in `/acme` and renews it by itself. | Variable | Meaning | |---|---| | `POSTERN_TLS_DOMAIN` | The domain, for example `mail.example.com`. The Hub only requests a certificate for exactly this name. | | `POSTERN_TLS_EMAIL` | Contact address for the Let's Encrypt account, for expiry notices. Optional, recommended. | | `POSTERN_PUBLIC_URL` | `https://mail.example.com`. | | `POSTERN_LISTEN` | Where HTTPS is served. Only when it is exactly `:8080` (the default) does the Hub switch to `:443` by itself. Any other value is used as it is. | The Hub also listens on port **80**, always on all addresses: Let's Encrypt checks the domain there, and the Hub redirects every other plain HTTP request to HTTPS. If it cannot open port 80, it logs `http->https redirect listener failed` and keeps running; certificates can then still be issued over port 443, as long as HTTPS is served on 443. Before you start: - An `A` (and, if it works, `AAAA`) record for `mail.example.com` points to the machine's public address. See [Point your domain at the server](https://docs.posternmail.app/reach/reverse-proxy/#1-point-your-domain-at-the-server). - Ports 80 and 443 reach the machine from the internet (router forwarding, firewall). See [Open ports 80 and 443](https://docs.posternmail.app/reach/reverse-proxy/#2-open-ports-80-and-443). - Nothing else on the machine uses ports 80 or 443. ### Set it up **Docker Compose:** The image sets `POSTERN_LISTEN=:8080`, so with `POSTERN_TLS_DOMAIN` the Hub inside the container switches to `:443` and also opens `:80`. Three things change in Compose: the TLS variables, the published ports, and the image's health check, which still asks `http://127.0.0.1:8080/api/v1/info` and would mark the container unhealthy. In `~/postern/.env`: ```sh POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TRUST_PROXY=false ``` Create `~/postern/compose.override.yaml` (or add to it): ```yaml services: hub: environment: POSTERN_TLS_DOMAIN: mail.example.com POSTERN_TLS_EMAIL: you@example.com ports: - "80:80" - "443:443" healthcheck: disable: true ``` The ports are added to the `127.0.0.1:8080` mapping from `compose.yaml`, which simply stays unused. Certificates are kept in the data volume (`/data/acme`), so they survive updates. Docker Engine lets processes inside containers open ports below 1024 without extra privileges, so the Hub's non-root user (uid 10001) can bind 80 and 443 despite `cap_drop: ALL`. If the log shows `listen tcp :443: bind: permission denied`, your Docker does not do that by default; add to the `hub` service in the override file: ```yaml sysctls: net.ipv4.ip_unprivileged_port_start: 0 ``` Apply: ```sh cd ~/postern && docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Ports 80 and 443 are privileged. The unit runs the Hub as the `postern` user with all capabilities removed, so it must be allowed to bind them. Create a drop-in: ```sh sudo systemctl edit postern-hub ``` and enter, between the comment lines the editor shows: ```ini [Service] AmbientCapabilities=CAP_NET_BIND_SERVICE CapabilityBoundingSet=CAP_NET_BIND_SERVICE ``` Then set the Hub's variables in `/etc/postern/hub.env` (`sudoedit /etc/postern/hub.env`). The file sets `POSTERN_LISTEN=127.0.0.1:8080`; change it to `:443`, because the Hub only switches to 443 by itself when the value is `:8080`: ```ini POSTERN_LISTEN=:443 POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TLS_DOMAIN=mail.example.com POSTERN_TLS_EMAIL=you@example.com ``` Remove `POSTERN_TRUST_PROXY=true` if it is there. Apply: ```sh sudo systemctl restart postern-hub ``` Certificates are kept in `/var/lib/postern/acme`. **Desktop app (built-in Hub):** Not available for the built-in Hub. > **Check:** the Hub's log shows `listening (TLS)` with `addr=:443`. Open > `https://mail.example.com` in a browser; the first request takes a few seconds while the > certificate is issued. Then: > > ```sh > curl -sI https://mail.example.com/api/v1/info > ``` > > prints status 200, and `postern-hub doctor` shows `✓ automatic TLS (ACME) for mail.example.com` > and `✓ TLS certificate for mail.example.com valid until ...`. > **If it did not work:** > - `listen tcp :443: bind: permission denied`: the capability drop-in is missing (systemd) or > the sysctl above is needed (Docker). `systemctl cat postern-hub` shows whether the drop-in > is active. > - `bind: address already in use`: another program uses the port. `sudo ss -tlnp | grep -E ':(80|443) '` > names it. > - The browser shows a certificate error and the log has `acme/autocert` errors: Let's Encrypt > cannot reach the machine on port 80 or 443, or the DNS record points elsewhere. Fix that, then > try again. Do not restart the Hub over and over: Let's Encrypt limits failed attempts per > hour. > - The address you open is not exactly `POSTERN_TLS_DOMAIN` (for example `www.mail.example.com` > or the IP address): the Hub does not request certificates for other names. ## Your own certificate If you already have a certificate (from your own ACME client, a company CA, or a wildcard certificate), give the Hub the files: | Variable | Meaning | |---|---| | `POSTERN_TLS_CERT` | PEM file with the certificate and its chain (`fullchain.pem`). | | `POSTERN_TLS_KEY` | PEM file with the private key. | Both must be set together, or the Hub refuses to start with `POSTERN_TLS_CERT and POSTERN_TLS_KEY must be set together`. The files must be readable by the user the Hub runs as. With a certificate file, the Hub serves HTTPS on `POSTERN_LISTEN` as it is (no switch to 443) and opens no port 80. The Hub reads the files once at start: after you renew the certificate, restart the Hub. **Docker Compose:** Mount the files read-only and serve HTTPS on host port 443. In `~/postern/.env`: ```sh POSTERN_BIND=443 POSTERN_PUBLIC_URL=https://mail.example.com ``` `POSTERN_BIND=443` publishes host port 443 on all addresses to the container's port 8080, where the Hub now speaks HTTPS. In `~/postern/compose.override.yaml`: ```yaml services: hub: environment: POSTERN_TLS_CERT: /tls/fullchain.pem POSTERN_TLS_KEY: /tls/privkey.pem volumes: - /etc/postern/tls:/tls:ro healthcheck: disable: true ``` The health check is turned off because it asks for plain HTTP on port 8080. The files must be readable by uid 10001: ```sh sudo chown -R 10001:10001 /etc/postern/tls sudo chmod 600 /etc/postern/tls/privkey.pem ``` Apply: ```sh cd ~/postern && docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Put the files in `/etc/postern/tls/` (the unit cannot read files under `/home`) and make them readable by the `postern` user: ```sh sudo install -d -o root -g postern -m 0750 /etc/postern/tls sudo install -o root -g postern -m 0644 fullchain.pem /etc/postern/tls/fullchain.pem sudo install -o root -g postern -m 0640 privkey.pem /etc/postern/tls/privkey.pem ``` In `/etc/postern/hub.env`: ```ini POSTERN_LISTEN=:443 POSTERN_PUBLIC_URL=https://mail.example.com POSTERN_TLS_CERT=/etc/postern/tls/fullchain.pem POSTERN_TLS_KEY=/etc/postern/tls/privkey.pem ``` For port 443, add the capability drop-in from [the section above](https://docs.posternmail.app/reach/https/#set-it-up). With a port above 1024 (for example `POSTERN_LISTEN=:8443` and `POSTERN_PUBLIC_URL=https://mail.example.com:8443`) you do not need it. Apply: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** Not available for the built-in Hub. > **Check:** `postern-hub doctor` shows `✓ TLS certificate for /etc/postern/tls/fullchain.pem valid > until ...` (in Docker, the path inside the container), and > `curl -sI https://mail.example.com/api/v1/info` prints status 200. > **If it did not work:** doctor's messages name the problem: `cannot read POSTERN_TLS_CERT ...` > (permissions or path), `POSTERN_TLS_CERT ... is not a PEM certificate` (wrong format: convert > it with `openssl x509 -in cert.der -inform der -out fullchain.pem`), or > `TLS certificate for ... expires in N days` (renew it, then restart the Hub). ## HSTS Whenever a request arrives over HTTPS (directly, or through a trusted proxy that says so), the Hub sends `Strict-Transport-Security: max-age=31536000`. Browsers then refuse plain HTTP for that host name for a year. You cannot switch the same name back to `http://` later; browsers will insist on HTTPS. Use another name if you ever need to. ## Passkeys and your domain A passkey is bound to a domain, the "relying party ID". The Hub uses the host name of `POSTERN_PUBLIC_URL` (or, when that is empty, of the address in the browser): - `https://mail.example.com` gives passkeys for `mail.example.com`. - `https://hub.tailnet-1234.ts.net` gives passkeys for `hub.tailnet-1234.ts.net`. - `http://localhost:8080` works too, because browsers treat localhost as secure. The Hub does not offer passkeys: - over plain HTTP on any name other than localhost, - on an IP address, even with HTTPS (`https://192.168.1.20` has no passkeys). In the web app, **Settings → Security** then says "Passkeys only work when your Hub is opened over a secure (https) address." Password with TOTP still works. How to add and use passkeys: [Sign-in methods](https://docs.posternmail.app/admin/sign-in/). ## Changing the domain later When `POSTERN_PUBLIC_URL` changes to another host name (for example from Tailscale to your own domain), the browser and the phone treat the new name as a different site: 1. **Passkeys stop working.** They belong to the old host name. Sign in with your password and TOTP, then add a new passkey in **Settings → Security** and remove the old one. Make sure every user has a password and TOTP (or another way in) before you switch. 2. **Signed-in devices keep the old address.** Sign the desktop apps in again with the new address, and pair phones again ([Pairing](https://docs.posternmail.app/apps/pairing/)). 3. **Google and Microsoft redirect addresses change.** If you use your own OAuth clients, add `https:///api/v1/oauth/callback/google` (and `/microsoft`) to them ([Gmail](https://docs.posternmail.app/providers/gmail/), [Microsoft](https://docs.posternmail.app/providers/microsoft/)). The same goes for a single sign-on provider (`/api/v1/auth/oidc/callback`). 4. **Invite links** already sent point to the old address. Send new ones. Your mail, mailboxes and settings do not change. ## Self-signed certificates A self-signed certificate (or one from your own CA that the devices do not know) does not work with the apps: - The **desktop app** checks the certificate with your computer's trust store and never skips that check. It says "Your Hub's certificate isn't trusted" and suggests a certificate from Let's Encrypt or Tailscale, or adding your own certificate authority to the computer's trusted certificates. - The **phone apps** use the phone's trust store. They only accept your own CA if you install it on every phone and mark it as trusted, which is fiddly and easy to get wrong. - **Browsers** show a full-page warning. Even if you click through, passkeys and service workers do not work on a page with a certificate error. If your Hub is only at home and you want HTTPS, [Tailscale](https://docs.posternmail.app/reach/tailscale/) gives you a real certificate without opening anything. If you own a domain, a reverse proxy with Let's Encrypt works for addresses that are only reachable at home too, as long as Let's Encrypt can check the domain; Caddy and certbot also support the DNS check for that, which is not covered here. --- # Connect mailboxes > How adding a mailbox works in Postern, which connection types exist, where the sign-ins are kept, mailbox states, sync behaviour and limits. Source: https://docs.posternmail.app/providers/ A mailbox is one email account that Postern reads and sends from: a Gmail address, an Outlook account, an iCloud address or any IMAP account. This page explains how adding a mailbox works, what happens after it is connected and what each mailbox state means. The pages for each provider walk through the setup step by step. ## Pick your provider | Provider | Easiest path | Also possible | Guide | |---|---|---|---| | Gmail (`@gmail.com`, `@googlemail.com`) | App password over IMAP | Sign in with Google, with your own Google OAuth client | [Gmail](https://docs.posternmail.app/providers/gmail/) | | Google Workspace (your domain on Google) | Sign in with Google, with your own Internal OAuth client | App password, if your admin allows it | [Google Workspace](https://docs.posternmail.app/providers/google-workspace/) | | Outlook.com, Hotmail, Live, MSN, Microsoft 365 | Sign in with Microsoft (needs a Microsoft client ID on the Hub) | Sign in with a code | [Microsoft](https://docs.posternmail.app/providers/microsoft/) | | iCloud Mail (`@icloud.com`, `@me.com`, `@mac.com`, iCloud+ domains) | App-specific password | | [iCloud](https://docs.posternmail.app/providers/icloud/) | | Yahoo Mail and AOL | App password | | [Yahoo and AOL](https://docs.posternmail.app/providers/yahoo/) | | Fastmail | API token (JMAP) | App password over IMAP | [Fastmail](https://docs.posternmail.app/providers/fastmail/) | | GMX, WEB.DE, Posteo, mailbox.org, Zoho, Proton (Bridge), your host, your own server | Password or app password over IMAP and SMTP | | [Any IMAP server](https://docs.posternmail.app/providers/imap/) | | Other JMAP servers | API token | | [JMAP](https://docs.posternmail.app/providers/jmap/) | Postern does not support POP3 or Exchange Web Services (EWS). ## Add a mailbox You can start adding a mailbox from several places in the web and desktop app: - **Settings → Mailboxes → Add mailbox** - the **+** button next to **Mailboxes** in the sidebar (its tooltip says **Add a mailbox**) - the command palette (⌘K or Ctrl+K): **Add a mailbox…** - **Add a mailbox** on the empty inbox, when you have no mailbox yet In the iOS and Android app, open **Settings → Mailboxes → Add mailbox**. The dialog then asks a few questions: 1. **Where does your mail live?** Pick **Google** (Gmail, Google Workspace), **Microsoft** (Outlook, Microsoft 365), **iCloud** (iCloud Mail, me.com) or **Other** (Fastmail, Yahoo, any IMAP). 2. **Your email address.** Type the full address and click **Continue** (for Google and Microsoft the button says **Sign in with Google** or **Sign in with Microsoft**). 3. **How to sign in.** The Hub looks up your address (see [autodetection](https://docs.posternmail.app/providers/#autodetection)) and offers the ways in that work for this provider *and* this Hub, the best one first, marked **Recommended**. When only one way is possible, the dialog goes straight to it. 4. **Sign in.** Depending on the way you picked: Google or Microsoft's own sign-in page, a code to type on Microsoft's page, or a password form. 5. **Done.** The dialog shows **you@example.com is connected** and a progress bar while your mail downloads. You can start using Postern right away; older mail keeps arriving. Click **Add another** for the next mailbox or **Done**. Before it saves a password or token, the Hub signs in to the provider once to check it. For IMAP that means a sign-in to the IMAP server and a connection to the SMTP server; nothing is stored when either fails, and the dialog shows why (see [errors](https://docs.posternmail.app/providers/#errors-while-adding)). > [!NOTE] > Your mail stays with your provider. Postern reads it, keeps a local copy for fast search and > offline use, and writes your changes (read, archived, moved, deleted) back to the provider. ### The connection types | Way to sign in | Button in the dialog | What the Hub uses | Providers | |---|---|---|---| | Password or app password | **Use a password** | IMAP to read, SMTP to send | Every IMAP provider: iCloud, Yahoo, AOL, Gmail, Fastmail, GMX, your own server | | Sign in with Google | **Sign in with Google** | Gmail API, with an OAuth client that you create in Google Cloud | Gmail, Google Workspace | | Sign in with Microsoft | **Sign in with Microsoft** | Microsoft Graph, with an app you register in Microsoft Entra | Outlook.com, Microsoft 365 | | Sign in with a code | **Sign in with Microsoft using a code** | Microsoft Graph, through Microsoft's device code sign-in | Outlook.com, Microsoft 365 | | API token | **Use an API token** | JMAP | Fastmail; other JMAP servers through the API | The Google and Microsoft sign-ins only appear when the Hub admin has set them up (see [Gmail](https://docs.posternmail.app/providers/gmail/) and [Microsoft](https://docs.posternmail.app/providers/microsoft/)). Postern ships no shared Google or Microsoft app: each Hub uses its own. The browser sign-ins (Google, and Microsoft without a code) also need the Hub to be opened over `https://` or on `localhost`, because Google and Microsoft only send you back to such addresses. Without that, Google sign-in is not offered and Microsoft falls back to the code. On a phone, Google accounts are added in the Hub's web app: the app opens it for you (**Open the web app**), you add the mailbox there, and it appears on the phone by itself. On the desktop app, the Google page opens in your normal browser, which must be signed in to your Hub's web app with the same account. Microsoft's code sign-in works the same everywhere. ### Autodetection When you type your address, the Hub works out the provider and the server settings. It tries, in this order, and uses the first answer: 1. **A built-in list** of large providers: Gmail, Outlook.com (and Hotmail, Live, MSN, Passport), iCloud, Yahoo, AOL, Fastmail and its alias domains, GMX, WEB.DE, Posteo, mailbox.org, Zoho and Proton. 2. **The domain's MX records.** This recognizes your own domain when it is hosted by Google Workspace, Microsoft 365, iCloud+, Fastmail, Zoho, mailbox.org or Proton. 3. **Published settings**, looked up at the same time: Mozilla's provider database (the one Thunderbird uses) for your domain, your domain's own autoconfig file (`autoconfig.example.com` and `example.com/.well-known/autoconfig`), Mozilla's database for the company that runs your MX servers, and DNS SRV records (`_imaps._tcp`, `_imap._tcp`, `_submissions._tcp`, `_submission._tcp`). 4. **A guess from the MX host**: `imap.` and `smtp.` on the domain of your mail server, if those names exist. 5. **A plain guess**: `imap.example.com` (or `mail.example.com`) on port 993 with TLS and `smtp.example.com` (or `mail.example.com`) on port 587 with STARTTLS. A guess says so in the dialog ("No published settings were found for this domain. These server names are a guess; check them with your mail provider."). Open **Server settings** in the password form to check or change them. Lookups only go to public `https://` addresses, and results are remembered for an hour per domain (a guess for 10 minutes). Details per provider, including the exact servers, are on the provider pages and on [Any IMAP server](https://docs.posternmail.app/providers/imap/#what-autodetection-checks). ### Errors while adding | What the dialog shows | What it means | What to do | |---|---|---| | **The sign-in was rejected.** The server rejected the sign-in. Check the username and password. Gmail, iCloud, Yahoo and many others require an app-specific password when two-step verification is on. | The provider said no to the username and password. | Use an app password, not your normal password. Check **Username** under **Server settings**. | | **The mail server didn't answer.** Couldn't connect to imap.example.com: the connection timed out. Check the server name, port and security setting. | The Hub could not reach the server in time. | Check host, port and security under **Server settings**. The server must be reachable from the Hub's machine. | | **The mail server didn't answer.** Check the server settings below and try again. | Another connection error (refused, certificate, wrong security setting). | Same as above; see [Any IMAP server](https://docs.posternmail.app/providers/imap/#troubleshooting). | | **This way of signing in isn't set up on your Hub.** | Google or Microsoft sign-in has no client on this Hub, or the Hub is not on `https://`. | Admins get an **Open provider settings** button. Everyone else can use an app password or ask the admin. | | This mailbox is already connected. Update its credentials instead. | The same address is already connected in the same way. | Use **Update sign-in** on the existing mailbox. | | **Your Hub can't be reached.** | The app has no connection to your Hub. | See [When the Hub is away](https://docs.posternmail.app/providers/#when-the-hub-is-away). | ## Where your sign-ins are kept Passwords, app passwords, API tokens and Google and Microsoft refresh tokens are stored on your Hub, encrypted with a key that belongs to your Postern account (see [Encryption](https://docs.posternmail.app/security/encryption/)). They are never written to the Hub's logs. When Google or Microsoft hands out a fresh token, the Hub stores it encrypted again. The desktop, iOS and Android apps get mail straight from your providers. To do that, they fetch your mailbox sign-ins from the Hub once: - only apps signed in with your password, a passkey or single sign-on get them (an app approved only from a browser session is asked to sign in properly first: "Sign in on this device with your password, passkey or single sign-on to use your mailbox credentials here."); - the web app never gets them; - every handover is recorded under **Settings → Security → Recent security activity** as **Mailbox sign-ins sent to one of your devices**. For Google mailboxes the app also gets the Hub's Google client ID and secret, so it can renew the token itself. Removing a device signs it out; to make a handed-over password useless, change it at the provider and reconnect the mailbox. ## Manage a mailbox Everything is in **Settings → Mailboxes**. Each mailbox has a card with its address, provider, status and these settings: | Setting or button | What it does | |---|---| | **Color** | The mailbox color in the sidebar and message list. | | **Sender name** | The name people see on mail you send from this mailbox. The first identity of a new mailbox uses it. | | **Notifications** | **Use my default**, **All new mail**, **VIPs only** or **None** for this mailbox. See [Notifications](https://docs.posternmail.app/using/notifications/). | | **Pause** / **Resume** | Stops fetching mail for this mailbox until you resume. Nothing is deleted. | | **Download again…** | Fetches all mail of the mailbox again from the provider. Nothing is deleted, but it takes a while and uses data. Use it when the copy in Postern looks wrong. | | **Update sign-in** | Enter a new password or token, or sign in to Google or Microsoft again. | | **Remove…** | Removes the mailbox from Postern. | The address itself cannot be renamed: it is the account. To show a different name on outgoing mail, change **Sender name**, or edit the identities (below). ### Reconnect When a provider stops accepting the sign-in (you changed your password, revoked the app password, or an admin removed access), the mailbox shows **The sign-in no longer works. Reconnect to keep getting mail.** and a **Reconnect** button. The sidebar shows **Reconnect** next to the mailbox, and you get one notification: **Reconnect you@example.com**. Click **Reconnect** (or **Update sign-in** at any time): - **Password mailboxes:** enter the password or a new app password and click **Reconnect**. The Hub checks it first. The dialog only asks for the password; to change the server settings, remove the mailbox and add it again. - **API token (JMAP):** enter a new token. - **Google and Microsoft:** click **Continue to Gmail** or **Continue to Outlook** and sign in again. Sign in with the same address: signing in as someone else ends with "You signed in as other@example.com, but this mailbox is you@example.com." Microsoft without browser sign-in goes through the code step again. After a successful reconnect the mailbox shows **Connecting…** and then catches up from where it stopped. ### Remove **Remove…** asks for confirmation (**Remove mailbox**). The mailbox's mail, folders, identities and pending changes are deleted from the Hub and from all your devices, and the mailbox is taken out of every space. **Nothing is deleted at the provider.** If you add the same address again later, its existing mail is not announced as new mail. To also revoke Postern's access at the provider, delete the app password or token there, or remove the app in your Google or Microsoft account (links on the provider pages). ## Mailbox states The status line under each mailbox in **Settings → Mailboxes**: | Status shown | State | What it means | |---|---|---| | **Connecting…** | `connecting` | Just added, resumed or reconnected; the first sync is starting. | | **Downloading mail, 42% done** | `backfilling` | The first download of your existing mail is running, newest first. New mail already arrives meanwhile. | | **Up to date** (with "checked …") | `live` | Synced. New mail arrives as described in [How new mail arrives](https://docs.posternmail.app/providers/#how-new-mail-arrives). | | **Having trouble getting new mail. Trying again automatically.** | `degraded` | Temporary errors. The Hub retries with growing pauses (2 seconds up to 5 minutes). | | **The sign-in no longer works. Reconnect to keep getting mail.** | `auth_error` | The provider rejected the stored sign-in. Nothing is fetched until you [reconnect](https://docs.posternmail.app/providers/#reconnect). | | **Paused. No new mail is fetched.** | `paused` | You paused it. | For **Having trouble…** and **The sign-in no longer works…**, **Technical details** shows a plain sentence about the cause: | Technical details | Cause | |---|---| | The mail provider no longer accepts the sign-in for this mailbox. Reconnect it to keep receiving mail. | Wrong or revoked password, expired or revoked token. | | Can't reach the mail server at imap.example.com. Trying again. | Network error, DNS failure, timeout. | | Can't make a secure connection to the mail server at imap.example.com. Check the server address and security setting of this mailbox. | Certificate or TLS problem. | | Gmail is limiting how fast this mailbox can sync. Syncing continues by itself; nothing needs to be done. | The provider is rate limiting. Shown only when it lasts 15 minutes or longer. | | This mailbox is full at the provider. Free up space there and syncing continues. | The provider reports the storage quota as full. | | Gmail is having trouble right now. Trying again. | Server errors at the provider. | | Something went wrong while syncing. Trying again. | Anything else. The full error is in the Hub's log and in the admin's sync overview. | A mailbox that is up to date only switches to **Having trouble…** after three failed checks in a row or five minutes of failures, so a single timeout does not show a warning. Admins see the raw error of every mailbox in **Settings → Admin → Mailboxes on your Hub** (see [Admin panel](https://docs.posternmail.app/admin/admin-panel/)). ## Sync ### The first download A new mailbox first downloads its existing mail, newest first, folder by folder (inbox first, trash and spam last). By default the Hub fetches your whole history. The Hub admin can limit that with `POSTERN_BACKFILL_DAYS` (see [Configuration](https://docs.posternmail.app/configuration/)). While the download runs, the mailbox shows its progress, and new mail arrives normally. Message bodies of the last 30 days are fetched ahead in the background (`POSTERN_BODY_CACHE_DAYS`), except messages larger than 8 MB. Everything else is fetched the first time you open it. ### How the Hub keeps your mail The apps on your devices get mail straight from your providers. The Hub keeps the sign-ins, your settings and the state of every message in sync between them, runs rules and sends notifications. It keeps a full copy of your mail only while you use the web app: - **For 7 days after you last used the web app**, the Hub syncs every folder and fetches bodies, as described above. - **After that**, it only watches each mailbox's inbox (the last 7 days, without bodies). That is enough for notifications, rules, the Screener and snooze. - **After 30 days without the web app** (`POSTERN_HUB_MAIL_COPY_DAYS`), the Hub deletes its copy of older mail. The next time you open the web app, it downloads it again. To keep a full copy on the Hub all the time, turn on **Settings → Reading & sending → Keep a full copy of my mail on my Hub**. ### How new mail arrives Every connection type has a push channel that wakes the sync as soon as the provider reports a change, plus regular checks as a safety net: | Connection | Push | Regular check | |---|---|---| | IMAP (password) | IMAP IDLE on the inbox | every 2 minutes | | Gmail (sign in with Google) | IMAP IDLE on `imap.gmail.com` as a doorbell | every 10 seconds | | Microsoft | IMAP IDLE on `outlook.office365.com` as a doorbell | every 45 seconds | | JMAP | JMAP event stream (all folders) | every 5 minutes | When the provider does not allow the push connection (for example IMAP disabled by an admin), the mailbox keeps working with the regular checks only. The **Check for new mail** button above the message list (pull to refresh on a phone) checks at once. ### Changes you make Reading, flagging, archiving, moving, deleting and tagging are applied in Postern at once and written to the provider in the background. Tags become Gmail labels, Outlook categories or IMAP and JMAP keywords. Sent mail ends up in the provider's Sent folder: Gmail, Microsoft and JMAP store it themselves, and for IMAP the Hub saves a copy there. ## Identities and aliases Every mailbox has at least one identity: its own address with your sender name. In **Settings → Identities & signatures** you can, per mailbox: - **Add an address** (an alias), with its own name, - set a **Reply-to** address and a **Signature** for each address, - **Make default** to choose the address new mail starts from, and delete extra addresses. A reply starts from the address the message was sent to. Postern does not check aliases with the provider: the provider must allow sending from the address. Gmail needs it under **Settings → See all settings → Accounts and Import → Send mail as** in Gmail, Microsoft needs send-as rights (otherwise sending fails), Fastmail and iCloud need the alias set up in their settings. ## When the Hub is away The desktop and mobile apps can add a password mailbox while the Hub is unreachable: the dialog fills in common server names (`imap.` and `smtp.` on your domain) for you to check, the app verifies the sign-in itself and hands it to the Hub later. Google sign-in needs the Hub ("Connecting Google needs your Hub, which can't be reached right now"). See [Offline use](https://docs.posternmail.app/apps/offline/). ## Limits - **Providers' own limits apply.** Gmail meters API use per account; Postern paces itself (see [Gmail quota](https://docs.posternmail.app/providers/gmail/#quota)). Microsoft and other providers can slow down large downloads; the Hub waits and continues. - **Google sign-in with an unverified OAuth client** can be used by at most 100 Google accounts. See [Gmail](https://docs.posternmail.app/providers/gmail/#limits). - **Message size for sending** depends on the provider. Through Microsoft Graph, messages up to 150 MB are sent. See [Writing mail](https://docs.posternmail.app/using/compose/). - **Server settings of a password mailbox** cannot be edited in the app after adding it: remove and add the mailbox again. - **JMAP** is less tested than the other connection types. See [JMAP](https://docs.posternmail.app/providers/jmap/). --- # Connect a Gmail account > Connect a personal Gmail account with an app password, or with Google sign-in through your own Google OAuth client. Source: https://docs.posternmail.app/providers/gmail/ This page connects a personal `@gmail.com` or `@googlemail.com` account. For your own domain on Google, read [Google Workspace](https://docs.posternmail.app/providers/google-workspace/) as well. There are two ways: | | App password (IMAP) | Sign in with Google (Gmail API) | |---|---|---| | Setup | 2 minutes, per account | about 15 minutes, once per Hub; then one click per account | | You need | 2-Step Verification on the Google account | A Google Cloud project and a Hub opened over `https://` (or `localhost`) | | The Hub uses | IMAP (`imap.gmail.com`) and SMTP (`smtp.gmail.com`) | The Gmail API | | New mail | IMAP IDLE on the inbox, checks every 2 minutes | IMAP IDLE as a doorbell, checks every 10 seconds | | Labels | Shown as folders | Real labels: a message can be in several at once | | Good for | Most people | Accounts without app passwords (Advanced Protection), several Gmail accounts, a whole family | Start with the app password if you are unsure. You can switch later: remove the mailbox and add it again the other way. > [!NOTE] > Postern ships no shared Google app. Each Hub uses its own OAuth client, created by the Hub's > admin in their own Google Cloud project. Your tokens only ever go between Google and your Hub > (and your own devices). ## Option A: App password ### What you need - 2-Step Verification turned on for the Google account. - An account without Advanced Protection. Google does not offer app passwords with Advanced Protection, and may hide them for accounts that use only security keys. Use [Option B](https://docs.posternmail.app/providers/gmail/#option-b-sign-in-with-google) then. ### 1. Turn on 2-Step Verification Open (Google Account → **Security** → **2-Step Verification**) and follow the steps. > **Check:** the **Security** page shows **2-Step Verification: On**. > **If it did not work:** for a work or school account, your admin may have to allow 2-Step > Verification. See [Google Workspace](https://docs.posternmail.app/providers/google-workspace/). ### 2. Create an app password 1. Open . Sign in again if Google asks. 2. Enter a name such as `Postern` and click **Create**. 3. Copy the 16-character password. The spaces in it do not matter. Google's help: . > **Check:** Google shows the password in a yellow box, and the name appears in the list of app > passwords. > **If it did not work:** "The setting you are looking for is not available for your account" > means 2-Step Verification is off, your account uses Advanced Protection, or your admin > turned app passwords off. Use [Option B](https://docs.posternmail.app/providers/gmail/#option-b-sign-in-with-google). ### 3. Add the mailbox 1. In Postern open **Settings → Mailboxes → Add mailbox**. 2. Pick **Google** and type your Gmail address. 3. If your Hub has Google sign-in set up, the button says **Sign in with Google** and opens Google. To use the app password instead, pick **Other**, type the address and click **Continue**, then choose **Use a password**. Without Google sign-in on the Hub, the dialog goes straight to the password form. 4. Paste the app password into **App password**, optionally fill **Your name on outgoing mail** and click **Connect**. > **Check:** the dialog shows **you@gmail.com is connected** and a progress bar. In > **Settings → Mailboxes** the mailbox shows **Gmail · Downloading mail, …% done**. > **If it did not work:** **The sign-in was rejected** means Google did not accept the app > password: create a new one and paste it without your normal password. If Google sent you a > "Critical security alert", confirm it was you and try again. ### Server settings The Hub fills these in. You only need them for another app or for checking. | | Server | Port | Security | |---|---|---|---| | Incoming (IMAP) | `imap.gmail.com` | 993 | TLS | | Outgoing (SMTP) | `smtp.gmail.com` | 465 | TLS | | Username | your full Gmail address | | | If you change your Google password, Google revokes all app passwords. The mailbox then shows **The sign-in no longer works**: create a new app password and use **Reconnect**. ## Option B: Sign in with Google You, as the Hub's admin, create a small OAuth client in Google Cloud that only your Hub uses. It stays unverified, which is fine for personal use. Then everyone on your Hub can add Gmail accounts with **Sign in with Google**. ### What you need - A Google account to own the Google Cloud project (any account, it does not have to be the mailbox). - Your Hub opened over `https://`, or on `localhost`. Google only redirects to such addresses. The address does not have to be reachable from the internet: a Tailscale address such as `https://hub.tailnet-1234.ts.net` works. Raw IP addresses and `http://192.168.1.20` do not. See [Reaching your Hub](https://docs.posternmail.app/reach/) and [HTTPS](https://docs.posternmail.app/reach/https/). - `POSTERN_PUBLIC_URL` set to that address, so the redirect address stays the same however you open the Hub (see [Configuration](https://docs.posternmail.app/configuration/)). Without it, the Hub uses the address of the request. - Admin rights on the Hub. Google's console moves things around from time to time. The names below match the **Google Auth Platform** pages; Google's own guide is at . ### 1. Create a project and enable the Gmail API 1. Open and sign in. 2. Open the project picker at the top and click **New project**. Name it `Postern Hub`, click **Create**, then select the new project. 3. Open **APIs & Services → Library**, search for **Gmail API**, open it and click **Enable**. > **Check:** **APIs & Services → Enabled APIs & services** lists **Gmail API**. > **If it did not work:** make sure the new project is selected in the project picker. Enabling > an API can take a minute. ### 2. Configure the consent screen Open **Google Auth Platform** (the menu entry was called **OAuth consent screen** before). If it asks, click **Get started**. 1. **Branding:** app name `Postern Hub`, your email as the user support email and developer contact. Save. 2. **Audience:** user type **External**. 3. **Audience → Publishing status:** click **Publish app** and confirm, so the status reads **In production**. You do not need to submit the app for verification. 4. **Data Access → Add or remove scopes:** under **Manually add scopes**, paste `https://mail.google.com/` and click **Add to table**, then **Update** and **Save**. > [!WARNING] > Do not leave the app in **Testing** with test users. In Testing, Google ends every sign-in > after 7 days: each Gmail mailbox then shows **The sign-in no longer works** once a week. > Google documents this at > . The Hub asks for these scopes when someone signs in: | Scope | Why | |---|---| | `https://mail.google.com/` | Full Gmail access: read, label, archive, send and delete for good. Narrower scopes cannot delete permanently. It also covers the IMAP connection the Hub uses for push. | | `openid`, `email` | To learn which Gmail address signed in. | `openid` and `email` need no entry on the **Data Access** page. > **Check:** **Audience** shows **Publishing status: In production**, and **Data Access** > lists `https://mail.google.com/` under restricted scopes. > **If it did not work:** if **Publish app** is missing, you are on a Workspace project with > user type **Internal**; that is fine for Workspace accounts only (see > [Google Workspace](https://docs.posternmail.app/providers/google-workspace/)). ### 3. Create the OAuth client 1. In Postern, open **Settings → Admin** and find **Sign-in with Google and Microsoft**. Under **Google (Gmail)**, copy the redirect URI shown in step 4 (the copy button next to it). 2. In Google Auth Platform open **Clients → Create client**. 3. **Application type:** **Web application**. **Name:** `Postern Hub`. 4. **Authorized redirect URIs → Add URI:** paste the redirect URI. It is your Hub's address followed by `/api/v1/oauth/callback/google`, for example: ```text https://mail.example.com/api/v1/oauth/callback/google ``` It must match exactly: `https`, host, port, path, no trailing slash. 5. Click **Create**. Copy the **Client ID** and the **Client secret** (or download the JSON: Google may not show the secret again later). You do not need **Authorized JavaScript origins**. > **Check:** **Clients** lists `Postern Hub` as a web application with your redirect URI. > **If it did not work:** if the redirect URI in Postern starts with `http://` and is not > `localhost`, set up HTTPS first. Google rejects such URIs. ### 4. Give the client to your Hub Either paste it in the admin panel, or set it in the Hub's configuration. A value in the configuration wins: the admin panel then shows **Set in the Hub's configuration** and its fields are locked. **In the admin panel:** **Settings → Admin → Sign-in with Google and Microsoft → Google (Gmail)**: paste the **Client ID** and the **Client secret** and click **Save**. The secret is stored encrypted with the Hub's key. **In the configuration:** **Docker Compose:** Add the two variables to `~/postern/compose.override.yaml` (create the file if it does not exist): ```yaml services: hub: environment: POSTERN_GOOGLE_CLIENT_ID: "1234567890-abc.apps.googleusercontent.com" POSTERN_GOOGLE_CLIENT_SECRET: "GOCSPX-your-secret" ``` Apply it: ```sh cd ~/postern && docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add the two variables to `/etc/postern/hub.env` (the file already has them commented out): ```sh sudo nano /etc/postern/hub.env ``` ```ini POSTERN_GOOGLE_CLIENT_ID=1234567890-abc.apps.googleusercontent.com POSTERN_GOOGLE_CLIENT_SECRET=GOCSPX-your-secret ``` Apply it: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** The desktop app manages its Hub's configuration, so use the admin panel. The built-in Hub runs at `http://localhost:`, which Google accepts. The redirect URI shown in the admin panel contains that port. The app keeps the same port across restarts when it is free; if it ever has to pick another one, add the new redirect URI to the Google client as well. > **Check:** the admin panel shows **Google (Gmail)** with the chip **Set up** (or **Set in the > Hub's configuration**). > **If it did not work:** **Google sign-in wasn't saved. clientSecret is required** means you > entered only the client ID. Paste the secret as well. ### 5. Add your Gmail account 1. **Settings → Mailboxes → Add mailbox**, pick **Google**, type your Gmail address and click **Sign in with Google**. 2. Google warns **Google hasn't verified this app**. This is expected: it is your own app. Click **Advanced**, then **Go to Postern Hub (unsafe)**. 3. Allow access to your Gmail (tick the checkbox if Google shows one) and click **Continue**. 4. Google sends you back to Postern, which shows **Mailbox connected. Your mail is downloading now.** On the desktop app the Google page opens in your normal browser. That browser must be signed in to your Hub's web app with the same Postern account. On iOS and Android, tap **Open the web app** and add the mailbox there; it then appears on the phone by itself. > **Check:** **Settings → Mailboxes** shows the address with **Gmail · Downloading mail, …% > done**, then **Up to date**. > **If it did not work:** see [Troubleshooting](https://docs.posternmail.app/providers/gmail/#troubleshooting). Repeat step 5 for each Gmail account. Everyone on the Hub uses the same client. ## What the Hub does with Gmail ### With sign in with Google (Gmail API) - **Folders and labels.** Gmail's labels are Postern folders. Inbox, Sent, Drafts, Spam, Trash, Starred and Important are recognized. A message can carry several labels. Gmail's category tabs (Promotions, Social, ...) are not shown as folders, and archived mail without a label lives only in All Mail. - **Actions.** Archive removes the Inbox label. Tags are saved as Gmail labels. Permanent deletion works because of the full `https://mail.google.com/` scope. Gmail has no "answered" flag, so that state is not synced back. - **Threads** come from Gmail's own conversation IDs. - **New mail.** The Hub keeps one IMAP connection to `imap.gmail.com` open and waits for news in the inbox (Google's Pub/Sub push would need a Hub reachable from the internet). When it rings, or every 10 seconds, it asks the Gmail API for changes. If IMAP is turned off for the account, the 10-second checks continue on their own. - **Sending** goes through the Gmail API. Gmail files the copy in Sent itself. - **Devices.** The desktop and mobile apps sync Gmail directly with the same OAuth client. The Hub hands them the refresh token and the client ID and secret. ### With an app password (IMAP) - Gmail labels appear as IMAP folders. **All Mail**, **Important** and **Starred** are not synced as folders, because they repeat mail from other folders. Archive moves a message to All Mail. - Threads use Gmail's thread IDs (the `X-GM-THRID` extension). - Gmail's SMTP server saves sent mail itself, so the Hub does not add a second copy. - New mail: IMAP IDLE on the inbox, all folders checked every 2 minutes. ## Quota Gmail meters API use per Google account: 15,000 units per minute per user. The Hub and every device that syncs the same mailbox draw from that same budget, because they use the same OAuth client. Postern paces itself so it rarely hits the limit: | Who | Share of the per-user budget | |---|---| | The Hub | 60 % | | Each desktop or mobile app | 30 % | Opening a message, sending and other things you wait for go first; the first download and background work wait their turn. When Google still answers "rate limit exceeded", the Hub pauses (respecting Google's Retry-After), halves its pace and slowly speeds up again. You only see **Gmail is limiting how fast this mailbox can sync. Syncing continues by itself; nothing needs to be done.** when the throttling lasts 15 minutes or more. `POSTERN_GMAIL_QUOTA_SHARE` overrides the share for the process that reads it, as a fraction of the per-user limit (for example `0.8`; values above 1 count as 1). Set it on the Hub only when you know no device syncs the same Gmail accounts; otherwise leave it alone. Google's quota documentation: . ## Limits - An unverified OAuth client can be used by at most **100 Google accounts** over its lifetime. That is plenty for a household. For an organization, use [an Internal app in Google Workspace](https://docs.posternmail.app/providers/google-workspace/). - Everyone sees the **Google hasn't verified this app** warning once, when they connect. - Google sign-in is not offered when the Hub is opened over plain `http://` on a LAN address. The dialog then offers the app password only. - Google sign-in needs the Hub online: an app cannot start it while the Hub is unreachable ("Connecting Google needs your Hub, which can't be reached right now"). ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| | Google shows **Error 400: redirect_uri_mismatch** | The redirect URI in the Google client is not exactly the one in the admin panel. | Copy it again from **Settings → Admin** and add it to the client. Check `POSTERN_PUBLIC_URL`, port and `https`. | | Google shows **Access blocked: … has not completed the Google verification process** | The app is still in **Testing** and you are not a test user. | Publish it (step 2). | | The mailbox shows **The sign-in no longer works** after about a week | The app was in Testing when you connected. | Publish it, then **Reconnect** the mailbox. | | **This way of signing in isn't set up on your Hub.** | No Google client on the Hub, or the Hub is not on `https://` or `localhost`. | Step 4, or set up HTTPS. The Hub's message is "Google sign-in isn't set up on this Hub" or "Google sign-in needs the Hub to be reachable over HTTPS (or on localhost). Use an app password with IMAP instead, or set up HTTPS." | | **Couldn't connect the mailbox. Google sign-in was cancelled.** | You clicked **Cancel** on Google's page. | Start again. | | **Couldn't connect the mailbox. Google rejected the sign-in. Check the app registration and try again.** | Google refused the code exchange: wrong client secret, or the client was deleted. | Paste the client ID and secret again. | | **Couldn't connect the mailbox. This sign-in link has expired. Please try again.** | More than 10 minutes passed, or the link was used already. | Start again. | | **Couldn't connect the mailbox. Sign in to the Hub with the account that started adding the mailbox, then try again.** | The browser that came back from Google is signed in to the Hub as someone else, or not at all (typical on the desktop app). | Sign in to the Hub's web app in that browser with your account, then start again. | | **Couldn't connect the mailbox. The provider didn't grant offline access. Remove the app's access in your account settings and try again.** | Google did not hand out a refresh token. | Remove **Postern Hub** at and sign in again. | | **Couldn't reconnect the mailbox. You signed in as … , but this mailbox is ….** | You picked another Google account on Google's page. | Reconnect and pick the right account. | | Google shows **This app is blocked** or **admin_policy_enforced** | A Workspace admin blocks the app. | See [Google Workspace](https://docs.posternmail.app/providers/google-workspace/). | | **The sign-in was rejected** with an app password | Wrong or revoked app password. | Create a new app password. | To disconnect, remove the mailbox in Postern, then revoke access at (for sign in with Google) or delete the app password at . --- # Connect a Google Workspace account > Connect Google Workspace accounts with your own Internal OAuth client or an app password, and the Workspace admin settings that can block them. Source: https://docs.posternmail.app/providers/google-workspace/ Google Workspace accounts (your own domain, hosted by Google) work like [personal Gmail](https://docs.posternmail.app/providers/gmail/), with one advantage: if you administer the Workspace, your OAuth client can be an **Internal** app. Internal apps need no verification, show no warning, have no 100-account limit and do not expire sign-ins after 7 days. This page covers what is different for Workspace. | Path | When | |---|---| | **Internal OAuth client** (recommended) | You are the Workspace admin, or the admin creates the client for you. | | **App password** | Your admin allows 2-Step Verification and app passwords, and IMAP is on. | | **External OAuth client** | The same Hub must also connect personal `@gmail.com` accounts with Google sign-in. See [Personal Gmail and Workspace on one Hub](https://docs.posternmail.app/providers/google-workspace/#personal-gmail-and-workspace-on-one-hub). | ## How Postern recognizes Workspace When you type `you@example.com`, the Hub looks up the domain's MX records. If they point to Google (`*.google.com` or `*.googlemail.com`), the dialog calls the provider **Google Workspace** (for example **Connect Google Workspace**) and shows: "This domain uses Google Workspace. Sign in with Google using your own OAuth client (as an Internal app, no verification needed), or use an app password over IMAP if your administrator allows it." In **Settings → Mailboxes** the mailbox is labelled **Gmail** either way. ## Option A: Internal OAuth client ### What you need - A Workspace admin account (or an admin who does steps 1 to 3 for you). - Your Hub opened over `https://` or on `localhost`, and `POSTERN_PUBLIC_URL` set to that address. See [Gmail: what you need](https://docs.posternmail.app/providers/gmail/#what-you-need-1). - Admin rights on the Hub. ### 1. Create the project inside your organization 1. Open signed in with your Workspace account. 2. In the project picker click **New project**. Under **Organization** (or **Location**) choose your Workspace organization. Name it `Postern Hub` and click **Create**. 3. Open **APIs & Services → Library**, search for **Gmail API** and click **Enable**. > **Check:** the project picker shows `Postern Hub` under your organization, and **Enabled APIs > & services** lists **Gmail API**. > **If it did not work:** if your organization does not appear, your account is not allowed to > create projects in it. Ask a Workspace admin for the **Project Creator** role. ### 2. Configure the consent screen as Internal 1. Open **Google Auth Platform** and click **Get started** if asked. 2. **Branding:** app name `Postern Hub`, support email and developer contact. 3. **Audience:** user type **Internal**. Internal apps have no Testing or In production status and need no verification. 4. **Data Access → Add or remove scopes:** add `https://mail.google.com/` under **Manually add scopes**, then **Update** and **Save**. > **Check:** **Audience** shows **User type: Internal**. > **If it did not work:** **Internal** is only offered for projects inside a Workspace > organization. Go back to step 1. ### 3. Create the client and give it to your Hub Follow [Gmail, step 3](https://docs.posternmail.app/providers/gmail/#3-create-the-oauth-client) and [Gmail, step 4](https://docs.posternmail.app/providers/gmail/#4-give-the-client-to-your-hub) unchanged: a **Web application** client with the redirect URI from **Settings → Admin → Sign-in with Google and Microsoft**, then the client ID and secret in the admin panel or in `POSTERN_GOOGLE_CLIENT_ID` and `POSTERN_GOOGLE_CLIENT_SECRET`. > **Check:** the admin panel shows **Google (Gmail)** as **Set up** or **Set in the Hub's > configuration**. > **If it did not work:** see the [Gmail troubleshooting](https://docs.posternmail.app/providers/gmail/#troubleshooting). ### 4. Allow the app in the Admin console (if your organization restricts apps) If your organization limits which apps may access Google data, mark the client as trusted: 1. Open the Google Admin console, . 2. Go to **Security → Access and data control → API controls**. 3. Click **Manage Third-Party App Access**, then **Add app → OAuth App Name Or Client ID**. 4. Search for your client ID, select it, choose who it applies to and set it to **Trusted**. Google's help: . > **Check:** the app appears in the list with access **Trusted**. > **If it did not work:** changes in the Admin console can take a while to apply. Wait and try > the sign-in again. ### 5. Add the mailbox **Settings → Mailboxes → Add mailbox**, pick **Google**, type your work address and click **Sign in with Google**. Internal apps show no "unverified" warning. Allow access and you are back in Postern. > **Check:** **Settings → Mailboxes** shows the address with **Downloading mail, …% done**. > **If it did not work:** see [Troubleshooting](https://docs.posternmail.app/providers/google-workspace/#troubleshooting). ## Option B: App password ### 1. Make sure your admin allows it In the Google Admin console: - **Security → Authentication → 2-step verification**: **Allow users to turn on 2-Step Verification** must be on. Organizations that enforce security keys only may hide app passwords. - **Apps → Google Workspace → Gmail → End User Access**: **POP and IMAP access** must be enabled for your users. Google's help: . > **Check:** you can open with your work account. > **If it did not work:** "The setting you are looking for is not available for your account" > means app passwords are not allowed for you. Use Option A. ### 2. Create the app password and add the mailbox Follow [Gmail, Option A](https://docs.posternmail.app/providers/gmail/#option-a-app-password) from step 1. In the dialog, pick **Other** and type your work address so you can choose **Use a password** (picking **Google** goes straight to Google sign-in when the Hub has it). | | Server | Port | Security | |---|---|---|---| | Incoming (IMAP) | `imap.gmail.com` | 993 | TLS | | Outgoing (SMTP) | `smtp.gmail.com` | 465 | TLS | | Username | your full work address | | | > **Check:** the mailbox shows **Gmail · Downloading mail, …% done**. > **If it did not work:** **The sign-in was rejected** usually means IMAP access is off for > your account or the app password is wrong. ## What the Hub does with Workspace The same as with [Gmail](https://docs.posternmail.app/providers/gmail/#what-the-hub-does-with-gmail). One difference matters more in organizations: with Google sign-in, the Hub uses an IMAP connection to `imap.gmail.com` to learn about new mail quickly. If your admin turned IMAP off, sign-in still works and the Hub checks for changes every 10 seconds through the Gmail API instead. Aliases of your Workspace account (for example `sales@example.com`) can be added under **Settings → Identities & signatures**. Gmail must also know them as **Send mail as** addresses, or it sends with your main address. ## Personal Gmail and Workspace on one Hub A Hub has **one** Google OAuth client. An Internal client only accepts accounts from its own organization, so personal `@gmail.com` accounts cannot use it. Choose one of: - the Internal client for Workspace accounts, and **app passwords** for personal Gmail, or - an **External, In production** client for everyone. The 100-account limit and the "unverified app" warning then apply to the Workspace accounts too (see [Gmail limits](https://docs.posternmail.app/providers/gmail/#limits)). ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| | Google shows **Error 403: org_internal** | You signed in with an account outside the client's organization. | Use an account of that organization, or an External client. | | Google shows **This app is blocked** or **admin_policy_enforced** | Your organization restricts third-party apps. | Step 4: mark the client as **Trusted**. | | App passwords page not available | App passwords are off for you, or 2-Step Verification is off. | Ask your admin, or use Option A. | | **The sign-in was rejected** with an app password | IMAP is off for your account, or the password is wrong. | Check **POP and IMAP access** in the Admin console; create a new app password. | | Mail arrives with a delay of a few seconds | IMAP is off, so the Hub checks every 10 seconds instead of waiting for IMAP's notice. | Nothing to do, or turn IMAP on for the account. | More messages and their fixes are in the [Gmail troubleshooting](https://docs.posternmail.app/providers/gmail/#troubleshooting). --- # Connect Microsoft 365 and Outlook.com > Connect Outlook.com and Microsoft 365 mailboxes through Microsoft Graph, with your own Microsoft Entra app, browser sign-in or a sign-in code. Source: https://docs.posternmail.app/providers/microsoft/ This page covers Outlook.com, Hotmail, Live and MSN addresses, and work or school accounts on Microsoft 365. The Hub talks to them through **Microsoft Graph**, signed in with your Microsoft account. Passwords and app passwords do not work: Microsoft turned off password sign-in for mail on these accounts. Before anyone can add a Microsoft mailbox, the Hub's admin registers a free app in Microsoft Entra once and gives its client ID to the Hub. Postern ships no shared Microsoft app. ## How sign-in works There are two ways, and the dialog offers whichever your Hub can do: | | Sign in with Microsoft (browser) | Sign in with a code | |---|---|---| | Button | **Sign in with Microsoft** | **Sign in with Microsoft using a code** (or **Sign in with Microsoft** when it is the only way) | | What happens | Microsoft's sign-in page opens and sends you back to the Hub. | Postern shows a short code; you enter it at `microsoft.com/devicelogin` on any device. | | Needs | The Hub opened over `https://` or on `localhost`, and a redirect URI in the app registration | **Allow public client flows** in the app registration | | Blocked by | Nothing special | Organizations with Entra **security defaults** or policies that block the device code flow | When the Hub has an `https://` address, the browser sign-in comes first and the code is the fallback. On a plain `http://` LAN address only the code is offered. The phone apps always use the code. Either way, the tokens go to your Hub only. The device where you type the code never sees them. ## What you need - A Microsoft account that can create app registrations in Microsoft Entra. Any Microsoft account can (personal accounts get a default directory). For a company, an Entra admin may have to do it or approve the app. - Admin rights on the Hub. - For the browser sign-in: the Hub on `https://` (see [HTTPS](https://docs.posternmail.app/reach/https/)) and `POSTERN_PUBLIC_URL` set to that address (see [Configuration](https://docs.posternmail.app/configuration/)). ## 1. Register the app in Microsoft Entra Microsoft's guide: . 1. Open and sign in. 2. Go to **Entra ID → App registrations** (older menus: **Identity → Applications → App registrations**) and click **New registration**. 3. **Name:** `Postern Hub`. 4. **Supported account types:** pick the one that fits the mailboxes you will connect. It decides the tenant value in step 4. | Supported account types | Mailboxes | Tenant value | |---|---|---| | Accounts in any organizational directory and personal Microsoft accounts | Outlook.com and work or school accounts | `common` | | Personal Microsoft accounts only | Outlook.com, Hotmail, Live only | `consumers` | | Accounts in any organizational directory | Work or school accounts of any company | `organizations` | | Accounts in this organizational directory only | Your company only | your tenant ID or domain, for example `example.com` | 5. Leave **Redirect URI** empty for now and click **Register**. > **Check:** the app's **Overview** page shows an **Application (client) ID** (a GUID such as > `00000000-0000-0000-0000-000000000000`). > **If it did not work:** if **New registration** is greyed out, your organization does not > let users register apps. Ask an Entra admin. ## 2. Set up authentication Open the app's **Authentication** page. 1. **For the code sign-in:** under **Advanced settings**, set **Allow public client flows** to **Yes** and click **Save**. 2. **For the browser sign-in** (only if your Hub is on `https://` or `localhost`): click **Add a platform → Mobile and desktop applications**, enter a custom redirect URI and click **Configure**: ```text https://mail.example.com/api/v1/oauth/callback/microsoft ``` It is your Hub's address followed by `/api/v1/oauth/callback/microsoft`, exactly, without a trailing slash. Use **Mobile and desktop applications**, not **Web**: the Hub signs in as a public client without a secret, and Microsoft rejects that for a **Web** redirect. You do not need a client secret or a certificate. > **Check:** **Authentication** shows **Allow public client flows: Yes** and, if you added it, > the redirect URI under **Mobile and desktop applications**. > **If it did not work:** if you skip the redirect URI, the browser sign-in fails with > `AADSTS50011` and you can still use the code. ## 3. Add the permissions Open **API permissions → Add a permission → Microsoft Graph → Delegated permissions** and add: | Permission | Why | |---|---| | `Mail.ReadWrite` | Read mail, flag, move, delete, manage folders and categories | | `Mail.Send` | Send mail | | `User.Read` | Read the mailbox address of the account that signed in | | `offline_access` | Get a refresh token, so the Hub keeps syncing without asking you again | | `IMAP.AccessAsUser.All` | The push connection: the Hub keeps one IMAP connection open to learn about new mail at once | The Hub asks for exactly these at sign-in. Adding them here is what lets an admin approve them for the whole organization in advance. In a company where users may not consent to apps themselves, an admin clicks **Grant admin consent for (your organization)** on the same page. Microsoft's guide: . > **Check:** the list shows the five permissions; with admin consent, each says **Granted for > (your organization)**. > **If it did not work:** without `IMAP.AccessAsUser.All` everything still works, but new mail > is only picked up by the regular checks (every 45 seconds). ## 4. Give the client ID to your Hub Either use the admin panel or the Hub's configuration. A value in the configuration wins: the admin panel then shows **Set in the Hub's configuration** and its fields are locked. **In the admin panel:** **Settings → Admin → Sign-in with Google and Microsoft → Microsoft (Outlook, Microsoft 365)**: paste the **Application (client) ID**, enter the tenant value from step 1 (empty means `common`) and click **Save**. **In the configuration:** **Docker Compose:** Add the variables to `~/postern/compose.override.yaml` (create the file if it does not exist): ```yaml services: hub: environment: POSTERN_MICROSOFT_CLIENT_ID: "00000000-0000-0000-0000-000000000000" POSTERN_MICROSOFT_TENANT: "common" ``` Apply it: ```sh cd ~/postern && docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add the variables to `/etc/postern/hub.env` (they are already there, commented out): ```sh sudo nano /etc/postern/hub.env ``` ```ini POSTERN_MICROSOFT_CLIENT_ID=00000000-0000-0000-0000-000000000000 POSTERN_MICROSOFT_TENANT=common ``` Apply it: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** The desktop app manages its Hub's configuration, so use the admin panel. The built-in Hub runs at `http://localhost:`. For the browser sign-in, add `http://localhost:/api/v1/oauth/callback/microsoft` with that port as the redirect URI; the code sign-in works without it. `POSTERN_MICROSOFT_TENANT` takes `common`, `organizations`, `consumers`, a tenant ID or a domain. The admin panel rejects values with `/`, `?`, `#`, `:` or spaces ("Invalid tenant"). > **Check:** the admin panel shows **Microsoft (Outlook, Microsoft 365)** as **Set up** or > **Set in the Hub's configuration**. > **If it did not work:** **Microsoft sign-in wasn't saved** followed by a reason; fix the value > it names. ## 5. Add the mailbox 1. **Settings → Mailboxes → Add mailbox**, pick **Microsoft**, type your address and click **Sign in with Microsoft**. 2. **Browser sign-in:** Microsoft's page opens. Pick or enter your account, sign in and accept the permissions. You come back to Postern: **Mailbox connected. Your mail is downloading now.** On the desktop app the page opens in your normal browser, which must be signed in to your Hub's web app with the same Postern account. 3. **Code sign-in:** Postern shows **Open Microsoft's sign-in page and enter this code:** and a code such as `F4K9QX2M`. Click **Copy code**, then **Open microsoft.com/devicelogin** (any device works), paste the code, sign in and accept. Postern shows **Waiting for you to finish on Microsoft's site…** and then **you@outlook.com is connected**. On a phone, tap **Copy code and open sign-in**. The code is valid for about 15 minutes. > **Check:** **Settings → Mailboxes** shows the address with **Outlook · Downloading mail, …% > done**, then **Up to date**. > **If it did not work:** see [Troubleshooting](https://docs.posternmail.app/providers/microsoft/#troubleshooting). ## Server settings There is nothing to enter: the Hub uses Microsoft Graph at `https://graph.microsoft.com/v1.0` and, for push, IMAP at `outlook.office365.com`, port 993, TLS. For reference, the IMAP and SMTP servers Microsoft publishes are: | | Server | Port | Security | |---|---|---|---| | IMAP | `outlook.office365.com` | 993 | TLS | | SMTP (Outlook.com) | `smtp-mail.outlook.com` | 587 | STARTTLS | | SMTP (Microsoft 365) | `smtp.office365.com` | 587 | STARTTLS | Postern does not use them with a password. ## What the Hub does with Microsoft - **Recognizing the account.** Outlook.com, Hotmail, Live, Windows Live, MSN and Passport addresses are known. Your own domain is recognized as Microsoft 365 when its MX records point to `*.protection.outlook.com`; the dialog then says "This domain uses Microsoft 365. Sign in with your work or school account (OAuth). Some organizations require an administrator to approve the app first." - **Folders.** All mail folders and subfolders are synced. Inbox, Sent Items, Drafts, Archive, Deleted Items and Junk Email are recognized. Outbox, Conversation History and Sync Issues are left out. Every message is in exactly one folder. - **Tags** are saved as Outlook categories. - **Threads** come from Outlook's conversation IDs. - **Answered state** is not available through Graph, so Postern cannot show or set it for Microsoft mailboxes. - **New mail.** Graph's own push needs a Hub reachable from the internet, so the Hub keeps one IMAP connection to `outlook.office365.com` open and waits for news in the inbox. When it rings, or every 45 seconds, it asks Graph for changes. If IMAP is turned off for the mailbox, the 45-second checks continue on their own. - **Sending** goes through Graph. Exchange saves the copy in Sent Items. Messages larger than 4 MB are sent in parts (draft, then attachments through upload sessions), up to 150 MB. - **Devices.** The desktop and mobile apps sync Microsoft mailboxes directly; the Hub hands them the refresh token and the client ID. Mailboxes connected before the Hub asked for `IMAP.AccessAsUser.All` have no push connection. Use **Update sign-in** once to give the consent; until then, the 45-second checks apply. ## Limits - Microsoft throttles heavy use of Graph. The Hub waits as Microsoft asks and continues. You only see **Outlook is limiting how fast this mailbox can sync** when it lasts 15 minutes or more. - Sending is limited to 150 MB per message, plus your organization's own message size limits. - A full Microsoft mailbox shows **This mailbox is full at the provider. Free up space there and syncing continues.** ## Troubleshooting ### Messages in Postern | Message | Cause | Fix | |---|---|---| | **This way of signing in isn't set up on your Hub.** | No Microsoft client ID on the Hub ("Microsoft sign-in isn't set up on this Hub. An administrator can add a Microsoft client ID in Settings → Providers."), or the browser sign-in was started on a Hub without `https://`. | Step 4. The setting is in **Settings → Admin**. | | The dialog asks for a password for an Outlook address | The Hub has no Microsoft client ID, so it falls back to IMAP with a password, which Microsoft refuses. | Set up the client ID (steps 1 to 4) and start again. | | **Microsoft didn't start the sign-in. Check the client ID and tenant.** | Microsoft rejected the code request. | Check the client ID, the tenant value and **Allow public client flows**. | | **The code expired. Start again to get a new one.** | You did not finish within the code's lifetime (about 15 minutes). | Start again. | | **Sign-in was declined.** | You or an admin declined the permissions. | Start again and accept, or ask for admin consent. | | **The Hub restarted during sign-in. Start again.** | The Hub restarted while it waited for the code. | Start again. | | **Couldn't read the mailbox address of this Microsoft account.** | The account has no Exchange mailbox, or `User.Read` was not granted. | Use an account with a mailbox; check the permissions. | | **Couldn't connect the mailbox. Microsoft sign-in was cancelled.** | You cancelled on Microsoft's page. | Start again. | | **Couldn't connect the mailbox. Microsoft sign-in failed: …** | Microsoft returned an error; the `AADSTS` code is in the text. | See the table below. | | **Couldn't connect the mailbox. Microsoft rejected the sign-in. Check the app registration and try again.** | The code exchange failed, usually because the redirect is registered as **Web** instead of **Mobile and desktop applications**. | Fix step 2. | | **Couldn't connect the mailbox. Sign in to the Hub with the account that started adding the mailbox, then try again.** | The browser that came back from Microsoft is not signed in to the Hub as you. | Sign in to the Hub's web app in that browser, then start again. | | **The sign-in no longer works. Reconnect to keep getting mail.** | Password change, revoked consent, or a policy that ended the session. | **Reconnect** and sign in again. | ### Microsoft error codes | Code | Meaning | Fix | |---|---|---| | `AADSTS7000218` | The request needs a client secret: **Allow public client flows** is off. | Step 2, item 1. | | `AADSTS50011` | The redirect URI does not match the registration. | Add the exact URI under **Mobile and desktop applications** (step 2). | | `AADSTS700016` | The app is not found in the directory: wrong client ID, or the tenant does not fit the account types. | Check the client ID and the tenant value (step 1 table). | | `AADSTS50020` | The account is not part of the tenant the app allows. | Use `common` (and matching account types), or the right tenant. | | `AADSTS65001` | Consent is missing and users may not consent themselves. | An admin grants consent (step 3). | | `AADSTS530035` or "blocked by security defaults" | The organization blocks the code sign-in. | Use the browser sign-in (needs `https://`), or ask an admin to allow it. | | `AADSTS90002` | The tenant does not exist. | Fix `POSTERN_MICROSOFT_TENANT` or the tenant in the admin panel. | Microsoft's lookup for any code: . ### Other symptoms | Symptom | Cause | Fix | |---|---|---| | "Need admin approval" on Microsoft's page | Your organization does not let users consent to apps. | An admin grants consent (step 3). | | New mail shows up only after up to a minute | No push connection: IMAP is off for the mailbox, or the mailbox was connected before the IMAP permission was asked for. | Turn IMAP on in the Exchange admin center (mailbox → **Manage email apps**), then **Update sign-in**. | | Sending from an alias fails | The mailbox has no send-as right for that address. | Give the right in Exchange, or send from the main address. | To disconnect, remove the mailbox in Postern. To revoke the Hub's access at Microsoft: personal accounts at , work accounts at . --- # Connect iCloud Mail > Connect iCloud Mail (icloud.com, me.com, mac.com and iCloud+ custom domains) with an app-specific password. Source: https://docs.posternmail.app/providers/icloud/ iCloud Mail works over IMAP and SMTP with an **app-specific password**, a separate password that Apple creates for apps like Postern. This page covers `@icloud.com`, `@me.com` and `@mac.com` addresses and custom domains on iCloud+. ## What you need - An Apple Account with **two-factor authentication** (on for nearly all accounts). - Your iCloud Mail address. Your Apple Account email is not always your iCloud Mail address: if you sign in to Apple with, say, a Gmail address, the mailbox to connect is your `@icloud.com` address. You find it on an iPhone under **Settings → (your name) → iCloud → iCloud Mail**, or in iCloud Mail on . ## 1. Create an app-specific password 1. Sign in at . 2. Open **Sign-In and Security → App-Specific Passwords**. 3. Click **Generate an app-specific password** (or the **+** button), name it `Postern` and click **Create**. Enter your Apple Account password if asked. 4. Copy the password. It looks like `abcd-efgh-ijkl-mnop`. Apple shows it only once. Apple's help: . > **Check:** the list under **App-Specific Passwords** contains `Postern`. > **If it did not work:** if **App-Specific Passwords** is missing, two-factor authentication is > off for your Apple Account. Turn it on first. ## 2. Add the mailbox 1. **Settings → Mailboxes → Add mailbox** and pick **iCloud**. 2. Type your iCloud Mail address and click **Continue**. The dialog goes straight to the password form. Its note says: "iCloud Mail needs an app-specific password: sign in at account.apple.com, open Sign-In and Security → App-Specific Passwords and create one. Your Apple Account must use two-factor authentication." **Create an app password** opens Apple's page. 3. Paste the app-specific password into **App password**. The dashes do not matter. 4. Optionally fill **Your name on outgoing mail**, then click **Connect**. > **Check:** the dialog shows **you@icloud.com is connected**. **Settings → Mailboxes** shows > **iCloud · Downloading mail, …% done**, then **Up to date**. > **If it did not work:** see [Troubleshooting](https://docs.posternmail.app/providers/icloud/#troubleshooting). ### Custom domains (iCloud+) If your own domain uses iCloud Mail (its MX records point to `*.mail.icloud.com`), the Hub recognizes it and uses the same servers. Type the custom address in step 2. If iCloud refuses the sign-in, open **Server settings** and set **Username** to your `@icloud.com` address: the dialog notes "If signing in fails, use your @icloud.com address as the username." You can also connect the `@icloud.com` address and add the custom addresses under **Settings → Identities & signatures → Add an address**, so you can send from them. ## Server settings The Hub fills these in. | | Server | Port | Security | |---|---|---|---| | Incoming (IMAP) | `imap.mail.me.com` | 993 | TLS | | Outgoing (SMTP) | `smtp.mail.me.com` | 587 | STARTTLS | | Username | your iCloud Mail address | | | | Password | the app-specific password | | | Apple's reference: . ## What the Hub does with iCloud - **Sync** over IMAP. Inbox, Sent Messages, Drafts, Archive, Deleted Messages and Junk are recognized by their special-use flags or names. - **New mail** arrives at once through IMAP IDLE on the inbox. All folders are checked every 2 minutes. - **Sending** goes through `smtp.mail.me.com`. The Hub then saves a copy in your Sent folder. - **Tags** are saved as IMAP keywords when the server allows them. - **Devices.** The desktop and mobile apps connect to iCloud directly with the same app-specific password, which the Hub hands them. ## Limits - Apple limits how much mail an iCloud account can send per day and how many recipients a message can have. Postern does not change those limits. - Changing your Apple Account password revokes all app-specific passwords. The mailbox then shows **The sign-in no longer works**: create a new one and **Reconnect**. - Apple allows a limited number of active app-specific passwords. Revoke the ones you no longer use. ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| | **The sign-in was rejected.** | You used your Apple Account password, the app-specific password was revoked, or the username is wrong. | Create a new app-specific password. For a custom domain, set **Username** to your `@icloud.com` address. | | **The sign-in was rejected** although the password is new | The address is your Apple Account email, not your iCloud Mail address. | Use your `@icloud.com` address. | | **The mail server didn't answer.** | The Hub cannot reach `imap.mail.me.com` or `smtp.mail.me.com`. | Check the Hub's internet access and that outgoing ports 993 and 587 are open. | | The mailbox shows **The sign-in no longer works** | You changed your Apple Account password or revoked the app-specific password. | Create a new one and **Reconnect**. | | Sending from a custom address fails | The address is not set up in iCloud Mail. | Add it in iCloud Mail settings first, then under **Settings → Identities & signatures**. | To disconnect, remove the mailbox in Postern and revoke the app-specific password at (**Sign-In and Security → App-Specific Passwords**). --- # Connect Yahoo Mail and AOL > Connect Yahoo Mail and AOL Mail with an app password over IMAP and SMTP. Source: https://docs.posternmail.app/providers/yahoo/ Yahoo Mail and AOL Mail connect over IMAP and SMTP with an **app password**, a separate password that Yahoo or AOL creates for apps like Postern. Postern has no Yahoo or AOL sign-in page; your normal password does not work. The Hub recognizes these addresses: | Provider | Addresses | |---|---| | Yahoo Mail | `yahoo.com` and the country domains (`yahoo.de`, `yahoo.co.uk`, ...), `ymail.com`, `rocketmail.com` | | AOL Mail | `aol.com`, `aim.com` | Yahoo! JAPAN (`yahoo.co.jp`) is a separate service; the Hub looks its settings up like any other provider (see [Any IMAP server](https://docs.posternmail.app/providers/imap/)). ## What you need - Your Yahoo or AOL address and access to its account security page. - For some accounts, two-step verification has to be on before app passwords appear. ## 1. Create an app password 1. Open the app password page directly: - Yahoo: - AOL: Or sign in, open **Account Info → Account Security** and click **Generate app password** (on some accounts: **Generate and manage app passwords**). 2. Enter a name such as `Postern` and click **Generate password**. 3. Copy the password (16 letters) and click **Done**. Yahoo and AOL show it only once. Yahoo's help: . AOL's help: . > **Check:** the app password page lists `Postern`. > **If it did not work:** if there is no **Generate app password** link, turn on two-step > verification on the same **Account Security** page first. ## 2. Add the mailbox 1. **Settings → Mailboxes → Add mailbox**, pick **Other**, type your address and click **Continue**. 2. The dialog goes straight to the password form, with the note "Yahoo Mail needs an app password: open Account Security in your Yahoo account and generate an app password." (AOL: the same with "AOL"). **Create an app password** opens the page from step 1. 3. Paste the app password into **App password**, optionally fill **Your name on outgoing mail** and click **Connect**. > **Check:** the dialog shows **you@yahoo.com is connected**, and **Settings → Mailboxes** shows > the mailbox downloading mail. > **If it did not work:** see [Troubleshooting](https://docs.posternmail.app/providers/yahoo/#troubleshooting). ## Server settings The Hub fills these in. The username is your full address. | | Yahoo | AOL | Port | Security | |---|---|---|---|---| | Incoming (IMAP) | `imap.mail.yahoo.com` | `imap.aol.com` | 993 | TLS | | Outgoing (SMTP) | `smtp.mail.yahoo.com` | `smtp.aol.com` | 465 | TLS | ## What the Hub does with Yahoo and AOL - **Sync** over IMAP. Inbox, Sent, Draft, Archive, Trash and Bulk Mail (spam) are recognized by their special-use flags or names. - **New mail** arrives at once through IMAP IDLE on the inbox. All folders are checked every 2 minutes. - **Sending** goes through SMTP. The Hub then saves a copy in your Sent folder. - **Tags** are saved as IMAP keywords where the server allows them. - **Devices.** The desktop and mobile apps connect to Yahoo or AOL directly with the same app password, which the Hub hands them. In **Settings → Mailboxes**, AOL mailboxes are labelled **Yahoo**; the add dialog itself says **AOL Mail**. ## Limits - Yahoo and AOL limit how many connections one account may open at a time. The Hub and each desktop or mobile app that syncs the mailbox each use their own connections. If the mailbox shows **The mail server at imap.mail.yahoo.com is limiting how fast this mailbox can sync** under **Technical details**, that is the cause; it settles by itself. - Sending limits per day are Yahoo's and AOL's own. ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| | **The sign-in was rejected.** | You used your normal password, or the app password was deleted. | Create a new app password and paste it. | | The mailbox shows **The sign-in no longer works** | You changed your password or deleted the app password. | Create a new app password and **Reconnect**. | | **The mail server didn't answer.** | The Hub cannot reach Yahoo's or AOL's servers. | Check the Hub's internet access and that outgoing ports 993 and 465 are open. | | **Having trouble getting new mail**, and **Technical details** says the mail server is limiting how fast this mailbox can sync | Too many open connections to the account. | Close other mail apps that use the account, or wait; the Hub retries. | To disconnect, remove the mailbox in Postern and delete the app password on the account security page. --- # Connect Fastmail > Connect Fastmail with an API token over JMAP (recommended) or with an app password over IMAP and SMTP. Source: https://docs.posternmail.app/providers/fastmail/ Fastmail offers two ways in. The Hub recommends the API token, because JMAP tells the Hub about changes in every folder at once. | | API token (JMAP) | App password (IMAP and SMTP) | |---|---|---| | Button in the dialog | **Use an API token** (marked **Recommended**) | **Use a password** | | Live updates | Push for all folders | Push for the inbox (IDLE), other folders every 2 minutes | | Folders | A message can be in several folders (Fastmail's labels) | One folder per message | | Sent copy | Fastmail files it | The Hub saves it in Sent | JMAP support in Postern is newer and less tested than IMAP. If something looks wrong, the app password is the proven path. See [JMAP](https://docs.posternmail.app/providers/jmap/). The Hub recognizes `fastmail.com` and many of Fastmail's other domains (`fastmail.fm`, `fastmail.de`, `sent.com`, `messagingengine.com`, ...), and your own domain when its MX records point to `*.messagingengine.com`. ## Option A: API token (JMAP) ### 1. Create the token 1. Sign in to Fastmail and open **Settings → Privacy & Security → Integrations** (). 2. Under **API tokens**, click **Manage** and then **New API token**. 3. Name it `Postern`. Give it access to **Email** (not read-only) and **Email submission** (needed to send). 4. Click **Generate** (Fastmail may ask for your password) and copy the token. It starts with `fmu1-`. Fastmail shows it only once. Fastmail's help center: (search for "API tokens"). > **Check:** the API tokens list shows `Postern` with Email and Email submission access. > **If it did not work:** if you cannot find **API tokens**, use the app password (Option B) > instead. ### 2. Add the mailbox 1. **Settings → Mailboxes → Add mailbox**, pick **Other**, type your Fastmail address and click **Continue**. 2. Choose **Use an API token**. The dialog says: "Best: create an API token in Fastmail (Settings → Privacy & Security → Integrations → API tokens) with Email and Email submission access for instant updates over JMAP. Alternatively create an app password for IMAP/SMTP." 3. Paste the token into **API token** and click **Connect**. Leave **Server address** as it is (`https://api.fastmail.com/jmap/session`). 4. The token form has no name field. Set the name people see on your mail afterwards under **Settings → Mailboxes → Sender name**. > **Check:** the dialog shows **you@fastmail.com is connected**; **Settings → Mailboxes** shows > **Fastmail · Downloading mail, …% done**. > **If it did not work:** **The sign-in was rejected** means the token is wrong, revoked or > lacks access. Create a new one with both access types. ## Option B: App password (IMAP and SMTP) ### 1. Create the app password 1. In Fastmail open **Settings → Privacy & Security → Integrations** and, under **App passwords**, click **New app password**. 2. Name it `Postern` and choose access **Mail (IMAP/POP/SMTP)**. 3. Click **Generate** and copy the password. > **Check:** the app passwords list shows `Postern`. > **If it did not work:** make sure you chose an access type that includes IMAP and SMTP. ### 2. Add the mailbox 1. **Settings → Mailboxes → Add mailbox**, pick **Other**, type your address, click **Continue** and choose **Use a password**. 2. Paste the app password into **App password**, optionally fill **Your name on outgoing mail** and click **Connect**. > **Check:** **Settings → Mailboxes** shows **Fastmail · Downloading mail, …% done**. > **If it did not work:** see [Troubleshooting](https://docs.posternmail.app/providers/fastmail/#troubleshooting). ## Server settings | | Server | Port | Security | |---|---|---|---| | JMAP session URL | `https://api.fastmail.com/jmap/session` | 443 | HTTPS | | Incoming (IMAP) | `imap.fastmail.com` | 993 | TLS | | Outgoing (SMTP) | `smtp.fastmail.com` | 465 | TLS | | Username (IMAP) | your full Fastmail address | | | ## What the Hub does with Fastmail **Over JMAP:** - Folders are Fastmail's mailboxes; a message can be in several. Inbox, Sent, Drafts, Archive, Trash and Spam are recognized by their roles. If Archive is missing, the Hub creates it the first time you archive. - Tags are saved as JMAP keywords. Read, flagged and answered states are synced both ways. - New mail and every other change arrive through Fastmail's push stream. The Hub also checks every 5 minutes. - Sending: the message is uploaded, submitted and moved to Sent by Fastmail. Fastmail picks the sending identity that matches your From address: the exact address, then a `*@domain` identity, then your first identity. - Spam: marking as spam moves the message to Spam and sets the `$junk` keyword; marking it as not spam sets `$notjunk`. **Over IMAP:** as for [any IMAP server](https://docs.posternmail.app/providers/imap/#what-the-hub-does): IMAP IDLE on the inbox, all folders checked every 2 minutes, a copy of sent mail saved in Sent. ## Aliases and custom domains - With a custom domain on Fastmail, use your Fastmail login address (or the custom address) as the mailbox address; the Hub finds Fastmail from your MX records. - To send from an alias, set it up as a sending identity in Fastmail's settings first, then add it in Postern under **Settings → Identities & signatures → Add an address**. Over JMAP, an address Fastmail does not know is sent with your first identity. ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| | **The sign-in was rejected.** (API token) | The token is wrong, revoked, or has no Email access. | Create a new token with **Email** and **Email submission**. | | Reading works, sending fails (API token) | The token lacks **Email submission**. | Create a new token with both access types and use **Update sign-in**. | | **The sign-in was rejected.** (app password) | Wrong password, or the app password's access does not include IMAP and SMTP. | Create a new app password with **Mail (IMAP/POP/SMTP)**. | | Mail sent from an alias shows your main address | The alias is not a Fastmail sending identity. | Add it in Fastmail first. | | Something looks wrong with a JMAP mailbox | JMAP is less tested. | Use **Download again…**; if it persists, connect with an app password instead and report the problem. | To disconnect, remove the mailbox in Postern and delete the token or app password in **Settings → Privacy & Security → Integrations**. --- # Connect any IMAP server > Connect any IMAP and SMTP mail account, what autodetection checks, ports and security options, certificates, folder mapping, IDLE and troubleshooting. Source: https://docs.posternmail.app/providers/imap/ Postern works with any standard IMAP server for reading and SMTP server for sending: your web host, your company's server, a Dovecot box at home, GMX, WEB.DE, Posteo, mailbox.org, Zoho and many more. This page explains the settings, what the Hub detects for you and what to do when the connection fails. ## Providers the Hub knows For these the Hub fills in everything and shows a note about what the provider needs: | Provider | Addresses | IMAP | SMTP | What you need | |---|---|---|---|---| | GMX (Germany, Austria, Switzerland) | `gmx.de`, `gmx.net`, `gmx.at`, `gmx.ch` | `imap.gmx.net:993` TLS | `mail.gmx.net:587` STARTTLS | Turn on POP3/IMAP access in the GMX web settings (**E-Mail → POP3/IMAP**). | | GMX (international) | `gmx.com`, `gmx.us`, `gmx.co.uk`, `gmx.fr`, `gmx.es`, `gmx.it`, `gmx.ca`, `gmx.co.in` | `imap.gmx.com:993` TLS | `mail.gmx.com:587` STARTTLS | Turn on POP3/IMAP access in the GMX web settings. | | WEB.DE | `web.de` | `imap.web.de:993` TLS | `smtp.web.de:587` STARTTLS | Turn on POP3/IMAP access in the WEB.DE web settings. | | Posteo | `posteo.de` and Posteo's other domains | `posteo.de:993` TLS | `posteo.de:465` TLS | Your Posteo password. | | mailbox.org | `mailbox.org`, custom domains on mailbox.org | `imap.mailbox.org:993` TLS | `smtp.mailbox.org:465` TLS | Your mailbox.org password. | | Zoho Mail | `zoho.com`, `zohomail.com` and regional domains; custom domains on Zoho | `imap.zoho.com:993` TLS (regional: `.eu`, `.in`, `.com.au`, `.jp`, `.com.cn`; custom domains: `imappro.zoho.…`) | `smtp.zoho.com:465` TLS (custom domains: `smtppro.zoho.…`) | Enable IMAP in Zoho Mail (**Mail Accounts → IMAP**); with two-factor authentication, an app-specific password. | | Proton Mail | `proton.me`, `protonmail.com`, `protonmail.ch`, `pm.me`, custom domains on Proton | `127.0.0.1:1143` STARTTLS | `127.0.0.1:1025` STARTTLS | Proton Mail Bridge (paid plans), running where the Hub can reach it. | Gmail, Microsoft, iCloud, Yahoo, AOL and Fastmail have their own pages: see [Connect mailboxes](https://docs.posternmail.app/providers/). ### Proton Mail through Bridge Proton Mail does not offer IMAP directly; its Bridge app does. The Hub's note says: "Proton Mail is only reachable through Proton Mail Bridge (paid plans). Run Bridge where the Hub can reach it, use the password Bridge shows (not your Proton password) and, if Bridge runs on another machine, replace 127.0.0.1 with its address. Bridge uses a self-signed certificate, so certificate verification is turned off for it." `127.0.0.1` is the Hub's own machine. In Docker that is the Hub container, not your server, so put Bridge's address in **Server settings** instead. Bridge only listens on its own machine by default; see Proton's Bridge documentation for making it reachable. ## Add the mailbox ### 1. Start the dialog **Settings → Mailboxes → Add mailbox**, pick **Other**, type your full email address and click **Continue**. The Hub looks up your settings (see [What autodetection checks](https://docs.posternmail.app/providers/imap/#what-autodetection-checks)); this can take a few seconds. > **Check:** the dialog shows the password form, titled **Connect** and the provider or domain. > **If it did not work:** **Enter a full email address** means the address is incomplete. Use > the form `name@example.com`. ### 2. Check the server settings If the dialog shows a note such as "No published settings were found for this domain. These server names are a guess; check them with your mail provider.", open **Server settings** and compare with your provider's help page: | Field | What to enter | |---|---| | **Username** | Usually your full email address (the default). Some hosts use a separate login name. | | **Incoming (IMAP)** | Server name, port and security, for example `imap.example.com`, `993`, **TLS**. | | **Outgoing (SMTP)** | Server name, port and security, for example `smtp.example.com`, `587`, **STARTTLS**. | > **Check:** host names, ports and security match your provider's documentation. > **If it did not work:** if your provider publishes no settings, ask them, or look at the > account settings of another mail app that already works. ### 3. Enter the password and connect Enter the **Password** (or **App password** when the provider needs one; many do with two-step verification), optionally **Your name on outgoing mail**, and click **Connect**. The button shows **Checking the connection…** while the Hub signs in to the IMAP server and connects to the SMTP server. Nothing is saved unless both work. > **Check:** the dialog shows **you@example.com is connected**, and **Settings → Mailboxes** > shows the mailbox downloading mail. > **If it did not work:** the dialog names the problem; see [Troubleshooting](https://docs.posternmail.app/providers/imap/#troubleshooting). > After a connection error it opens **Server settings** for you. ## Ports and security | Security | Meaning | Usual ports | |---|---|---| | **TLS** | Encrypted from the first byte (implicit TLS) | IMAP 993, SMTP 465 | | **STARTTLS** | Starts unencrypted, then upgrades to TLS. The Hub refuses to continue if the upgrade fails. | IMAP 143, SMTP 587 | | **None** | No encryption. Your password and mail travel in clear text. | IMAP 143, SMTP 25 or 587 | Use **TLS** or **STARTTLS**. **None** is meant for a test server on the same machine; the Hub writes a warning to its log when it is used with any other host. The Hub uses TLS 1.2 or newer and checks the server's certificate against the host name you entered. Match the port to the security setting. 993 with **STARTTLS**, or 587 with **TLS**, fails with a timeout or a "secure connection" error. The Hub signs in with `AUTH PLAIN` (or `LOGIN` when the server offers nothing else) over the encrypted connection. A server that only offers OAuth for IMAP (like Gmail and Microsoft without an app password) cannot be used with a password. ## Self-signed certificates The app has no switch to accept an invalid or self-signed certificate. A server with such a certificate fails with **Can't make a secure connection to the mail server at …**. What to do: - **Best:** give the server a real certificate, for example from Let's Encrypt, and use the host name it was issued for. - **Proton Mail Bridge** is the exception: the Hub turns certificate checking off for it automatically, because Bridge always uses its own certificate on your own machine. - The Hub's API accepts `"insecureSkipVerify": true` per server when adding a password mailbox (`POST /api/v1/mailboxes`, see the [API reference](https://docs.posternmail.app/reference/api/)). Use it only for a server on a network you trust: without the check, anyone on the path can pretend to be the server and read your password. ## What autodetection checks When you type your address, the Hub tries these in order and uses the first answer: 1. **Built-in list**: the providers in the table above, plus Gmail, Outlook.com, iCloud, Yahoo, AOL and Fastmail. 2. **MX records** of your domain, to recognize domains hosted by Google Workspace, Microsoft 365, iCloud+, Fastmail, Zoho, mailbox.org or Proton. 3. **Published settings**, all fetched at once, each with a short timeout (4 seconds): - Mozilla's provider database for your domain (`https://autoconfig.thunderbird.net/v1.1/example.com`), - your domain's own autoconfig file at `https://autoconfig.example.com/mail/config-v1.1.xml` and `https://example.com/.well-known/autoconfig/mail/config-v1.1.xml` (with the placeholder address `user@example.com`, never yours), - Mozilla's provider database for the domain of your MX server (your host), skipping spam filter services such as Mimecast or Proofpoint, - DNS SRV records `_imaps._tcp`, `_imap._tcp`, `_submissions._tcp` and `_submission._tcp` (RFC 6186 and RFC 8314). 4. **MX guess**: `imap.` and `smtp.` on the domain of your MX server, when those names exist ("Mail for example.com is handled by host.example. These server names are a guess based on that; check them with your mail provider."). 5. **Plain guess**: `imap.example.com` (or `mail.example.com`) on 993 with TLS, and `smtp.example.com` (or `mail.example.com`) on 587 with STARTTLS. The lookups only fetch public `https://` addresses: the Hub does not probe your LAN, follows at most three redirects and reads at most 256 KB. Results are kept for an hour per domain (guesses for 10 minutes). Autodetection never sends your address to anyone; Mozilla's database and your domain only see the domain name. For a server on your LAN, autodetection ends with a guess: enter the settings under **Server settings** yourself. The connection itself may go to a LAN address. ## What the Hub does - **Folders.** Every folder you can open is synced, inbox first and trash and spam last. Container folders that cannot hold mail are not synced. A namespace prefix such as `INBOX.` (Courier, Cyrus) is hidden. - **Special folders** are found from the server's special-use flags (RFC 6154): `\Sent`, `\Drafts`, `\Trash`, `\Junk`, `\Archive`. Without them, the Hub goes by name, in many languages, for example: | Role | Names (examples) | |---|---| | Sent | Sent, Sent Items, Sent Messages, Sent Mail, Gesendet, Gesendete Objekte, Envoyés, Enviados, Inviati, Verzonden | | Drafts | Drafts, Draft, Entwürfe, Brouillons, Borradores, Bozze, Concepten | | Trash | Trash, Deleted, Deleted Items, Deleted Messages, Bin, Papierkorb, Corbeille, Papelera, Cestino | | Spam | Spam, Junk, Junk E-mail, Bulk Mail, Spamverdacht, Unerwünscht, Courrier indésirable | | Archive | Archive, Archives, Archiv, Archivo, Archivio, Archief | Archive moves mail to the archive folder and creates `Archive` if there is none. - **New mail.** The Hub keeps a second connection in IMAP IDLE on the inbox, renewed every 25 minutes, and syncs as soon as the server reports a change. All folders are checked every 2 minutes. A server without IDLE is checked every 2 minutes only. - **Changes** to read and flagged state come from CONDSTORE when the server supports it; otherwise the Hub compares recent messages every minute and whole folders every 6 hours. - **Tags** are saved as IMAP keywords, when the server allows custom keywords. - **Sending** goes through SMTP. The Hub then saves a copy in your Sent folder (except for Gmail, whose SMTP server does that itself). A server without SMTPUTF8 cannot send to addresses with non-ASCII characters. - **Threads** are built from the `Message-ID`, `In-Reply-To` and `References` headers. - **Devices.** The desktop and mobile apps connect to your server directly with the same settings and password, which the Hub hands them. The server must be reachable from those devices too, not only from the Hub. ## Change settings later **Update sign-in** in **Settings → Mailboxes** only asks for a new password. To change the server names, ports or username, remove the mailbox and add it again (nothing is deleted on the server). > [!NOTE] > Developers can run a local test mail server, `go run ./cmd/devmail` in `hub/`. It is not > meant for real mail. See [Development](https://docs.posternmail.app/development/). ## Troubleshooting | Message | Cause | Fix | |---|---|---| | **The sign-in was rejected.** The server rejected the sign-in. Check the username and password. … | Wrong username or password, or the provider wants an app password. | Check **Username** (full address or login name). Create an app password if you use two-step verification. Some providers (GMX, WEB.DE, Zoho) need IMAP turned on first. | | **The mail server didn't answer.** Couldn't connect to imap.example.com: the connection timed out. … | Wrong host or port, a port/security mismatch, or a firewall between the Hub and the server. | Check the pair (993 + TLS, 143 + STARTTLS). Test from the Hub's machine (below). | | **The mail server didn't answer.** Check the server settings below and try again. | Connection refused, unknown host, certificate problem or SMTP failure. | Check the server names. If receiving works elsewhere but this fails, check the **Outgoing (SMTP)** settings: 465 = TLS, 587 = STARTTLS. | | Mailbox shows **Can't make a secure connection to the mail server at …** | The certificate does not match the host name, has expired, or is self-signed. | Use the host name on the certificate, or see [Self-signed certificates](https://docs.posternmail.app/providers/imap/#self-signed-certificates). | | Mailbox shows **Can't reach the mail server at … Trying again.** | Network problem or the server is down. | Wait; the Hub retries. If it lasts, test the connection from the Hub's machine. | | Mailbox shows **This mailbox is full at the provider.** | The server reports the quota as exceeded. | Delete mail or buy more space at the provider. | | Sending fails with "server does not support internationalized addresses" | The SMTP server lacks SMTPUTF8 and a recipient has non-ASCII characters. | Send to the ASCII form of the address, or use another server. | To test from the Hub's machine (replace the host and port): ```sh openssl s_client -connect imap.example.com:993 -servername imap.example.com ``` ```sh openssl s_client -starttls smtp -connect smtp.example.com:587 -servername smtp.example.com ``` A working server prints its certificate chain and a greeting such as `* OK` (IMAP) or `250` (SMTP). A timeout means the port is blocked or wrong. With Docker, run the test inside the container or from the host; both use the same network unless you changed it. --- # Connect over JMAP > Connect a mailbox over JMAP with an API token, what works, which servers, and the current limits of JMAP support. Source: https://docs.posternmail.app/providers/jmap/ JMAP is a modern mail protocol (RFC 8620 and RFC 8621) that replaces IMAP and SMTP with one HTTPS API and pushes every change to the client at once. Postern can use it instead of IMAP. This page explains what works, how to connect and what to expect. > [!IMPORTANT] > JMAP support is **less tested** than Gmail, Microsoft and IMAP. It is used with Fastmail. If a > JMAP mailbox misbehaves, connecting the same account over [IMAP](https://docs.posternmail.app/providers/imap/) is the proven > fallback. ## Which servers | Server | How to connect | |---|---| | **Fastmail** | In the app. The Hub recognizes Fastmail and offers **Use an API token**. See [Fastmail](https://docs.posternmail.app/providers/fastmail/). | | Other JMAP servers (for example Stalwart or Cyrus) | Through the Hub's API only, see [Other JMAP servers](https://docs.posternmail.app/providers/jmap/#other-jmap-servers). The add dialog offers JMAP only for Fastmail. | ## What you need - The server's **JMAP session URL**, for example `https://api.fastmail.com/jmap/session`. It must use `https://`. - A **token** the server accepts as a Bearer token (`Authorization: Bearer …`), with access to read and change mail and to send. Postern does not connect to JMAP with a username and password. ## Connect Fastmail over JMAP The short version (details on the [Fastmail page](https://docs.posternmail.app/providers/fastmail/#option-a-api-token-jmap)): ### 1. Create a token In Fastmail, **Settings → Privacy & Security → Integrations → API tokens → New API token**, with access to **Email** (not read-only) and **Email submission**. > **Check:** you have copied a token that starts with `fmu1-`. > **If it did not work:** see the [Fastmail page](https://docs.posternmail.app/providers/fastmail/). ### 2. Add the mailbox **Settings → Mailboxes → Add mailbox → Other**, type the address, **Continue**, **Use an API token**. Paste the token into **API token**. **Server address** opens the field **Server address (JMAP session URL)**, already filled in. Click **Connect**. The Hub fetches the session and lists the folders once before it saves anything. > **Check:** the dialog shows **you@fastmail.com is connected**. > **If it did not work:** **The sign-in was rejected** means the server refused the token. > **The mail server didn't answer** means the session URL is wrong or unreachable. ## Other JMAP servers The add dialog only offers the token for Fastmail. For another JMAP server, add the mailbox with the Hub's API: `POST /api/v1/mailboxes` with this body (see the [API reference](https://docs.posternmail.app/reference/api/) for signing in to the API): ```json { "kind": "jmap", "email": "you@example.com", "displayName": "Your Name", "sessionUrl": "https://mail.example.com/.well-known/jmap", "token": "your-token" } ``` The Hub checks the session and the token first and answers with the new mailbox, or with an error: | Answer | Meaning | |---|---| | "A https sessionUrl and token are required" | The URL is not `https://` or the token is empty. | | "The server rejected the sign-in. …" (`auth_failed`) | The server refused the token. | | "Couldn't connect to mail.example.com: …" (`provider_error`) | The session URL could not be fetched or the server answered with an error. | | "This mailbox is already connected. Update its credentials instead." | The address is already connected over JMAP. | Once added, the mailbox appears in every app like any other, and **Update sign-in** in **Settings → Mailboxes** asks for a new token. ## What the Hub does over JMAP - **Session.** The Hub reads the session once and caches it (API, upload, download and push addresses, the mail account, the server's limits). It reads it again when the server says it changed. - **Folders** are the server's mailboxes, and a message can be in several (like Gmail labels). Inbox, Sent, Drafts, Archive, Trash and Spam are found by their roles. Archive, Trash and Spam are created when missing. - **States.** Read, flagged, answered and draft come from the `$seen`, `$flagged`, `$answered` and `$draft` keywords. Your tags are saved as keywords. Marking as spam sets `$junk`, marking as not spam sets `$notjunk`. - **First download.** Newest first, page by page, with progress. Changes made meanwhile are picked up. - **New mail and changes** arrive through the server's push stream (JMAP EventSource), for all folders. A stream silent for three minutes is reopened. The Hub also checks every 5 minutes. - **Sending.** The message is uploaded, stored in Drafts, submitted, then moved to Sent by the server. The sending identity is the one matching your From address: the exact address, then a `*@domain` identity, then the first identity of the account. If submission fails, the draft is removed again. - **Threads** come from the server's thread IDs. - **Devices.** The desktop and mobile apps connect to the JMAP server directly with the same token, which the Hub hands them. ## Limits - **Less tested** than the other connection types. - Only Bearer tokens; no username and password, no OAuth sign-in flow for JMAP servers. - The add dialog offers JMAP for Fastmail only. - If the server cannot report changes since the last sync (for example after a long time offline), the Hub downloads the message list again. Messages deleted at the server during that gap may stay in Postern. - Calendars and contacts over JMAP are not used. ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| | **The sign-in was rejected.** | The token is wrong, expired or revoked. | Create a new token; for an existing mailbox use **Update sign-in**. | | Reading works, sending fails | The token has no submission access, or your From address is not an identity at the server. | Create a token with send access; add the address as an identity at the server. | | Mail sent from an alias shows another address | The server has no identity for that address, so the first identity was used. | Add the alias as an identity at the server. | | Deleted messages still show | Changes during a gap were not reported. | Delete them in Postern too, or remove the mailbox and add it again. | | Anything else odd | JMAP is less tested. | Connect the account over [IMAP](https://docs.posternmail.app/providers/imap/) instead, and report the problem. | --- # Apps > The four Postern apps (web, desktop, iOS, Android), how they get your mail, what each needs, and how the Hub and the apps stay compatible. Source: https://docs.posternmail.app/apps/ Postern has four apps: the web app, the desktop app, and the iOS and Android apps. This page explains how they differ, what each one needs, and which settings belong to a single device. Every app signs in to your Hub and shows the same mailboxes, settings, rules, drafts and per-message state (snooze, pin, mute, follow-up). | App | Page | How you get it today | |---|---|---| | Web | [Web app](https://docs.posternmail.app/apps/web/) | Built into the Hub: open your Hub's address in a browser. | | Desktop (macOS, Windows, Linux) | [Desktop app](https://docs.posternmail.app/apps/desktop/) | Build it from source. No installers are published yet. | | iOS (iPhone, iPad) | [iOS app](https://docs.posternmail.app/apps/ios/) | Being prepared for the App Store. Until then, build it from source with Xcode. | | Android | [Android app](https://docs.posternmail.app/apps/android/) | Build it from source. | Two more pages cover what all apps share: [pairing a device](https://docs.posternmail.app/apps/pairing/) with a QR code or a short code, and [working offline](https://docs.posternmail.app/apps/offline/). > [!NOTE] > Postern is in beta and no releases are published yet. The **No app yet?** links in the web > app point at the project's releases page, which stays empty until the first release. ## Direct mode and through your Hub An app gets your mail in one of two ways. **Direct mode** (the app calls it "on this computer" or "on this phone"). The app runs the same mail engine as the Hub, inside the app. After you sign in, it fetches your mailbox sign-ins from the Hub once, keeps them encrypted on the device, connects straight to Gmail, Outlook, iCloud or your IMAP or JMAP server, and keeps its own copy of your mail. The Hub keeps everything else in sync: your account, mailbox settings, spaces, tags, rules, templates, drafts, settings and per-message state. Because the device has its own copy and its own connection to your providers, it keeps working when the Hub is down. See [Working offline](https://docs.posternmail.app/apps/offline/). **Through your Hub.** The app asks the Hub for everything, and the Hub fetches the mail. This is how the web app always works, because a browser can't talk to mail servers. While you use the web app, the Hub keeps a full copy of your mail (see [The Hub's copy of your mail](https://docs.posternmail.app/apps/web/#the-hubs-copy-of-your-mail)). | App | Direct mode | Through your Hub | |---|---|---| | Web | Never | Always | | Desktop | The default, when the build includes the mail engine | When you tick **Don't keep mail on this computer**, or the build has no engine | | iOS, Android | The default, when the build includes the mail engine | When the engine is missing or couldn't start; the app says so and tries again | The Hub records every time a device fetches or updates your mailbox sign-ins. You find these entries under **Settings → Security** as "Mailbox sign-ins sent to one of your devices". ## What each app needs | App | Needs | |---|---| | Web | A Hub that the browser can reach. Passkeys, Web Push and installing the app need HTTPS (or `localhost`). See [HTTPS](https://docs.posternmail.app/reach/https/). | | Desktop | A Hub that the computer can reach for the first sign-in. After that, only for the things listed in [What works without the Hub](https://docs.posternmail.app/apps/offline/#what-works-without-the-hub). Or no Hub at all: the app can run one for you (see [Run a Hub on this computer](https://docs.posternmail.app/apps/desktop/#no-server-run-a-hub-on-this-computer)). | | iOS | A Hub the phone can reach for the first sign-in, a Mac with Xcode to build the app, and a [push relay](https://docs.posternmail.app/relay/) for notifications while the app is closed. | | Android | A Hub the phone can reach for the first sign-in, the Android SDK and NDK to build the app, and a push relay with Firebase set up for notifications. | Your mailbox sign-ins are added once, in any app (or the web app), and reach every other device through the Hub. You don't add mailboxes per device. ## Comparison | | Web | Desktop | iOS | Android | |---|---|---|---|---| | Platforms | A current desktop or mobile browser | macOS (Apple silicon and Intel), Windows (x64), Linux (x64 and arm64) | iPhone and iPad | Android phones and tablets | | Where mail comes from | Your Hub | Direct from providers | Direct from providers | Direct from providers | | Copy of your mail on the device | What the browser already loaded (IndexedDB) | Full copy | Full copy | Full copy | | New-mail notifications | Web Push, also with the tab closed (needs HTTPS) | Native notifications while the app runs | Push through the relay (APNs) | Push through the relay (FCM; needs your own Firebase setup) | | Works without the Hub | No: shows only what it already loaded | Yes, after the first sign-in | Yes, after the first sign-in | Yes, after the first sign-in (not yet tested on Android) | | Biometric lock | No | No | Face ID, Touch ID or passcode | Fingerprint, face or device PIN | | How to get it today | Served by your Hub | [Build from source](https://docs.posternmail.app/apps/desktop/#build-the-desktop-app) | [Build from source](https://docs.posternmail.app/apps/ios/#build-the-app) | [Build from source](https://docs.posternmail.app/apps/android/#build-the-app) | ## Version compatibility The Hub and the apps agree on one number: the API version. The Hub publishes it at `/api/v1/info` as `apiVersion` (currently `1`), next to its own version and a list of capabilities. - **Web app.** It is built into the Hub, so it always has the Hub's version. There is nothing to keep in step. - **Desktop app.** Before it signs in, it reads `/api/v1/info`. If the Hub's `apiVersion` differs from the one the app speaks, it stops with **Your Hub is newer than this app** ("Update Postern on this computer, then connect again") or **Your Hub is too old for this app** ("Update your Hub, then connect again"). **Details** shows both numbers. - **iOS and Android apps.** They check that the address answers like a Hub, but don't compare the API version. - **Within one API version**, the Hub lists optional features as capabilities (for example `passkeys`, `relayPush`, `rules`, `sendLater`). Apps hide what the Hub doesn't offer, so an app that is a little newer or older than the Hub keeps working. The desktop and mobile apps carry their own copy of the mail engine, built from the same source as the Hub. Keep the Hub and the apps on the same release where you can. `postern-hub doctor` also checks that the Hub's public address answers with the expected API version (see [Doctor](https://docs.posternmail.app/admin/doctor/)). ## Per-device settings Most settings sync to all your devices. These belong to one device. A new device starts with the defaults below. | Setting | Default | Where | |---|---|---| | Notifications | On | Web and desktop: **Settings → Notifications → This device**. Phones: **Settings → Notifications → This device**. | | Sound | On | Same place as Notifications. | | App Lock (Face ID, Touch ID, fingerprint or passcode) | Off | Phones: **Settings → This phone → App Lock**. | The desktop app adds settings of its own that live on the computer, not on the Hub: see [Desktop App Options](https://docs.posternmail.app/apps/desktop/#desktop-app-options). > [!NOTE] > The Hub also stores a per-device value `cacheDays` (default 90) for an "offline window". No > app uses it yet: a device in direct mode keeps all the mail it has synced. ## Signing a device out **Settings → Devices** lists every device signed in to your account, with its platform, when it was last seen, its last IP address and whether notifications are on. **Sign out…** ends a device's session at once. The next time that device reaches the Hub, it deletes the mail and mailbox sign-ins it kept. See [Lost or stolen device](https://docs.posternmail.app/apps/pairing/#lost-or-stolen-device). --- # Web app > The web app built into your Hub, signing in, installing it as an app, Web Push notifications, and the copy of your mail the Hub keeps while you use it. Source: https://docs.posternmail.app/apps/web/ The web app is built into the Hub: open your Hub's address in a browser and sign in. This page covers signing in, installing it as an app, notifications, and the copy of your mail the Hub keeps for it. The Hub serves the web app from the same address as its API, for example `https://mail.example.com`. It always matches the Hub's version, so there is nothing to install or update. The same web app also runs inside the [desktop app](https://docs.posternmail.app/apps/desktop/). ## Browsers Use a current version of Chrome, Edge, Firefox or Safari, on a computer or a phone. The web app is built for modern browsers (ES2022). No list of supported browser versions is published. Some features need a secure page, that is HTTPS or `http://localhost`: | Feature | Needs HTTPS | |---|---| | Passkeys | Yes, and a host name rather than an IP address. Otherwise the sign-in page offers no passkey button. | | Web Push (notifications with the tab closed) | Yes | | Installing as an app, offline start | Yes (the service worker only runs on secure pages) | | Everything else | No | See [HTTPS](https://docs.posternmail.app/reach/https/) for the ways to give your Hub a certificate. ## First visit On a new Hub, the first visit opens the setup: **Set up your Hub**, then **Create the admin account**, then **Add a mailbox**. The setup may ask for a **Setup code** from the Hub's log (`postern-hub setup-code` prints it). The [setup guide](https://docs.posternmail.app/setup/) walks through this. People you invite get a link that opens **Create your account**. See [Users](https://docs.posternmail.app/admin/users/). ## Signing in The sign-in page offers whatever your Hub has set up: | Method | On the page | |---|---| | Email and password | **Email**, **Password**, **Sign in** | | Two-step verification | After the password: "Enter the 6-digit code from your authenticator app", or **Use a recovery code instead** | | Passkey | **Sign in with a passkey** (HTTPS or `localhost` only) | | Single sign-on | **Continue with** and the name of your identity provider, when the Hub has OIDC set up | | A code from another device | **Sign in with a code from another device**: see [Pairing](https://docs.posternmail.app/apps/pairing/#sign-in-a-browser-with-a-code) | How to set these up is in [Sign-in methods](https://docs.posternmail.app/admin/sign-in/). If the Hub signed this browser out, the sign-in page says why: "This device was signed out from another device, and the mail saved on it was removed" or "You were signed out because your sign-in ended, and the mail saved on this device was removed". ## Install it as an app The web app is a Progressive Web App. Its manifest names it **Postern**, opens it at the inbox in its own window, and a service worker keeps the app itself (not your mail) cached, so it starts even when the Hub doesn't answer. - **Chrome and Edge (computer):** the install icon at the right of the address bar, or the browser menu → **Install Postern**. - **Safari on a Mac:** **File → Add to Dock**. - **iPhone and iPad (Safari):** the share button → **Add to Home Screen**. - **Android (Chrome):** the browser menu → **Add to Home screen** or **Install app**. The manifest also declares that the app can open `mailto:` links. Browsers that support this for installed apps may offer it. > [!TIP] > On a phone, the [iOS](https://docs.posternmail.app/apps/ios/) or [Android](https://docs.posternmail.app/apps/android/) app is the better choice: it keeps > its own copy of your mail and works without the Hub. ## Notifications (Web Push) Open **Settings → Notifications**. Under **This device**, the row **Notifications in this browser** has a **Turn on** button. The browser then asks for permission; allow it. | What the row says | Meaning | |---|---| | Arrive even when Postern is closed. | Web Push works: the Hub sends notifications straight to your browser, also with the tab closed. | | Blocked for this site. Allow notifications in your browser's site settings, then turn them on here. | You (or the browser) denied permission. Change it in the browser's site settings. | | Shown while Postern is open in a tab. Your Hub isn't set up to deliver them when it is closed. | The Hub offers no Web Push key, so notifications only appear while a tab is open. | - Web Push is encrypted end to end to your browser and does not use the [push relay](https://docs.posternmail.app/relay/). - When a Postern tab is visible, new mail shows as a message inside the app instead of a system notification. - Clicking a notification opens the conversation. - **Sound** (on by default) and **Turn off** apply to this browser only. - Which mail notifies you (**All new mail**, **VIPs only**, quiet hours) is synced for all devices. See [Notifications](https://docs.posternmail.app/using/notifications/). ## The Hub's copy of your mail A browser can't connect to mail servers, so the Hub fetches mail for the web app. The apps on your other devices get mail straight from your providers and don't need this. To save disk space and work, the Hub keeps a full copy of your mail only while you use the web app: | Stage | When | What the Hub syncs | |---|---|---| | 1. Full copy | From your last use of the web app, for 7 days | All folders, message bodies, search: everything the web app shows. | | 2. Watching, copy kept | From day 7 until `POSTERN_HUB_MAIL_COPY_DAYS` (default 30) | Only each inbox: headers of the last 7 days, no bodies. Enough for notifications, rules, mute, blocked senders, the Screener, follow-up and snooze. The rest of the copy is kept as it was. | | 3. Watching, copy dropped | After `POSTERN_HUB_MAIL_COPY_DAYS` | Same as stage 2. Everything outside the recent inbox is deleted from the Hub. | When you open the web app again, the Hub goes back to stage 1 at once. From stage 2 it catches up where it stopped. From stage 3 it downloads your mail again, newest first, so older mail takes a while to appear. "Using the web app" means reading mail in a browser, or in the desktop app with **Don't keep mail on this computer**. Signing in a phone or computer through the browser does not count. ### Keep a full copy all the time Turn on **Settings → Reading & sending → Where your mail is kept → Keep a full copy of my mail on my Hub** to keep stage 1 for good. Use it if you mainly read mail in the web app and don't want the first visit after a break to start with a partial mailbox. It applies to your account only. ### Change how long the copy is kept `POSTERN_HUB_MAIL_COPY_DAYS` sets how many days after your last web app use the Hub deletes the copy. It applies to all users of the Hub. The minimum is 1; a value below 7 also shortens stage 1 to that many days. | Install | Where to set it | |---|---| | Docker Compose | `~/postern/compose.override.yaml`, under `services: hub: environment:`, then `docker compose up -d` | | Debian, Fedora, Raspberry Pi OS | `/etc/postern/hub.env`, then `sudo systemctl restart postern-hub` | | Desktop app (built-in Hub) | Not adjustable. The desktop app always uses the web app with its built-in Hub, so the copy stays at stage 1. | See [Configuration](https://docs.posternmail.app/configuration/) for every variable. ## When the Hub can't be reached The web app keeps what it has already loaded in the browser (IndexedDB) and keeps the app itself cached, so it can start and show that mail while the Hub is away. - A strip says **Can't reach your Hub. Changes are sent when it's back.** (or **You're offline.** when the computer has no network). Actions such as archive or mark as read are queued and sent when the Hub answers. - Lists and messages that were never opened in this browser can't be shown. - If nothing is saved yet, the page says **Can't reach your Hub.** and retries by itself, with **Try again now**. Details are in [Working offline](https://docs.posternmail.app/apps/offline/#the-web-app-when-the-hub-is-down). ## Approving new devices While you are signed in, the web app shows a prompt when someone uses a code from **Connect a device** to sign in to your account. Approving a phone or computer from the web app asks for your password first. See [Pairing a device](https://docs.posternmail.app/apps/pairing/). --- # Desktop app > The Postern desktop app for macOS, Windows and Linux, building it from source, connecting to a Hub, menus, options, updates, the built-in Hub, data folder and logs. Source: https://docs.posternmail.app/apps/desktop/ Postern for macOS, Windows and Linux is a real mail client: it gets your mail straight from your providers, keeps a copy on the computer and keeps working when your Hub is down. This page covers building it, connecting it, everything in its menus and options, and where it keeps its files. The app shows the same interface as the [web app](https://docs.posternmail.app/apps/web/) and adds what a desktop app needs: native notifications, an unread badge, a tray or menu bar icon, a `mailto:` handler, downloads, spell checking and an optional quick-compose shortcut that works from any app. ## Get the desktop app No installers are published yet. Until the first release, build the app from source. The build makes installers for the system you run it on. ### What you need - **Git** and **Node.js 24** or newer, with **pnpm 11** (`corepack enable` installs the right pnpm version). - **Go 1.27** or newer. The app's mail engine and its built-in Hub are the Hub program (`postern-hub`), compiled for your computer. - **bash**. The build scripts are bash scripts. On Windows, run the commands in Git Bash. - **Linux:** the `rpm` tool, if you want the `.rpm` package (`sudo apt install rpm` on Debian and Ubuntu). ### Build the desktop app ```sh git clone https://github.com/TheOriUHD/postern.git cd postern corepack enable pnpm install scripts/build-hub.sh --web-only pnpm --filter @postern/desktop bundle-hub pnpm --filter @postern/desktop dist ``` What the steps do: | Command | What it does | |---|---| | `scripts/build-hub.sh --web-only` | Builds the web app and puts it where the Hub embeds it. | | `pnpm --filter @postern/desktop bundle-hub` | Compiles the Hub for this system into `apps/desktop/resources/hub/-/`: macOS arm64 and x64, Windows x64, or Linux x64 and arm64. `-- --target linux/arm64` builds only the given targets; `-- --with-web` runs the web build first, so you can skip the previous step. | | `pnpm --filter @postern/desktop dist` | Bundles the app and runs electron-builder. The installers land in `apps/desktop/release/`. `-- --dir` makes only an unpacked app, without installers. | > [!IMPORTANT] > Don't skip `bundle-hub`. Without it the app has no mail engine: it can then only show your > Hub's web app (it says "This copy of Postern can't keep mail on this computer"), and it > can't run a Hub for you. > **Check:** `apps/desktop/release/` holds the installers listed below. > **If it did not work:** `bundle-hub` fails with "missing scripts/build-hub.sh" when it doesn't > run inside the repository, and with `go: command not found` when Go is missing. On Linux, > a failing `.rpm` step usually means the `rpm` tool is missing. ### What `dist` produces | System | Files in `apps/desktop/release/` | |---|---| | macOS | `Postern--arm64.dmg` and `Postern--x64.dmg`, plus a `.zip` of each (used by the updater) | | Windows | `Postern-Setup-.exe` (x64 installer) | | Linux | `Postern--.AppImage` and `.deb` for x64 and arm64, `.rpm` for x64 | The version is the one in `apps/desktop/package.json` (currently `0.1.0`). ### Unsigned builds Your build is unsigned unless you set signing certificates (`CSC_LINK` and `CSC_KEY_PASSWORD` for macOS, plus `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD` and `APPLE_TEAM_ID` for notarization; `WIN_CSC_LINK` and `WIN_CSC_KEY_PASSWORD` for Windows). An unsigned build works the same, with two differences: - It doesn't update itself (see [Updates](https://docs.posternmail.app/apps/desktop/#updates)). - The system warns before the first start when the installer came from somewhere else, for example when you copy it to another computer through a download or a chat app. | System | What you see | What to do | |---|---|---| | macOS | "Postern" can't be opened because Apple cannot check it for malicious software (wording varies by macOS version). | Open **System Settings → Privacy & Security**, scroll down and click **Open Anyway** next to the message about Postern. Then open the app again. An app you built on the same Mac usually opens without this. | | Windows | SmartScreen: "Windows protected your PC". | Click **More info**, then **Run anyway**. | | Linux | Nothing. | Make the AppImage executable (`chmod +x Postern-*.AppImage`) or install the `.deb` or `.rpm`. | ### Install your build | System | How | |---|---| | macOS | Open the `.dmg` for your Mac (`arm64` for Apple silicon, `x64` for Intel) and drag Postern to Applications. | | Windows | Run `Postern-Setup-.exe`. It installs for your user only, without asking for an administrator. | | Debian, Ubuntu | `sudo apt install ./Postern--.deb` | | Fedora | `sudo dnf install ./Postern--x64.rpm` | | Any Linux | Run the AppImage. | ## Connect to your Hub On the first start the app shows **Connect to your Hub**. 1. Type your Hub's address in **Hub address**, for example `https://mail.example.com` or `https://hub.tailnet-1234.ts.net`, and click **Connect**. 2. The app reads `/api/v1/info` from that address to check that a Hub answers. 3. A sign-in window opens with your Hub's own sign-in page. Sign in as usual (password, single sign-on, or a passkey where the window offers it), then click **Allow and open the app**. If you signed in a while ago, the Hub first asks for your password (or to sign in again) before it allows a new device. 4. The window closes by itself. The app gets your mailbox sign-ins from the Hub and starts downloading your mail. The first start takes a little while. > **Check:** **Settings** shows "Your Hub:" with your Hub's address and **Connected** at the top. > **If it did not work:** the connect screen says what went wrong (see the table below). > **Details** under the message shows the technical reason. On the connect screen: - **Cancel** stops a sign-in that is in progress. **Show Sign-in Window** brings the sign-in window back if it got hidden behind another window. A sign-in that isn't finished within 15 minutes is cancelled. - **Don't keep mail on this computer** connects "through your Hub" instead: the app shows the Hub's web app and stores no mail on the computer. If you switch a Hub to this later, the app offers to delete the copy it kept before (**Remove Copy**). - **Recent** lists the Hubs you used. Click one to connect again. The **×** next to an entry removes that Hub from this computer: after asking, it signs the computer out of that Hub and deletes the mail kept for it. Anything not yet sent from this computer, such as messages written while offline, is lost. - **How to set up a Hub** opens the setup guide. Development builds also show a `http://localhost:8080` shortcut. ### How the app reads the address - Without a scheme, the app adds `https://`, or `http://` for `localhost`, LAN addresses and single-word host names (a `.ts.net` name always gets `https://`). - Only the scheme, host and port count. A path is dropped: a Hub always lives at the root of its address. - Plain `http://` to anything other than this computer or a Tailscale address shows **This connection isn't encrypted**, because your password and mail would cross the network unprotected. **Connect anyway** continues. - A Hub behind Cloudflare Access works: the sign-in window first shows Cloudflare's own page (an email code), then your Hub's. If the Hub has a service token set (`POSTERN_ACCESS_CLIENT_ID`, `POSTERN_ACCESS_CLIENT_SECRET`), the app receives it at sign-in and sends it with every request. See [Cloudflare](https://docs.posternmail.app/reach/cloudflare/). ### Messages on the connect screen | Message | Meaning and what to do | |---|---| | Couldn't find *host* | The name doesn't resolve. Check the spelling, or connect Tailscale or your VPN. | | Couldn't reach *host* | The Hub isn't running, the port is wrong, or the computer is on another network. A Hub uses port 8080 unless set up otherwise. | | *host* didn't answer in time | The Hub is starting, or the network is slow. Try again in a moment. | | You're offline | The computer has no network. | | Your Hub's certificate isn't trusted | Self-signed, expired or for another name. The app never skips this check. Use a certificate from Let's Encrypt or Tailscale (see [HTTPS](https://docs.posternmail.app/reach/https/)), or add your own certificate authority to the computer's trusted certificates. | | *host* isn't a Postern Hub | Something answered, but without the Hub's API (wrong port or path). | | *host* asks for a password first | A web server in front of the Hub uses a browser password prompt (HTTP basic authentication). The app can't sign in to that. Protect the Hub with Tailscale, a VPN or Cloudflare Access instead. | | *host* answered with an error | The Hub or a proxy in front of it answered with an HTTP error. **Details** shows the status code. | | The port of *host* is blocked | Like browsers, the app refuses a few ports, such as 25, 110 or 6000. Run the Hub on another port. | | Your Hub is newer than this app / Your Hub is too old for this app | The API versions differ. Update the older side. See [Version compatibility](https://docs.posternmail.app/apps/#version-compatibility). | | This copy of Postern can't keep mail on this computer | The build has no mail engine. Tick **Don't keep mail on this computer**, or rebuild with `bundle-hub`. | ### Switch Hubs **File → Use a Different Hub…** (on macOS in the **Postern** menu, and in the tray menu) opens the connect screen. Choosing the Hub you are already on takes you back to it. ### Sign-in pages outside the app Single sign-on runs inside the sign-in window: it may visit your identity provider over HTTPS and then come back. Google's sign-in (when you add a Gmail mailbox) and Microsoft's device-code page open in your browser instead. ## Starting, restarting and being offline - **Starting.** The main window opens at once with the Postern logo while the app gets ready. Your mail then appears in the same window, on the page you were on when you quit, and other windows you had open come back too. - **If it can't start,** the window says why, with **Try again**, **Open Log Folder** and **Use a Different Hub…**. Examples: "This computer's disk is full", "The mail kept on this computer is damaged", "Another copy of Postern may still be running on this computer", "Postern is taking too long to start" (not ready after 30 seconds). - **If the app's background process stops while it runs,** Postern restarts it. Your windows stay as they are, including a message you are writing, and a "Postern is restarting…" strip shows until it is back. If it keeps stopping, the window says "Postern keeps stopping" and **Try again** starts it once more. - **Hub unreachable, mail on this computer.** Mail keeps working. The settings header and the sidebar say **Hub offline**, with the number of changes waiting. See [Working offline](https://docs.posternmail.app/apps/offline/). - **Hub unreachable, through your Hub.** The window shows an offline page. It retries by itself after 5, 10 and 20 seconds, then every 30 seconds, and at once when the network comes back. **Try again** retries now. A proxy answering 502, 503 or 504 counts as unreachable. ## Menus and shortcuts `⌘` on macOS, `Ctrl` on Windows and Linux. | Action | Menu | Shortcut | |---|---|---| | New message | File → New Message | `⌘N` | | New window | File → New Window | `⇧⌘N` | | Print | File → Print… | `⌘P` | | Settings | Postern → Settings… (macOS), File → Settings | `⌘,` | | Search mail | Edit → Find → Search Mail | `⌘F` | | Find on the page | Edit → Find → Find on Page… | `⌥⌘F` on macOS, `F3` on Windows and Linux | | Find next / previous | Edit → Find | `⌘G` / `⇧⌘G` | | Command palette | View → Command Palette… | `⌘K` | | Show or hide the sidebar | View → Show or Hide Sidebar | `⌘.` | | Zoom in / out / actual size | View | `⌘+` or `⌘=` / `⌘-` / `⌘0` | | Back / forward | Go | `⌘[` / `⌘]` on macOS, `Alt+←` / `Alt+→` on Windows and Linux | | Inbox | Go → Inbox | `⌘1` | | Next / previous conversation | Go | `⌥⌘↓` / `⌥⌘↑` on macOS; `J` / `K` everywhere | | Reply / Reply All / Forward | Message | `⌘R` / `⇧⌘R` / `⇧⌘F` | - `⌘R` replies, as in other mail apps. It never reloads the app. - Reply, Reply All and Forward act on the open conversation. - The web app's own keyboard shortcuts work too and win where they overlap. See [Keyboard shortcuts](https://docs.posternmail.app/using/shortcuts/). - On Windows and Linux the menu bar appears when you press `Alt`. - No shortcut on Windows or Linux uses `Ctrl+Alt`: on many keyboards that is how `AltGr` types characters such as `@`, `€` or `µ`. - The zoom level is remembered. - **Window → Main Window** brings the main window back after you closed it. On macOS the Dock menu has **New Message**, **New Window** and **Main Window**. - **Help** has **Postern Documentation**, **Setting Up a Hub**, **Report an Issue** and **Open Log Folder** (on Windows and Linux also **Check for Updates…** and About). ### Quick compose from anywhere A shortcut that opens a new message while you are in another app. It is off until you turn it on, and you choose the key: open **Desktop App Options**, switch on **Start a new message from any app** and click **Record Shortcut**. Postern suggests `⌃⌥⌘M` on macOS and `Alt+Shift+M` on Windows and Linux. It refuses keys your system or your typing needs, such as `⌥⌘M` ("Minimize All" on a Mac) or `Ctrl+Alt` with a letter on Windows. If another app already uses your choice, the options window says so. ## Desktop App Options Settings that belong to this computer rather than to your account. Open **Desktop App Options…** from the **Postern** menu on macOS, the **File** menu on Windows and Linux, the tray menu, or **Settings → Notifications** in the app. | Section | Option | What it does | |---|---|---| | Quick compose from anywhere | Start a new message from any app, Shortcut | See [above](https://docs.posternmail.app/apps/desktop/#quick-compose-from-anywhere). | | In the background | Show Postern in the menu bar (macOS) / Show Postern's icon near the clock | The tray or menu bar icon with the unread count and **New Message**. Some Linux desktops have no place for it. | | | Keep running when the window is closed (Windows, Linux) | Closing the window leaves Postern in the tray, so new mail is still announced. Needs the tray icon. | | | Open Postern when you log in | Installed copies on macOS and Windows. On Linux, add Postern to your desktop's startup apps yourself. | | | Open it in the background (Windows) | Starts at login without showing a window. | | Writing | Check spelling while typing | On a Mac it uses the languages from System Settings → Keyboard. On Windows and Linux, choose every language you write in. | | Email links | Default mail app | Makes Postern open `mailto:` links. See [System integration](https://docs.posternmail.app/apps/desktop/#system-integration). | | Mail on this computer | One row per Hub | The size of the mail kept for each Hub, "in use now" or "not in use", and **Remove…** for a copy that is not in use. | | About | Version, updates, Logs | **Check for Updates…** and **Open Log Folder**. | ## System integration - **Notifications.** One native notification per new mail whenever Postern is not the window you are working in, also when its window is visible behind another app. Clicking one brings Postern to the front and opens the conversation. **Settings → Notifications → Notifications on this computer** and **Sound** switch them for this computer. - **Unread badge.** On the Dock icon (macOS), as an overlay on the taskbar button (Windows), and on the launcher icon where the Linux desktop supports it. - **Tray or menu bar icon** with the unread count (beside the icon in the macOS menu bar, a dot on Windows and Linux). Its menu: **New Message**, **Show Postern**, **Desktop App Options…**, **Use a Different Hub…**, **Quit Postern**. - **Closing the main window keeps Postern running,** so notifications keep arriving. On macOS it stays in the Dock. On Windows and Linux it stays in the tray and says so the first time. Without a tray icon (switched off, or a Linux desktop without one), closing the window quits. - **Default mail app.** Choose **Default Mail App** in the menu (it has a check mark when Postern is the default), in Desktop App Options, or in **Settings → Notifications**. Then `mailto:` links open a new message in Postern. - macOS and Linux: it takes effect right away. If the system refuses, Postern says so and you set it in the system's own settings. - Windows: the system wants you to confirm it yourself. Postern opens **Settings → Default apps**; choose Postern for `MAILTO`. - A mail link clicked while you are not signed in brings Postern forward and opens the message as soon as you are connected. - **Downloads.** Attachments are saved straight to your Downloads folder, never over an existing file (a second `report.pdf` becomes `report (2).pdf`). The Dock or taskbar icon shows the progress, and a notification shows the file in its folder when you click it. PDF attachments open in a preview inside the app. - **Several windows.** **File → New Window** opens another window on the same page. Window sizes and positions are remembered, and open windows come back at the next start. - **Links** in mail open in your default browser. Only `http`, `https` and `mailto` links are ever handed to the system, and only your Hub's pages load inside the app. Right-click an address for **New Message to …** or **Copy Email Address**. - **Right-click** also offers **Copy Image** and **Save Image As…** on pictures, the usual text commands, **Spelling Languages** in text fields on Windows and Linux, and **Look Up** on a Mac. ## Updates Signed release builds check for updates 15 seconds after the start and every 6 hours, and download them in the background. When one is ready, a notification and the menu item **Restart to Update to** *version* install it right away; otherwise it installs the next time you quit. To turn the automatic check off, start the app with the environment variable `POSTERN_DISABLE_UPDATES=1`. These copies don't update themselves, and the About section of Desktop App Options says why: | Copy | Says | |---|---| | Unsigned builds (every build from source without certificates) | This copy of Postern doesn't update itself. | | `.deb` and `.rpm` packages | Updates come from your system's package manager. | | Started with `POSTERN_DISABLE_UPDATES=1` | Automatic updates are switched off on this computer. | | Development copies (`pnpm --filter @postern/desktop dev`) | This is a development copy. | **Check for Updates…** (the **Postern** menu on macOS, **Help** on Windows and Linux, and Desktop App Options) works in every copy: it asks the project's releases page for the newest version and offers **Open Download Page**. Until the first release is published, it can only answer "Couldn't check for updates". To update a build from source, pull the repository, run the build again and install the new installer over the old one. Your settings, sign-in and mail stay. ## No server? Run a Hub on this computer Builds that include the bundled Hub (every build made with `bundle-hub`) show **No server? Run a Hub on this computer** at the bottom of the connect screen. The app then starts a Hub in the background and connects to it. On first use you run the Hub's setup in the app window, like on a server. - The Hub listens on `127.0.0.1` only, on a free port the app picks (and keeps across starts, so you stay signed in). The app opens it as `http://localhost:`, where passkeys work. Other devices can't reach it. - The app shows the Hub's web app, so this Hub keeps a full copy of your mail. - It runs while the app runs and stops when you quit. Mail syncs, and scheduled sends, snoozes and rules run, only while Postern is open. The Hub also stops when the app is killed or crashes: the app holds a pipe to it, and the Hub runs with `POSTERN_EXIT_ON_STDIN_CLOSE=1`, which makes it stop when that pipe closes. - If it stops unexpectedly, the app starts it again (after 1, 2, then 3 seconds) and your windows stay as they are, with "Your Hub on this computer is restarting…" on top. After three stops in a row the window says so, and **Try again** starts it once more. - Its data and key live in the app's data folder: `hub-data/` and `hub-key/hub.key`. Its log is `logs/hub.log`. This is a good way to try Postern or to use it on one computer. Phones can't connect to it. When you want other devices, move to a server: [back up](https://docs.posternmail.app/admin/backups/) the data and key, restore them on the server, and connect the app to the server's address. ### Run Hub commands against the built-in Hub The app has no menu for Hub commands such as `doctor` or `backup`, but the bundled program is the normal `postern-hub` and accepts every [command](https://docs.posternmail.app/reference/cli/). Point it at the app's folders with `--data-dir` and `--key-file`. Quit Postern first for `restore` and `rotate-key`. On macOS: ```sh APP="/Applications/Postern.app/Contents/Resources/hub/hub" DATA="$HOME/Library/Application Support/Postern" "$APP" doctor --data-dir "$DATA/hub-data" --key-file "$DATA/hub-key/hub.key" "$APP" backup --data-dir "$DATA/hub-data" --key-file "$DATA/hub-key/hub.key" --out "$HOME/postern-backup" ``` The program sits in the app's `resources/hub/` folder (`hub.exe` on Windows). On Windows that is usually `%LOCALAPPDATA%\Programs\Postern\resources\hub\hub.exe`, with the data in `%APPDATA%\Postern`. From a `.deb` or `.rpm` it is usually `/opt/Postern/resources/hub/hub`, with the data in `~/.config/Postern`. An AppImage keeps it inside the image: run the AppImage with `--appimage-extract` to unpack it. `doctor` warns that `POSTERN_PUBLIC_URL` is not set. That is expected for the built-in Hub. ## Data folder and logs | System | Data folder | |---|---| | macOS | `~/Library/Application Support/Postern` | | Windows | `%APPDATA%\Postern` | | Linux | `~/.config/Postern` | Copies installed before the rename to Postern keep using their old `MailClient` folder until a `Postern` folder exists. | Inside | What | |---|---| | `desktop.json` | The Hub address, recent Hubs, window positions and your Desktop App Options. | | `hub-tokens.json` | This computer's sign-in to each Hub, encrypted with the system's key storage (Keychain, Windows data protection, or the Linux keyring). Without a Linux keyring the sign-in isn't saved, and you sign in again after each restart; the connect screen says so. | | `engine/-/` | The mail kept on this computer, one folder per Hub. Remove a copy in Desktop App Options or with the **×** on the connect screen, not by hand. | | `hub-data/`, `hub-key/hub.key` | The built-in Hub's data and master key, if you use it. | | `logs/desktop.log` | The app itself: windows, sign-in, updates. | | `logs/mail.log` | Getting and sending the mail kept on this computer. | | `logs/hub.log` | The built-in Hub, if you use it. | **Help → Open Log Folder** opens `logs`, and so do the **Open Log Folder** buttons on screens that report a problem and in Desktop App Options. Each log starts a new file once it reaches 10 MB, and one older file is kept. Postern removes sign-in secrets from `desktop.log` and `mail.log` before a line is written. ## Signing out Signing out (**Settings → Account → Sign out…**), or being signed out from **Settings → Devices** on another device, ends this computer's session and deletes the mail kept on it for that Hub. The connect screen then says "Signed out of …" or, if your Hub ended the session, "You were signed out of …". If the app can't read its saved sign-in (for example after you chose **Deny** in a Keychain prompt), it says "Your saved sign-in couldn't be read" and asks you to sign in again. ## Uninstalling 1. For each Hub, remove it with the **×** under **Recent** on the connect screen. This signs the computer out of the Hub and deletes the mail kept for it. Skipping this leaves the device in **Settings → Devices** on the Hub, where you can sign it out instead. 2. Remove the app: - macOS: drag Postern from Applications to the Trash. - Windows: **Settings → Apps → Installed apps → Postern → Uninstall**. - Linux: remove the package with your package manager, or delete the AppImage. 3. Uninstalling keeps the data folder. Delete it yourself (see [Data folder and logs](https://docs.posternmail.app/apps/desktop/#data-folder-and-logs)) to remove everything, including the built-in Hub's data and key. Back them up first if you still need that Hub. ## Developer tools Development copies have **View → Toggle Developer Tools** and a reload item. In a packaged build, start the app with `POSTERN_DEVTOOLS=1` to get the same items, for example on macOS: ```sh POSTERN_DEVTOOLS=1 /Applications/Postern.app/Contents/MacOS/Postern ``` Working on the app itself is described in [Development](https://docs.posternmail.app/development/). --- # iOS app > The Postern app for iPhone and iPad, building it with Xcode until it is in the App Store, connecting, notifications, App Lock, swipe actions and what iOS pauses in the background. Source: https://docs.posternmail.app/apps/ios/ Postern for iPhone and iPad is built for quick triage with one hand: swipe actions, quick replies, its own copy of your mail and an optional App Lock. This page covers getting the app, connecting it, notifications and how it behaves in the background. Like the desktop app, the iOS app runs the mail engine inside the app ("direct mode", see [Apps](https://docs.posternmail.app/apps/#direct-mode-and-through-your-hub)): it connects straight to your providers and keeps working when your Hub is down. ## Status The iOS app is being prepared for the App Store. Until it is there, build it from source with Xcode and install it on your own device. The in-app mail engine has been verified on the iOS simulator. ## Build the app ### What you need - A Mac with **Xcode** (from the App Store) and its command line tools. - **Git**, **Node.js 24** or newer with **pnpm 11** (`corepack enable`), and **Go 1.27** or newer. - **gomobile**, which builds the mail engine as an iOS framework. - For your own iPhone or iPad: an **Apple account** signed in to Xcode. A free account can install the app on your own devices for testing; Apple limits such installs to 7 days, after which you build and install again. Push notifications need a paid **Apple Developer Program** membership. ### Build and run ```sh git clone https://github.com/TheOriUHD/postern.git cd postern corepack enable pnpm install go install golang.org/x/mobile/cmd/gomobile@latest golang.org/x/mobile/cmd/gobind@latest export PATH="$(go env GOPATH)/bin:$PATH" gomobile init apps/mobile/scripts/build-engine.sh pnpm --filter @postern/mobile ios ``` | Command | What it does | |---|---| | `apps/mobile/scripts/build-engine.sh` | Builds the mail engine with gomobile into `apps/mobile/modules/mail-engine/ios/Engine.xcframework` (device and simulator). `IOS_MIN` sets the minimum iOS version of the framework (default `15.1`). | | `pnpm --filter @postern/mobile ios` | Runs `expo run:ios`: generates the Xcode project in `apps/mobile/ios/`, installs the native dependencies, builds the app and starts it in the iOS simulator. | > [!IMPORTANT] > Without `build-engine.sh` the app still builds, but without the mail engine. It then loads > all mail through your Hub, and **Settings → About** says "This version of the app loads mail > through your Hub." > **Check:** the simulator opens Postern with **Scan QR code**, **Enter Hub address** and **Try > the demo**. > **If it did not work:** `build-engine.sh` stops with "gomobile not found" when `gomobile` is > not on your `PATH`: run the `export PATH` line again. Rebuild the native app > (`pnpm --filter @postern/mobile ios`) after every `build-engine.sh` run. ### Install it on your iPhone or iPad 1. Connect the device with a cable and turn on **Developer Mode** on it (**Settings → Privacy & Security → Developer Mode**) if iOS asks for it. 2. Open `apps/mobile/ios/Postern.xcworkspace` in Xcode. Under **Signing & Capabilities**, choose your team for both targets, **Postern** and **PosternNotificationService**. 3. If Xcode says the bundle identifier `app.postern` is not available to your team, set your own in `apps/mobile/app.json` (`expo.ios.bundleIdentifier`, for example `com.example.postern`) and regenerate the project: ```sh cd apps/mobile npx expo prebuild --platform ios --clean ``` 4. Build a release build onto the device: ```sh cd apps/mobile npx expo run:ios --device --configuration Release ``` Pick your device from the list. > **Check:** Postern starts on the device. > **If it did not work:** on the device, open **Settings → General → VPN & Device > Management** and trust your developer certificate, then start the app again. > [!NOTE] > A debug build (without `--configuration Release`) loads its code from the development server > on your Mac (`pnpm --filter @postern/mobile start`) and does not work away from it. ### Push notifications for your own build Apple delivers push notifications only to apps signed by the team whose key sent them. A build you signed yourself therefore needs a [push relay](https://docs.posternmail.app/relay/) that has an APNs key from your own Apple Developer account and your bundle identifier as its topic (`APNS_TOPIC`). Builds run from Xcode get development push tokens, so that relay also needs `APNS_SANDBOX=true`. See [Run your own relay](https://docs.posternmail.app/relay/run-your-own/). Without a working relay the app still works; you only get no notifications while it is closed. ## Connect to your Hub The first screen offers three ways in. | Button | What happens | |---|---| | **Scan QR code** | Scan the code from **Settings → Devices → Connect a device** on a device that is already signed in, or in the web app. Fastest. See [Pairing a device](https://docs.posternmail.app/apps/pairing/). | | **Enter Hub address** | Type the address, for example `mail.example.com` or `192.168.1.20:8080`, tap **Continue**, then **Sign in with browser**. | | **Try the demo** | Sample mailboxes on the phone. Nothing is sent. | With **Enter Hub address**: 1. The app checks the address. It shows the Hub's name and version, and "Not encrypted (HTTP)" for a plain HTTP address. 2. **Sign in with browser** opens your Hub's sign-in page in a secure browser sheet. Sign in with a passkey, your password (and two-step code), or single sign-on. 3. Tap **Allow and open the app**. The sheet closes and the app says "Setting up your mailboxes… The first time can take up to half a minute." The app never sees your password: it receives a session through a one-time code protected with PKCE. If the Hub hasn't been set up yet, the app says so and offers **Open setup in browser**. A Hub behind Cloudflare Access works: the browser sheet first asks for your email address (Cloudflare's code), then shows your Hub's page. Scanning the QR code from the web app skips the email step. ### Unencrypted (HTTP) Hubs The app connects over plain HTTP without asking only when the Hub is on the device or the local network: `localhost`, private addresses (10.x, 172.16 to 31.x, 192.168.x, 100.64 to 127.x), names ending in `.local`, `.lan`, `.home.arpa` or `.internal`, and single-word names. Any other HTTP address shows **This Hub isn't encrypted** and needs **Connect without encryption**. iOS itself allows plain HTTP only to local network addresses (IP addresses, single-word names and `.local` names). A Hub reached over HTTP by any other name needs HTTPS. See [HTTPS](https://docs.posternmail.app/reach/https/). ## Where your mail comes from **Settings → About** shows under **Your mail**: | Row | Values | |---|---| | Mail is loaded | **On this iPhone** (direct mode) or **Through your Hub** | | Your Hub | **Connected**, **Sending 3 changes…**, or **Can't be reached** (with the number of changes waiting) | | Last in step with your Hub | When the phone last synced with the Hub | If the engine couldn't start, the app uses your Hub's copy, shows "Showing mail from your Hub" and offers **Try loading mail on this iPhone again**. It also tries again by itself whenever you open it. The **Details** section below lists the app version, the Hub version and the connection state, which helps when you ask someone for help. ## Notifications Turn them on in **Settings → Notifications → This device → Notifications** and allow them when iOS asks. | Message | Meaning | |---|---| | Your Hub isn't set up to send notifications yet. Whoever runs it can turn that on in the Hub's settings. | The Hub has no push relay (`POSTERN_RELAY_URL` is empty). | | Notifications are turned off for Postern in the Settings app. | You denied permission. **Open Settings** goes there. | | Notifications will be turned on as soon as your Hub can be reached. | The Hub is down; the app registers later. | - New mail shows as a message from its sender, with the sender's picture, the subject and the first words. - **Show previews on phones** (in the same screen, synced for all devices) controls whether the sender and subject travel through the relay and Apple. Turned off, the notification only says "New mail". See [What the relay sees](https://docs.posternmail.app/relay/what-it-sees/). - **Archive** and **Mark as Read** buttons appear when you press and hold a notification. They run in the background, without opening the app. - When you read or archive mail elsewhere, its notifications are removed the next time the app syncs. Once nothing in the Inbox is unread, all mail notifications go. - **Notify me about** (**All new mail**, **VIPs only**, **Nothing**) and **Quiet hours** apply to all your devices. See [Notifications](https://docs.posternmail.app/using/notifications/). ## App Lock **Settings → This iPhone → App Lock** asks for Face ID, Touch ID or your passcode when you open Postern. It is a per-device setting and off by default. - The lock covers the app before any mail is shown, and covers it in the app switcher. - It locks again after the app has been in the background for more than a minute. - After a cancelled prompt, tap **Unlock**. Too many failed tries say "Too many tries. Unlock with your passcode." - If you remove the device passcode, App Lock turns itself off and says so. - A request to connect a new device waits until you unlock the app. ## Swipe actions Swipe a conversation in a list to act on it. A full swipe does the action. Choose the actions in **Settings → Swipe actions**, for **Swipe right** and **Swipe left**: | Choice | Default | |---|---| | Archive | Swipe left | | Trash | | | Mark as read or unread | Swipe right | | Star | | | Snooze | | | Nothing | | The choices apply to Postern on all your devices. ## Offline and in the background In direct mode the app reads, searches, sends and organizes mail without your Hub, and syncs the changes when it is back. See [Working offline](https://docs.posternmail.app/apps/offline/). iOS pauses apps soon after you leave them. While Postern is paused: - It doesn't fetch mail and keeps no connection to your providers or your Hub. - New-mail notifications come from your Hub through the push relay. Your Hub watches your inboxes all the time, so these arrive within seconds. - Scheduled sends, snoozes, follow-ups and rules are run by your Hub, not by the phone. - Mail written while offline waits in the phone's outbox until you open the app again. When you open the app, it catches up at once. The app does not use iOS background refresh, so without a push relay nothing new shows until you open it. ## Apple Watch Postern on Apple Watch shows your Inbox on your wrist. On the watch you can read a conversation, reply by dictation or a quick reply, and archive, trash, star or snooze. It is installed with the iPhone app and needs the phone to be signed in to your Hub (not the demo). To connect it, tap **Connect** on the watch and confirm on the iPhone. You can also go to **Settings → Apple Watch → Connect Apple Watch** on the phone. The watch gets its own sign-in to your Hub, listed as "Apple Watch" next to your phone in **Settings → Devices**. That sign-in is limited: - It never receives your mailbox passwords. - When you sign the phone out, the watch is signed out too. - With Hubs before companion devices (no `companionDevices` capability), the phone pairs the watch instead. It then shows as an "iPhone or iPad" device named "Apple Watch", and you sign it out on its own. When the watch can't reach your Hub, it goes through your iPhone. ## Lost your phone Sign it out from **Settings → Devices** on another device. See [Lost or stolen device](https://docs.posternmail.app/apps/pairing/#lost-or-stolen-device). --- # Android app > The Postern app for Android, building it from source, what push notifications need (Firebase Cloud Messaging), UnifiedPush, and Android's rules for unencrypted Hubs. Source: https://docs.posternmail.app/apps/android/ Postern for Android is the same app as the [iOS app](https://docs.posternmail.app/apps/ios/), built from the same source. This page covers what is different on Android: how to build it, what push notifications need, and Android's rules for Hubs without HTTPS. Connecting, App Lock, swipe actions and offline use work as described on the iOS page. ## Status There is no Android release yet: build the app from source. The in-app mail engine is set up for Android (`build-engine.sh android`), but it has not been tested end to end on Android yet, and neither has push. If the engine is missing or doesn't start, the app loads mail through your Hub and says so under **Settings → About**. ## Build the app ### What you need - **Git**, **Node.js 24** or newer with **pnpm 11** (`corepack enable`), and **Go 1.27** or newer. - **Android Studio**, or the Android command line tools, with the **Android SDK** (platform `android-24` or newer) and the **NDK** (r26 or newer). - **JDK 17**. - **gomobile**, which builds the mail engine as an Android library. ### Build and run Set `ANDROID_HOME` to the SDK and `ANDROID_NDK_HOME` to the NDK. The paths below are Android Studio's defaults on macOS; on Linux the SDK is usually in `~/Android/Sdk`. ```sh export ANDROID_HOME="$HOME/Library/Android/sdk" export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/" git clone https://github.com/TheOriUHD/postern.git cd postern corepack enable pnpm install go install golang.org/x/mobile/cmd/gomobile@latest golang.org/x/mobile/cmd/gobind@latest export PATH="$(go env GOPATH)/bin:$PATH" gomobile init apps/mobile/scripts/build-engine.sh android pnpm --filter @postern/mobile android ``` | Command | What it does | |---|---| | `apps/mobile/scripts/build-engine.sh android` | Builds the mail engine with gomobile into `apps/mobile/modules/mail-engine/android/libs/engine.aar`. `ANDROID_API` sets the minimum API level (default `24`). `all` builds iOS and Android. | | `pnpm --filter @postern/mobile android` | Runs `expo run:android`: generates the Android project in `apps/mobile/android/`, builds a debug build and installs it on the running emulator or connected phone. | > **Check:** the app opens with **Scan QR code**, **Enter Hub address** and **Try the demo**. > **If it did not work:** "Android build needs ANDROID_HOME and ANDROID_NDK_HOME" means one of > the two variables is not set. "gomobile not found" means `gomobile` is not on your `PATH`. A debug build loads its code from the development server on your computer (`pnpm --filter @postern/mobile start`) and allows plain HTTP to any address. For a build that runs on its own, build the release variant: ```sh cd apps/mobile npx expo run:android --variant release ``` Expo's generated project signs it with a debug key unless you set up your own signing key in `apps/mobile/android/app/build.gradle`. That is enough to install it on your own phone. ## Push notifications: what a build needs (FCM) Android notifications go through Firebase Cloud Messaging (FCM). The repository ships no Firebase configuration. A build made straight from it gets no push token, so turning on notifications in the app fails with an error. To build the app with push: 1. In the [Firebase console](https://console.firebase.google.com/), create a project, or use the one your relay uses (it must be the same project). Add an Android app with the package name `app.postern` (`expo.android.package` in `apps/mobile/app.json`; use yours if you changed it). 2. Download `google-services.json` for that app and put it at `apps/mobile/google-services.json`. It identifies your Firebase project. Leave it out of a public fork if you want to keep the project ID private. 3. In `apps/mobile/app.json`, add `"googleServicesFile": "./google-services.json"` under `expo.android`. 4. Regenerate the project and build: ```sh cd apps/mobile npx expo prebuild --platform android --clean npx expo run:android --variant release ``` 5. Give your [push relay](https://docs.posternmail.app/relay/) a service-account key of the same Firebase project (`FCM_CREDENTIALS_FILE`, see [Run your own relay](https://docs.posternmail.app/relay/run-your-own/)), and point your Hub at the relay with `POSTERN_RELAY_URL`. 6. Test it end to end: sign in on the phone, turn on **Settings → Notifications → This device → Notifications**, send yourself a message, and check that the notification arrives while the app is in the background and after you swiped it away. > **Check:** the notification arrives within a few seconds, and **Settings → Devices** in the > web app shows "notifications on" for the phone. > **If it did not work:** "Your Hub isn't set up to send notifications yet" means the Hub has > no `POSTERN_RELAY_URL`. If the relay reports errors for the phone, its Firebase project > differs from the one in `google-services.json`. Notifications use the channel **New mail** (high importance, private on the lock screen). > [!NOTE] > Android notifications have no **Archive** and **Mark as Read** buttons. The relay sends a > notification message that Android shows by itself while the app is in the background, and > such notifications can't carry the app's buttons. > [!NOTE] > Expo Go on Android can't receive notifications. Use a build made with `expo run:android`. ## Without Google services (UnifiedPush) The Hub can push straight to a [UnifiedPush](https://unifiedpush.org/) endpoint, for example an ntfy server, without the relay and without Google. The Android app does not register such an endpoint yet: that needs a native UnifiedPush module, which the app doesn't have. Until then, a phone without Google services gets no notifications while the app is closed. It catches up when you open the app. ## Unencrypted (HTTP) Hubs Two rules apply, the app's and Android's. **The app** connects over plain HTTP without asking only when the Hub is on the phone or the local network: `localhost`, private addresses (10.x, 172.16 to 31.x, 192.168.x, 100.64 to 127.x), names ending in `.local`, `.lan`, `.home.arpa` or `.internal`, and single-word names. Any other HTTP address shows **This Hub isn't encrypted** first, and a pairing code always shows which Hub it connects to before anything is sent. **Android** (release builds) allows plain HTTP only to the names and addresses in the app's network security config, which `apps/mobile/plugins/withLocalCleartextOnly.js` writes: | Allowed over HTTP | | |---|---| | Names | `localhost`, and anything ending in `.local`, `.lan`, `.home.arpa` or `.internal` | | Addresses | `127.0.0.1`, and the emulator's host addresses `10.0.2.2` and `10.0.3.2` | Android can't allow IP address ranges, so a Hub reached over HTTP by a LAN IP address, such as `http://192.168.1.20:8080`, or by a single-word name, is blocked in release builds. Give the Hub HTTPS (see [HTTPS](https://docs.posternmail.app/reach/https/)), or reach it by a name such as `hub.lan` or `hub.local`. Debug builds allow plain HTTP everywhere. ## App Lock **Settings → This phone → App Lock** asks for your fingerprint, face or the screen lock (PIN, pattern or password) when you open Postern. It behaves as on iOS: see [App Lock](https://docs.posternmail.app/apps/ios/#app-lock). ## Lost your phone Sign it out from **Settings → Devices** on another device. See [Lost or stolen device](https://docs.posternmail.app/apps/pairing/#lost-or-stolen-device). --- # Pairing a device > Signing in a new device with a QR code or a short code, approving it on a device that is already signed in, signing in through the browser, revoking devices and what to do when one is lost. Source: https://docs.posternmail.app/apps/pairing/ This page explains the two ways to sign in a new device, what you approve and why, the limits that protect your account, and how to sign a device out again. | Way | For | You need | |---|---|---| | **Pairing**: scan a QR code or type a short code | Phones, and browsers on another computer | A device that is already signed in, next to you | | **Sign in with your Hub address** through the browser | Phones and the desktop app | Your Hub's address and your password, passkey or single sign-on | Pairing is the fastest way to add a phone. Nothing is signed in until you approve the request on the device that showed the code. ## Show a pairing code On a device that is already signed in: | Where | How | |---|---| | Web app or desktop app | **Settings → Devices → Connect a device**. Also in the command palette (`⌘K` or `Ctrl+K`) as **Connect a device…**. | | iOS or Android app | **Settings → Devices → Connect a device** | The **Connect a device** dialog shows: - a **QR code** for the phone app to scan; - the **Code**, for example `K7QF-2M9X`, and how long it still works ("Works for another 4:59"); - **Copy link**, a link such as `https://mail.example.com/pair#K7QF-2M9X` that signs in a browser on another computer; - **New code**, which makes a fresh one; - **No app yet?**, links to the download page. | Property | Value | |---|---| | Valid for | 5 minutes from when it is shown | | Use | Once. After a device has used it, it is gone. | | Format | 8 characters, shown as two groups of four with a dash. Letters and digits without `0`, `1`, `I` and `O`, so they can't be confused. Upper or lower case and the dash don't matter when you type it. | | QR code content | `postern://pair?hub=&code=`, plus the Cloudflare Access token if your Hub has one (see [below](https://docs.posternmail.app/apps/pairing/#hubs-behind-cloudflare-access)) | The Hub's address in the QR code and the link is `POSTERN_PUBLIC_URL` when it is set, and otherwise the address the signed-in browser used. If phones reach your Hub by another address than your computer does, set `POSTERN_PUBLIC_URL`. See [Configuration](https://docs.posternmail.app/configuration/). **Connect a device** is greyed out while your Hub can't be reached: "Connecting a device needs your Hub, which can't be reached right now". ## Connect a phone with the QR code 1. On the phone, open Postern and tap **Scan QR code**. Allow the camera when asked. (The phone's camera app can also scan it; it opens Postern.) 2. The phone asks **Connect to this Hub?** and shows the Hub's address. Continue only if it is your Hub. For a plain HTTP address it adds "Not encrypted (HTTP)". Tap **Continue**. 3. The phone shows **Approve on your other device** with the code. 4. The signed-in device shows a request. Check that the name and the code match the phone in your hand, then approve it (see [Approve the request](https://docs.posternmail.app/apps/pairing/#approve-the-request)). 5. The phone says **Approved**, then "Setting up your mailboxes… The first time can take up to half a minute." > **Check:** the phone shows your inbox, and **Settings → Devices** on the other device lists > the phone. > **If it did not work:** see [Messages](https://docs.posternmail.app/apps/pairing/#messages) below. A QR code from somewhere else gives > "That QR code isn't from Postern." ### Type the code instead No camera, or the camera can't read it: tap **Scan QR code**, then **Enter the code instead**. Enter your Hub's address and the code shown next to the QR code, then **Continue**. You can also paste the whole link from **Copy link** into **Hub address**. ## Sign in a browser with a code To sign in the web app on another computer: - Open the link from **Copy link** in that computer's browser. The page uses the code by itself. - Or open your Hub's sign-in page, click **Sign in with a code from another device**, enter the code and click **Continue**. The page then says **Approve on your other device** and "Waiting for approval…". After you approve, the browser is signed in. **Use a different code** starts over. ## Approve the request Every signed-in device that is open gets the request. **Web app and desktop app:** a dialog **Sign in on** *device name*? shows the device's name, its kind (iOS, Android, Desktop app, Web browser) and the code with "Same code on the device?". **Deny** comes first and has the focus, so a stray key press never approves a device. Click **Approve**. When you approve a phone or the desktop app from a browser, the Hub wants proof that it is really you, because that device will receive your mailbox sign-ins: - If your account has a password, the dialog asks for **Your Hub password, to confirm it's you**, unless you signed in on this browser within the last 10 minutes. - If your account has no password (passkey or single sign-on only), sign out of the web app, sign in again and approve within 10 minutes. The Hub says: "For your security, please confirm it's you: sign out, sign in again and retry within 10 minutes." **iOS and Android app:** an alert **Connect a new device?** says which device wants to connect. Tap **Approve** or **Don't allow**. With App Lock on, the alert waits until you unlock the app. The request must be answered within 5 minutes. **Deny** ends it, and the new device says "The request was declined on your other device." ## Sign in with your Hub address Phones (**Enter Hub address**) and the desktop app sign in through your Hub's own pages: 1. The app opens your Hub's sign-in page: in a secure browser sheet on iOS, a Custom Tab on Android, and a sign-in window in the desktop app. 2. Sign in with any method your Hub offers: passkey, password and two-step code, or single sign-on. 3. The page asks **Sign in on** *device*? and shows the device. Click **Allow and open the app**. If your last sign-in on that browser was more than 10 minutes ago, it asks for **Your password** first, or, for accounts without a password, to **Sign in again**. 4. The browser hands a one-time code back to the app, which exchanges it for its own session. The code is valid for 2 minutes and protected with PKCE, so only the app that started the sign-in can use it. The app never sees your password. **Cancel** on that page returns to the app without signing in ("The sign-in was canceled. Try again when you're ready."). ## Hubs behind Cloudflare Access If Cloudflare Access protects your Hub, the apps need its service token on every request. Set the token on the Hub (`POSTERN_ACCESS_CLIENT_ID` and `POSTERN_ACCESS_CLIENT_SECRET`). The Hub then hands it to apps that have already passed Access and signed in: - in the pairing QR code and link (shown only to a signed-in user); - in the browser sign-in's hand-back to the app; - in the sign-in result. A phone that scans the QR code from the web app needs no extra step. A phone that signs in with **Enter Hub address** first confirms your email address with Cloudflare in the browser sheet. The token is a second lock in front of the Hub, never a replacement for signing in. Treat a pairing QR code like a key while it is valid. See [Cloudflare](https://docs.posternmail.app/reach/cloudflare/). ## Messages | Message | Where | Meaning | |---|---|---| | This pairing code is invalid or has expired | New device | The code was mistyped, used before, or is older than 5 minutes. Get a **New code**. | | This code is incomplete. Scan the QR code again. | Phone | The scanned link has no Hub address or code. | | The request ran out of time before it was approved. Try again. | Phone | Nobody approved within 5 minutes. | | That code has expired | Browser | Same, for a browser. | | The request was declined on your other device. / The sign-in was denied | New device | Someone chose **Deny** or **Don't allow**. | | This code has expired / This code has run out. | Device showing the code | 5 minutes passed. Click **New code**. | | Too many attempts. Please wait a moment and try again. | Anywhere | A rate limit (below). Wait, then try again. | | That password isn't right. | Approving in the web app | The confirmation password was wrong. | | Sign in on this device with your password, passkey or single sign-on to use your mailbox credentials here. | New device | It was approved by a session that may not hand out mailbox sign-ins. Sign it in with **Enter Hub address** instead. | ## Rate limits The Hub limits these requests per client IP address or per account. The limits are built in and can't be changed. Each starts with a burst, then allows one more try per interval. | What | Per | Burst | Then one more every | |---|---|---|---| | Using a pairing code (scan or type) | IP address | 10 | 30 seconds | | Exchanging the browser sign-in for an app session | IP address | 30 | 5 seconds | | Sign-in attempts | IP address | 20 | 15 seconds | | Wrong passwords or codes, including when you confirm an approval | Account | 5 | 1 minute | A limited request gets HTTP 429 with a `Retry-After` header and the message "Too many attempts. Please wait a moment and try again." Showing a code and waiting for the approval (the new device asks every 2 seconds) are not limited. Behind a reverse proxy, the Hub only sees each client's own address when it trusts the proxy (`POSTERN_TRUST_PROXY`). Otherwise every client shares the proxy's address, and so shares these limits. See [Configuration](https://docs.posternmail.app/configuration/). ## Sign a device out **Settings → Devices** lists every device signed in to your account, this one first, then by when they were last seen: its name, platform, "active now" or when it was last seen, its last IP address and whether notifications are on. The device you are using is marked **This device**. - **Rename** gives a device a clearer name (up to 80 characters). - **Sign out…** asks "Sign out *name*?" ("Its session ends now, and the mail saved on it is removed the next time it connects."). **Sign out device** confirms. What happens: 1. The Hub ends the device's sessions at once, deletes its push registration and closes its live connection. It can no longer reach your account, settings or mailbox sign-ins through the Hub. 2. The next time the device reaches the Hub, it deletes the mail and the mailbox sign-ins it kept. The desktop app then says "You were signed out of …"; the web app says "This device was signed out from another device, and the mail saved on it was removed." 3. The Hub's **Settings → Security** log records "Device signed out". Pairing and sign-ins show up there too, as "Device connected" and "Mailbox sign-ins sent to one of your devices". ## Lost or stolen device 1. On any other device, open **Settings → Devices** and **Sign out…** the lost one. 2. Check **Settings → Security** for sign-ins you don't recognise. 3. A device in direct mode holds your mailbox sign-ins. Until it reaches your Hub again, it keeps its copy of your mail and can still reach your providers. If it may stay offline or you think someone else has it, also change those sign-ins at the provider: change the password or app password of IMAP mailboxes, and remove Postern's access in your Google or Microsoft account security settings. Then reconnect the mailboxes in Postern (**Settings → Mailboxes**). App Lock on the phone (see [iOS](https://docs.posternmail.app/apps/ios/#app-lock)) keeps the app closed to anyone without your face, fingerprint or passcode in the meantime. --- # Working offline > What keeps working when your Hub is down or the device is offline, what needs the Hub, how changes made offline sync back, and how conflicts are resolved. Source: https://docs.posternmail.app/apps/offline/ The desktop and mobile apps are complete mail clients on their own. This page lists what works while your Hub can't be reached, what doesn't, and what happens to your changes when the Hub is back. It also covers the web app, which depends on the Hub. Everything here applies to apps in direct mode, which is the default for the desktop and mobile apps (see [Apps](https://docs.posternmail.app/apps/#direct-mode-and-through-your-hub)). The device needs the Hub once, for its first sign-in: "The first start on this computer needs your Hub." ## What works without the Hub | Works on a device in direct mode | Needs the Hub | |---|---| | Reading and searching your mail | Signing in a **new** device, and pairing | | Receiving new mail (the device connects to your providers itself) | The web app | | All mail actions: archive, delete, move, tag, star, mark as read, spam | Notifications on a phone while its app is closed or paused | | Sending, including undo send and send later | Connecting or reconnecting a **Google** mailbox (Google's sign-in returns to the Hub) | | Drafts, templates, signatures, tags, rules and settings: changing them | Your account, devices, the security log, invites and the admin area | | Snooze, pin, mute and follow-up | Rule steps that send, delete permanently or call out (see [Rules](https://docs.posternmail.app/apps/offline/#rules)) | | Adding or reconnecting password (IMAP), JMAP and Microsoft mailboxes | Mail on your other devices: they see your changes only after the Hub is back | | Refreshing the sign-ins of Google and Microsoft mailboxes | | Screens that need the Hub say so, for example "Connecting Google needs your Hub, which can't be reached right now" or "The list of your devices is kept on your Hub". ## What you see **Desktop app.** The sidebar and the top of **Settings** say **Hub offline**, with the number of changes waiting ("Hub offline · 3 changes waiting"). The tooltip explains that mail keeps working and that changes sync when the Hub is back. While the waiting changes are being sent, it says **Syncing…**. **iOS and Android.** A strip at the top says the Hub can't be reached and that mail still works and changes sync later. **Settings → About** shows **Your Hub: Can't be reached · 3 changes waiting**, and **Last in step with your Hub**. **No network at all.** The apps say **You're offline** and show the mail they have. Mail actions and sends wait in the device's outbox until the network is back. ## Changes made while the Hub is away When the Hub doesn't answer, the device does not wait for it: 1. It applies your change at once, on the device, so you see it right away. 2. It stores the change in a queue on the device, in the order you made it. 3. It checks for the Hub every 15 seconds, and reconnects as soon as it answers. 4. It sends the queued changes in their original order. The Hub's answer then becomes the final state on every device. If you quit the app, the queue stays on disk and is sent at the next start. ### Conflicts | Situation | What happens | |---|---| | You changed something on two devices | The change that reaches the Hub last wins. Settings are merged per setting, so changing two different settings on two devices keeps both. | | You edited the same draft on two devices | Both versions are kept: the device's version becomes a new draft titled "(conflict) …" next to the other one. | | The Hub rejects a queued change (for example, the item was deleted elsewhere) | The change is dropped and the Hub's version comes back. The device shows a notification "A change couldn't be saved: …". | | The Hub fails with a server error | The change is tried again later. After 5 failed tries it is dropped, so it can't block the changes behind it. | | The Hub can't be reached | The queue waits, in order, and is sent when the Hub is back. | Per-message state (snooze, pin, mute, follow-up, screened) is stored per message, keyed by the message's Message-ID, so the same message has the same state on every device. ## Sending without the Hub - **Send now** (including the undo window): the device sends the message itself, through your provider, and files it in Sent. This needs no Hub, only a connection to your provider. If the provider can't be reached, the message stays in the outbox and is tried again later. - **Send later**, Hub reachable: the device hands the message to the Hub, which sends it on time even when every device is off. - **Send later**, Hub unreachable: the device keeps the message. The outbox shows "Sends from this device · Will be handed to your Hub when it's reachable". When the Hub is back before the send time, the device hands it over. If the send time comes while the Hub is still away and the app is running, the device sends it itself. Only one side owns a scheduled message at a time, and both skip a message whose Message-ID is already in Sent, so it is never sent twice. ## Notifications, snoozes and rules The Hub normally does these for all devices. While it is unreachable, a running app takes over part of the work: | Job | While the Hub is away | |---|---| | New-mail notifications | The app shows its own notification for new inbox mail. When the Hub is reachable, only the Hub notifies, so you never get two. | | Snooze and follow-up reminders | The app brings snoozed mail back and shows follow-up reminders itself. It checks every 15 seconds. | | Rules | See below. | This happens only while the app runs. A phone app paused by iOS or Android, or a closed desktop app, does none of it. ### Rules The Hub runs your [rules](https://docs.posternmail.app/rules/). While the Hub has been unreachable for more than 2 minutes, a running device runs them itself for new mail that arrives, using the copy of your rules it got from the Hub. It runs only steps that are safe to repeat: moving, archiving, tagging, marking and similar. It skips every step that sends, deletes for good or calls out: redirect, forward, reply, capture, copy, webhook, message notifications and permanent delete. Those run only on the Hub. Rules run on a device are not recorded in **Rule activity**. ## When the Hub is back - Queued changes go to the Hub in order (**Syncing…**). - Scheduled sends kept by the device are handed over. - Changes from your other devices arrive. - Notifications and rules go back to the Hub. You don't need to do anything. If the desktop app shows the Hub as offline for a long time, check that the Hub runs and that the computer can reach it (VPN, Tailscale). See [Troubleshooting](https://docs.posternmail.app/troubleshooting/). ## Mailbox sign-ins while offline The device keeps its own encrypted copy of your mailbox sign-ins and refreshes Google and Microsoft access tokens by itself. If you reconnect a password, JMAP or Microsoft mailbox while the Hub is away (a new app password, for example), the device checks the new sign-in with the provider, uses it at once, and passes it to the Hub when it is back. The Hub keeps the newest sign-in and hands it to your other devices. ## The web app when the Hub is down The web app gets everything from the Hub, so it can do much less without it: - It starts from the browser's cache when the page is installed or was opened before (HTTPS only). - It shows the conversations and messages it already loaded in this browser. Others say "You're offline and nothing from this list is saved on this device yet." - Mail actions such as archive or mark as read are queued and sent when the Hub is back. A strip says **Can't reach your Hub. Changes are sent when it's back.** - New mail, search across all mail and other Hub requests fail until the Hub answers. - If nothing is saved in the browser yet, the page says **Can't reach your Hub.**, counts down to the next try and offers **Try again now**. ## Apps through your Hub when the Hub is down **Desktop app with Don't keep mail on this computer:** the window shows an offline page and retries after 5, 10 and 20 seconds, then every 30 seconds. See [Desktop app](https://docs.posternmail.app/apps/desktop/#starting-restarting-and-being-offline). **iOS and Android without the engine:** the app shows the mail it saved on the phone ("Showing saved mail. Changes are sent when it's back.") and queues your changes. --- # Updates > How Postern's apps and the Hub update themselves, where updates come from, how they are checked, and how to turn automatic updates off. Source: https://docs.posternmail.app/updates/ Postern's apps and the Hub update themselves. A new version downloads quietly in the background and installs when the app restarts, or, for the Hub, at a quiet moment. You don't have to watch for releases. ## Where updates come from Every update comes from Postern's download server, `https://updates.posternmail.app`. Every package there is **signed** with Postern's key, and each app and the Hub has the matching public key built in. Before an app or a Hub downloads anything, it checks the signature. After the download, it checks the file's size and checksum. A package that isn't signed with Postern's key is never installed, even if someone took over the download server. The same server has the downloads for a first install: open it in a browser for a list of the current version's files. ## When apps look for updates - When the app starts, then every 30 minutes. - Whenever you choose **Check for Updates…**: the app menu on a Mac, **Settings** on Windows, and **Help** or **Desktop App Options** on Linux. To stop the automatic checks, turn off **Check for updates automatically** in the app's settings. **Check for Updates…** keeps working. **Beta versions:** if you want new versions before everyone else, turn on **Get beta versions** (Linux and Windows: settings; Mac: Settings › Updates). Betas can have more bugs. ## Each app | App | How it updates | |---|---| | **Mac**, downloaded from the website | Downloads the update in the background, checks it, and swaps it in when you quit Postern or choose **Restart**. Postern needs to be in your Applications folder to replace itself. Otherwise it offers the new disk image instead. | | **Mac**, from the App Store | The App Store updates it. | | **Windows** | Downloads the new installer in the background, checks it, and runs it silently when you quit Postern or choose **Restart**. No administrator rights are needed. | | **Linux, AppImage** | Downloads the new AppImage in the background, checks it, and puts it in place of the old file. The new version starts with **Restart to Update**, or the next time you open Postern. | | **Linux, `.deb`** | Downloads the new package in the background and checks it. **Restart to Update** installs it: your system asks for your password, then Postern starts again. | | **iPhone, iPad, Apple Watch** | The App Store updates them. | A Linux copy installed some other way, or built from source, doesn't update itself. **Check for Updates…** still tells you when there is a newer version, and links to the download. ## The Hub | How you installed it | How it updates | |---|---| | **With the installer** (`curl -fsSL https://updates.posternmail.app/install \| sudo sh`) | With **Update automatically** on (the default; **Settings › Admin**), the Hub looks for a new version every 10 minutes. When it finds one, it downloads and checks it, then waits until it is quiet: no mail is being sent, no change is being written to your mail provider and no backup is running. Then it installs the update and restarts. If the new version doesn't start properly, it goes back to the old one. | | **Docker**, with the `updater` service from Postern's compose file | The same, with the new image: the updater pulls it and recreates the Hub. | | **Docker**, without the updater | Run `docker compose pull && docker compose up -d` yourself. | **Settings › Admin** always shows the newest version, even with automatic updates off. The apps also tell you when your Hub is older than they need. For details about upgrading by hand, going back and version compatibility, see [Upgrades](https://docs.posternmail.app/admin/upgrades/). ## What a check sends A check asks the download server for a small file that lists the newest version. The request contains no account, no address book, nothing about your mail and no device ID: only what every web request carries (the network address and the program's name). --- # Inbox and conversations > The unified inbox and folders, Spaces, the split inbox, conversations, Smart From, everyday actions, bulk actions, one-click unsubscribe and how remote images load. Source: https://docs.posternmail.app/using/inbox/ This page explains what you see in the mail screen of the web app and what each action does at your mail provider. The desktop and phone apps show the same screens and follow the same rules. ![The unified inbox in the web app, with a message open beside the list](https://posternmail.app/img/inbox-light.webp) ## The unified inbox **Inbox** shows the inbox of every connected mailbox in one list, newest first. A conversation from a Gmail account and one from an IMAP server sit side by side. Nothing is copied between mailboxes: each message stays in the mailbox it arrived in, and actions are carried out in that mailbox. The Inbox leaves out conversations that are: - **snoozed** (they come back at the snooze time, see [Snooze, send later and follow-ups](https://docs.posternmail.app/using/later/)), - **held in the Screener** (see [Screener](https://docs.posternmail.app/using/screener/)), - **muted** (muting also archives them, see [Mute](https://docs.posternmail.app/using/inbox/#pin-mute-and-vip)). **Pinned** conversations come first, under the heading **Pinned**; the rest follows under **Everything else**. When you have two or more mailboxes, a bar above the Inbox list (**Unread by mailbox**) shows how your unread mail is spread across them, one coloured band per mailbox with its unread count. Click a band or its name to show only that mailbox. The list then shows a chip **Only you@example.com**; click the chip (or the band again) to **Show all mailboxes**. Clicking a mailbox's address in the sidebar opens that mailbox's Inbox alone. The arrow next to it shows or hides its folders. ## Unified folders The top of the sidebar lists views that combine all mailboxes: | Entry | What it shows | |---|---| | **Inbox** | The inbox of every mailbox (see above). | | **Starred** | Starred conversations (flagged at the provider), from any folder except Trash and Spam. | | **Snoozed** | Conversations you snoozed, with the time they come back. | | **Follow-ups** | Conversations with a follow-up reminder. | | **Screener** | Mail from first-time senders waiting for your decision. Only shown while the Screener is on. | | **Drafts** | Your Postern drafts, with a count. Drafts are kept on your Hub and follow you to every device. | | **Scheduled** | Messages waiting to be sent later, and messages that could not be sent. Only shown when there is one. | | **Sent** | Sent mail of every mailbox. | | **All mail** | Everything except Trash and Spam. | | **Archive** | Archived conversations (out of the Inbox). | | **Spam** | Spam or junk of every mailbox. | | **Trash** | Deleted mail of every mailbox. | A number next to an entry counts **unread conversations** (bold). Drafts and Scheduled count items instead. A red number next to Scheduled means messages that were not sent. Below these come: - **Favorites**: folders you marked as favourites, each with a dot in its mailbox's colour. - **Mailboxes**: every mailbox with its folders. A warning sign means it needs attention: an icon you can click opens **Settings → Mailboxes** (for example to **Reconnect** a mailbox that needs you to sign in again), and a progress ring shows a mailbox that is still downloading. - **Tags**: your tags, each with its unread count (see [Tags](https://docs.posternmail.app/using/tags/)). The line at the bottom of the sidebar says whether mail is **Up to date**, still downloading (**Downloading mail, 40% done**), or whether a mailbox **needs you to sign in again**. ## Spaces A **Space** is a group of mailboxes with its own unified inbox, folders, counts and search, for example "Work" with two company mailboxes and "Personal" with the rest. A mailbox can be in several Spaces. **Create a Space:** open **Settings → Spaces** and click **New space**. Give it a **Name** (up to 60 characters), pick a **Color**, tick the **Mailboxes** that belong to it and click **Save**. **Edit or delete:** in **Settings → Spaces**, click **Edit** next to a Space, or the bin icon to delete it. Deleting a Space removes only the grouping; its mailboxes and their mail stay. **Switch:** the Space switcher at the top of the sidebar shows the current Space (or **All mailboxes**). Open it and pick a Space, **All mailboxes**, or **Edit spaces…**. The command palette has the same choices (**Switch to Work**, **Show all mailboxes**). While a Space is chosen, every list, count and search covers only its mailboxes, and the search box says **Search Work**. If you were looking at a folder of a mailbox that is not in the new Space, Postern goes to the Space's Inbox. The chosen Space is remembered per browser or app, not synced: your phone can show "Personal" while your laptop shows "Work". > [!NOTE] > Spaces sync across your devices. Which Space is selected does not. ## Split inbox The split inbox shows your Inbox with section buttons above the list (**Inbox sections**): **Everything** and one button per section, each with its unread count. A section filters the list; it does not move mail. Turn it on in **Settings → Reading & sending → Split inbox**, or in **Settings → Split inbox**, where you also choose the sections. There are three built-in sections, sorted automatically by the Hub when mail arrives: | Section | What goes there | |---|---| | **People** | Everything that is not one of the two below. | | **Notifications** | Automatic mail: `Auto-Submitted` messages, senders such as `notifications@` or `alerts@`, no-reply senders with transactional subjects, verification codes, password resets, shipping notices. | | **Newsletters** | Mailing lists and bulk mail (list and bulk-sender headers). | You can turn each built-in section off. You can also add your own: type a **Tab name** and a query written like a search (for example `from:@client.com`), then click **Add tab**. Every [search operator](https://docs.posternmail.app/using/search/#operators) works. A custom section can be renamed, changed, turned off or deleted; deleting it only removes the button, its mail stays in your Inbox. ## Mailbox colours and the spine Every mailbox has a colour, set in **Settings → Mailboxes → Color**. The colour appears: - as the **spine**, a thin vertical bar at the left edge of each conversation in a list, with one segment per mailbox the conversation lives in (a conversation between two of your own mailboxes shows two segments). It is strong for unread conversations and faded for read ones; - as a dot next to folders, in the **From** menu of the composer, and in the **Unread by mailbox** bar. ## Conversations Postern groups messages into conversations. A message joins a conversation when the provider says so (a Gmail thread, an Outlook conversation, a JMAP thread) or when its `Message-ID`, `In-Reply-To` or `References` headers point to a message already in it. The header rule works across mailboxes, so a conversation can contain messages from more than one of your mailboxes. Copies of the same message in several folders are shown once. A conversation row shows the sender (and how many messages it holds), the subject, the first words, up to two tags and small icons: crown for a VIP sender, pin, muted, follow-up set, attachment, star. Snoozed conversations show the time they come back instead of the date. ![A three-message conversation](https://posternmail.app/img/thread.webp) Open a conversation to read it. By default only the newest and unread messages open in full; read ones are folded to one line. Click a folded message to open it. Turn this off with **Settings → Appearance → Fold messages you've read**. Quoted text is hidden behind **Show quoted text**. Each message has its own menu: **Reply**, **Reply all**, **Forward**, **Mark as unread** (or **Mark as unread from here** for an earlier message), **Copy sender address**, **Mark sender as VIP**, **View source**, **Print conversation**, **Move this message to Trash** and **Block** the sender. The arrows **Newer** and **Older** in the toolbar move through the list; the position is shown as **3 of 50**. Calendar invitations show a card with **Going**, **Maybe** and **Can't go**. When a message is opened depends on **Settings → Reading & sending → Mark as read**: **When opened** (default), **After 2 seconds**, or **Only when I say so**. ## Smart From When you reply, Postern picks the address to reply from by itself. In this order it takes: 1. the address the original message was sent to (in To, Cc or Bcc, or in delivery headers such as `Delivered-To`), matching exactly, then with plus-addressing (`you+shop@example.com` matches `you@example.com`), then a catch-all domain of one of your addresses; when you reply to your own message, the address you sent it from; 2. the address you last used to write to these recipients, then to their company domain (public services such as gmail.com do not count); 3. the default address of the mailbox the message is in; 4. your first address. For a new message, steps 2 to 4 apply. If you pick an address yourself and you usually write to that domain from another one, the composer warns **You usually write to example.com from you@example.com.** with a **Switch** button. More in [Compose](https://docs.posternmail.app/using/compose/#identities-and-the-from-address). ## Actions These actions work on one conversation (the open one, or the one under the keyboard cursor) or on every selected conversation. Each is sent to the mailbox the messages live in. | Action | Where | What happens at the provider | |---|---|---| | **Archive** | toolbar, row (hover), `E` | Leaves the Inbox. Gmail removes the Inbox label; IMAP moves the messages to the Archive folder (created if the server has none); Microsoft and JMAP move them to the archive folder. | | **Move to Trash** | toolbar, row, `#` | Moves to the mailbox's Trash. | | **Delete forever** | toolbar in Trash and Spam | Deletes at the provider after you confirm. **They are removed from your mail provider too. This can't be undone.** | | **Move to Inbox** | toolbar in Trash and Spam | Moves back to the Inbox. | | **Report spam** / **Not spam** | **More actions**, `!` | Moves to Spam or back to the Inbox. | | **Mark as read** / **Mark as unread** | row, **More actions**, `Shift+I`, `Shift+U` | Sets or clears the read flag. | | **Star** / **Remove star** | toolbar, row, `S` | Sets or clears the flag (Gmail: Starred). | | **Move to folder** | toolbar, `V` | Opens a folder picker; type to filter. Moves within the same mailbox. | | **Tag** | toolbar, `L` | Opens the tag picker; see [Tags](https://docs.posternmail.app/using/tags/). | | **Snooze** | toolbar, row, `H` | See [Snooze](https://docs.posternmail.app/using/later/#snooze). | After you archive or delete the open conversation, Postern opens the next (older) one. Change this in **Settings → Reading & sending → After archiving or deleting**: **Open the next (older) conversation**, **Open the previous (newer) conversation**, or **Go back to the list**. Most actions show a short notice with **Undo**. You can also press `Z` (or `⌘Z` / `Ctrl+Z`) to undo the last action, up to 60 seconds after it, and up to 20 steps back. ### Pin, mute and VIP These are Postern features. They are kept on your Hub and synced to your devices, not stored at the provider, so other mail programs do not see them. - **Pin to the top of the Inbox** (`P`): the conversation stays above the rest of the Inbox. - **Mute conversation** (`M`): archives the conversation, and new replies skip your Inbox and do not notify you. **Unmute** to stop. - **Mark sender as VIP**: a crown marks their mail, **Notify me about → VIPs only** still notifies you about them, and VIPs pass quiet hours and the Screener. - **Block**: future mail from that address goes to Spam, and it does not notify you. Unblock in **Settings → Senders**. ## Selecting several conversations | How | Result | |---|---| | Click the checkbox at the left of a row (it appears on hover), or press `X` | Selects that conversation. | | Shift-click a checkbox | Selects the range from the last one you clicked. | | The checkbox above the list, or `⌘A` / `Ctrl+A` | Selects every loaded conversation. | | **Select all 50 loaded** in the selection bar | Selects every conversation loaded so far (**Select all 120** once the whole list is loaded). | | **Clear selection** or `Esc` | Clears it. | The selection bar offers **Archive** (or **Move to Inbox** in Trash and Spam), **Move to Trash** (or **Delete forever**), **Mark as read** / **Mark as unread**, **Snooze**, and under **More actions**: **Star**, **Move to folder…**, **Tag…** and **Report spam** (or **Not spam**). Keyboard shortcuts act on the whole selection. ## One-click unsubscribe When a message carries a `List-Unsubscribe` header, the conversation header shows an **Unsubscribe** button. It asks **Unsubscribe from Sender?** (**The sender is asked to stop. Mail you already have stays where it is.**) and offers **Unsubscribe and archive**, which archives the conversation and then: | What the sender offers | What Postern does | What you see | |---|---|---| | One-click unsubscribe (RFC 8058) over HTTPS | The Hub sends the unsubscribe request itself. | **Unsubscribed. You shouldn't get more mail from this list.** | | Only a web link | Opens the sender's page in a new tab. | **The sender's unsubscribe page is open in a new tab. Finish there.** | | Only an email address | Nothing is sent for you yet. | The same "Unsubscribed" notice. | > [!WARNING] > For lists that offer only an email address for unsubscribing, Postern does not send that email > yet, even though it says **Unsubscribed**. If mail keeps arriving, unsubscribe on the sender's > website or block the sender. The Hub only contacts public internet addresses for this. If the one-click request fails and the list offers nothing else, you see **Couldn't unsubscribe.** with the reason. ## Remote images Pictures loaded from the internet can tell a sender when you opened a message. Postern removes known tracking pixels from every message and decides per message whether the remaining remote images load. Choose the rule in **Settings → Reading & sending → Pictures in messages**: | Choice | Images load by themselves | |---|---| | **Ask every time** | Never. | | **Load from people I know** (default) | From people you wrote to, senders and domains you allowed, your own mailbox domains, and established senders (see below). | | **Always load** | Always. | Under **Load from people I know**, an established sender is a company domain whose mail your provider verified (DMARC, or a DKIM signature of that domain) and that has sent you at least 3 messages over at least 3 days, fewer than half of them in Spam. Images never load by themselves for mail in Spam, mail with a forged-sender or lookalike-domain warning, or unknown people on public mail services such as gmail.com. Images in mail you sent always load. When images are held back, the message shows **Images are hidden so the sender can't see when you read this.** with these buttons: - **Load images**: only this message, this time. - **Always load images from sender@example.com**: from now on for this sender. - **Always load from example.com**: for every address at that company domain. Not offered for public mail services. Allowed senders and domains are listed in **Settings → Senders** under **Always show images**, where you can take them back. **Where images are fetched from.** Images never load straight from the sender's server into your browser. In the web app they go through your Hub's image proxy: the sender sees your Hub's address, not your device's. The desktop and phone apps run the same proxy inside the app, so there the request comes from the device's own internet connection. The proxy only fetches public addresses, only serves real image files, and limits size and time. More in [Mail rendering](https://docs.posternmail.app/security/mail-rendering/). --- # Search > How search works in Postern, what it covers, every operator with examples, and where the search runs. Source: https://docs.posternmail.app/using/search/ This page explains what a search covers, every operator you can type, and where the search runs. Postern uses one query language for search, for custom split-inbox sections and for rule queries, so everything here applies there too. ![A search limited to one mailbox, with "Search all mail instead"](https://posternmail.app/img/search.webp) ## Start a search Click the search box at the top of the list, or press `/`. Type, then press `Enter`. While you type, Postern suggests contacts, folders, tags and operators. Use the arrow keys to highlight one and `Tab` to complete it; `Enter` searches for exactly what you typed unless you highlighted a suggestion. With an empty box, the list shows your last six **Recent searches** (kept in this browser only). The command palette (`⌘K` / `Ctrl+K`) also offers **Search mail for "…"**. Results are conversations, newest first. The words you searched for are highlighted in the sender, subject and preview. The list loads 50 at a time; the count says **50+ results** while more can be loaded. ## What a search covers | Where you search from | What is searched | |---|---| | Inbox, All mail, or a search | All mail (everything except Trash and Spam). | | Sent, Archive, Trash, Spam, Drafts, Starred, Snoozed | Only that view: Postern puts `in:sent`, `in:archive`, `in:trash`, `in:spam`, `in:drafts`, `is:starred` or `is:snoozed` in front of your words. | | A folder | Only that folder (`in:` with the folder). | | A tag | Only that tag (`tag:`). | | A mailbox's Inbox or a band of **Unread by mailbox** | Only that mailbox. | | Any of these inside a Space | Only the Space's mailboxes. | The search box says what it will search: **Search Sent**, **Search Work** (a Space), or **Search all mail**. The added operator is visible in the query, so you can remove it. If your query already names a place (`in:`, `is:`, `tag:`, `mailbox:` or `space:`), nothing is added. When a search is limited to one place, the results show **Search all mail instead**. It runs the same words without the place (and without the mailbox filter). Inside a Space it still covers only that Space; switch to **All mailboxes** in the sidebar to search everything. Trash and Spam are left out unless the query asks for them with `in:trash` or `in:spam`. ## Words and phrases | You type | Matches | |---|---| | `invoice` | Messages with a word starting with "invoice" (invoice, invoices, invoiced) in the subject, the sender's name or address, the recipients, the text or an attachment name. | | `invoice march` | Messages containing both words, anywhere. | | `"march invoice"` | The exact phrase. Inside quotes, `\"` is a quote and `\\` a backslash. | Words match from their start: `voice` does not find "invoice". Case and accents do not matter (`cafe` finds "Café"). Punctuation separates words. ## Combining terms | Syntax | Meaning | Example | |---|---|---| | space or `AND` | Both must match. | `from:anna invoice` | | `OR` or `\|` | Either may match. Write `OR` in capitals. | `from:anna OR from:ben` | | `-` or `NOT` | Must not match. | `invoice -paid`, `NOT is:read` | | `( )` | Grouping. | `(from:anna OR from:ben) has:attachment` | | `{ }` | Any of these (a short form of OR). | `{from:anna from:ben}` | | `operator:( )` | Applies the operator to every word inside. | `subject:(budget draft)` = `subject:budget subject:draft` | `OR` binds tighter than the space: `a b OR c` means `a AND (b OR c)`, as in Gmail. Search is forgiving: a missing closing bracket or quote is closed for you, and a stray `OR` at the end is ignored. An unknown `word:value` (for example `foo:bar`) is searched as plain text. ## Operators Operator names are not case-sensitive. A value with spaces goes in quotes: `subject:"quarterly report"`. ### People and text | Operator | Matches | Examples | |---|---|---| | `from:` | Sender name or address contains the value. A value starting with `@` matches the end of the address (a domain). | `from:anna`, `from:anna@example.com`, `from:@example.com` | | `to:` | Any recipient (To, Cc or Bcc) contains the value; `@domain` matches recipients at that domain. | `to:ben`, `to:@example.com` | | `cc:` | A Cc recipient. | `cc:carla@example.com` | | `bcc:` | A Bcc recipient (only visible on mail you sent). | `bcc:me@example.com` | | `subject:` | The subject contains the value (anywhere in a word). | `subject:invoice`, `subject:"Q3 report"` | | `filename:` | An attachment name contains the value. | `filename:pdf`, `filename:contract` | | `list:` | The mailing-list ID (`List-Id` header) contains the value; angle brackets are ignored. | `list:news.example.com` | ### State | Operator | Values (aliases in brackets) | |---|---| | `is:` | `unread`, `read`, `starred` (`flagged`), `pinned`, `muted`, `vip`, `snoozed`, `answered` (`replied`), `draft` | | `has:` | `attachment` (`attachments`), `invite` (`invites`, a calendar invitation), `link` (`links`) | | `category:` | `people` (`person`, `primary`), `notifications` (`notification`), `newsletters` (`newsletter`): the [split inbox](https://docs.posternmail.app/using/inbox/#split-inbox) section | Examples: `is:unread has:attachment`, `is:vip -is:read`, `category:newsletters older_than:1m`. An unknown value is an error, for example **Unknown value "big" for is: (try unread, read, starred, pinned, muted, vip or snoozed)**. ### Places | Operator | Values | Examples | |---|---|---| | `in:` | `inbox`, `sent`, `archive` (`archived`), `trash` (`bin`), `spam` (`junk`), `drafts` (`draft`), `all` (everything except Trash and Spam), or a folder by name or path | `in:sent`, `in:"Clients/Acme"`, `in:Receipts` | | `mailbox:` | A mailbox by its address | `mailbox:you@example.com` | | `space:` | A Space by name (not case-sensitive) | `space:Work` | | `tag:` (also `label:`) | A tag by name | `tag:Clients`, `label:"To do"` | A folder name that matches folders in several mailboxes finds all of them. A name that matches nothing finds nothing. ### Dates | Operator | Matches | Examples | |---|---|---| | `after:` (also `newer:`) | Received on or after that day, from midnight. | `after:2026-01-01` | | `before:` (also `older:`) | Received before that day (the day itself is not included). | `before:2026-02-01` | | `newer_than:` | Received within the last period. | `newer_than:7d` | | `older_than:` | Received longer ago than the period. | `older_than:1y` | Dates are written `2026-01-31`, `2026/01/31`, `2026-1-31`, `2026/1/31` or `2026.01.31`. A full timestamp such as `2026-01-31T09:00:00Z` and Unix seconds also work. Days start at midnight in the Hub's time zone (the device's, in the desktop and phone apps). Periods are a number with a unit: `h` hours, `d` days, `w` weeks, `m` months, `y` years. A bare number means days (`newer_than:3` = 3 days). A month of January: `after:2026-01-01 before:2026-02-01`. Errors: **Invalid date "31.01." for after: (use YYYY-MM-DD)**, **Invalid age "soon" for newer_than: (use e.g. 7d, 2w, 3m or 1y)**. ### Size | Operator | Matches | Examples | |---|---|---| | `larger:` | Messages bigger than the size. | `larger:5M`, `larger:500K` | | `smaller:` | Messages smaller than the size. | `smaller:100K` | Sizes are a number (decimals allowed) with an optional `K`, `M` or `G`, counted in steps of 1024; `KB`, `MB`, `MiB` are accepted too. A plain number is bytes. Example: `larger:1.5M`. Error: **Invalid size "huge" for larger: (use e.g. 500K or 5M)**. ## Examples | Query | Finds | |---|---| | `from:@example.com has:attachment newer_than:30d` | Attachments from anyone at example.com in the last 30 days. | | `in:sent to:anna` | Mail you sent to Anna. | | `from:anna -is:answered` | Mail from Anna you have not replied to (the provider's answered flag). | | `subject:(invoice OR receipt) after:2026-01-01 -in:archive` | Invoices or receipts this year that are not archived. | | `larger:10M older_than:1y` | Big old mail, for cleaning up. | | `is:unread category:people space:Work` | Unread personal mail in the Work Space. | | `"order confirmation" in:trash` | A phrase in Trash. | ## Where the search runs Postern never sends your search to the mail provider. It searches the copy of your mail that the app is connected to: | App | Searches | |---|---| | Web app | The Hub's copy of your mail. | | Desktop and phone apps | The app's own copy on the device. This also works when the Hub is unreachable. | The full text index holds the subject, sender, recipients, attachment names and the first 256 KB of each message's text. Until a message's body has been downloaded, only its first line is indexed. The Hub downloads bodies ahead of time for the last 30 days (`POSTERN_BODY_CACHE_DAYS`, see [Configuration](https://docs.posternmail.app/configuration/)); older bodies are downloaded when you open the message, and become searchable then. Searches on sender, subject, dates, size and the other operators cover every message that has synced. > [!NOTE] > The Hub keeps a full copy of your mail only while you use the web app (and for 7 days after), > unless you turn on **Settings → Reading & sending → Keep a full copy of my mail on my Hub**. > When you come back to the web app after a long break, the Hub catches up first, and search > results fill in as it does. ## Limits - No fuzzy matching and no word endings in the middle of words: `voice` does not find "invoice" (except with `subject:`, `from:`, `to:` and `filename:`, which match anywhere). - Only the first 256 KB of a message's text is searched. - Mail that has not synced yet (a mailbox still downloading) is not found. - Searches are not saved on your Hub; recent searches stay in the browser or app. --- # Compose, reply and forward > Writing, replying and forwarding in Postern, choosing the From address, signatures, attachments and their size limit, drafts on every device, formatting and address suggestions. Source: https://docs.posternmail.app/using/compose/ This page covers writing mail: the composer, replies and forwards, which address a message goes out from, signatures, attachments, drafts and formatting. Sending later, undo send, templates and follow-up reminders have their own page: [Snooze, send later and follow-ups](https://docs.posternmail.app/using/later/). ## Write a new message Click **New message** at the top of the sidebar, or press `C`. The composer opens in the corner of the window. Its title bar has: | Button | What it does | |---|---| | **Minimize** | Folds the window to a bar at the bottom. The draft is saved first. | | **Full screen** / **Exit full screen** | Covers the app with the composer. | | **Close and keep as draft** (`Esc`) | Closes the window. The message stays in **Drafts**. | You can have several composer windows open; each is its own draft. The fields are **From**, **To**, **Subject** and the message. **Cc/Bcc** next to From shows the **Cc** and **Bcc** fields. Send with **Send** or `⌘Enter` (macOS) / `Ctrl+Enter`. In **Settings → Reading & sending → Send with** you can choose `Enter` instead; then `Shift+Enter` starts a new line. Before sending, Postern checks two things and asks before it goes on: - **Forgot an attachment?** **Your message mentions an attachment, but nothing is attached.** - **Send without a subject?** **Messages without a subject are easy to miss.** Choose **Send anyway** or go back to the message. A message without any recipient is not sent: **Add at least one recipient.** An entry that is not an address is marked in the field (**Not an email address**) and stops the send: **"anna@" is not an email address. Fix or remove it.** After **Send**, the message waits for the undo time before it goes out (10 seconds by default), and the notice says **Sending…** with **Undo**. See [Undo send](https://docs.posternmail.app/using/later/#undo-send). ## Reply and forward In an open conversation: | Action | Button | Key | |---|---|---| | Reply to the sender | **Reply** | `R` | | Reply to everyone | **Reply all** | `A` | | Forward | **Forward** | `F` | The box under the conversation (**Reply…** or **Reply all…**) starts a quick reply right there. Which one it starts is set in **Settings → Reading & sending → Default reply**. A reply has no subject field unless you open it full size; the subject becomes "Re: …". If you already have a draft for that conversation, Postern opens it (**Continue your draft…**) instead of a new one. A reply quotes the message you answer. Quoted text is folded behind **Show quoted text**; you can open it to edit it (**Edit quoted text**). If the original cannot be loaded you see **The message you are answering could not be loaded. Your reply can still go out, without the quoted text.** A forward includes the original message, and its attachments: **The original attachments will be included.** Click **Leave them out** to forward the text only. Each original attachment can be up to 50 MB; a bigger one stops the send with **The attachment "…" is too large to forward.** To answer one earlier message of a conversation, use that message's own menu: **Reply**, **Reply all** or **Forward**. ## Identities and the From address An **identity** is an address you send from, with its own name, reply-to address and signature. Every mailbox has at least one identity, its own address. Add more in **Settings → Identities & signatures** with **Add an address** (for example an alias such as `info@example.com`). Your mail provider must accept mail sent from that address through this mailbox; if it does not, the send fails with the provider's error. For each identity you can set: | Setting | What it does | |---|---| | **Name** | The name people see next to the address. | | **Reply-to** | Optional. Replies to your messages go to this address instead. | | **Signature** | Added below new messages and replies from this address. | | **Make default** | The address used for the mailbox when nothing else decides. | The mailbox's own sender name is set in **Settings → Mailboxes → Sender name**. The **From** menu in the composer lists every identity, grouped by mailbox, with the mailbox's colour. Postern picks one for you with **Smart From**, marked **suggested** in the menu: 1. For a reply or forward, the address the original was sent to (also with plus-addressing or a catch-all domain), or the address you sent it from when you answer your own message. 2. The address you last used to write to these recipients, then to their company domain. 3. The default identity of the mailbox (the one the original is in, or the one you are viewing). 4. Your first identity. You can always pick another one. If you pick an address and you usually write to the recipient's domain from a different one, Postern says **You usually write to example.com from you@example.com.** with a **Switch** button. ## Signatures Write a signature per identity in **Settings → Identities & signatures → Signature**, then click **Save signature**. Signatures can contain formatting, links and pictures copied from a web page. Pictures from your computer cannot go into a signature (**Pictures from your computer can't go into a signature or template. Copy a picture from a web page instead.**). In the composer the signature appears under your text, after a dash. Two buttons sit beside it: - **Edit the signature for this message**: changes it for this message only. - **Leave the signature off this message**: removes it. **More options → Add my signature** brings it back. Switching the From address switches the signature too. ## Attachments Attach files in any of these ways: - **Attach files** (the paperclip) and pick files. - Drag files onto the composer (**Drop files to attach**). - Paste files. Pasted pictures go into the text as inline images. Each file is uploaded to your Hub while you keep writing; the file shows **Uploading** until it is done. If you press Send before that, the message waits: **Sends when the files are uploaded.** Remove a file with its **Remove** button. The size limit is per file and is set on the Hub with `POSTERN_MAX_UPLOAD_MB` (default 25 MB). A bigger file is refused with **Couldn't attach file.pdf** and **It's too large.** Your mail provider has its own limit on the size of a whole message (often around 25 MB) and may refuse a message that is bigger. See [Configuration](https://docs.posternmail.app/configuration/). ## Drafts on every device Everything you write is a draft until it is sent. Postern saves it on your Hub about a second after you stop typing; the composer shows **Saving…**, then **Saved**. Drafts follow you to every device: open **Drafts** on another device and click **Edit** to continue there. Drafts are kept by Postern on your Hub. They are not written to the Drafts folder at your mail provider, so other mail programs do not see them. (Drafts that other programs saved at the provider are found with the search `in:drafts`.) Until the Hub confirms a save, the browser keeps its own copy of the text, so a reload, a crash or a lost connection does not cost you anything. If the Hub cannot be reached, the composer says **Not saved yet.** and **Your text is kept on this device, and saving is tried again by itself.** After a reload it reopens with **Picked up where you left off: this message was still open when Postern was last closed.** If the same draft was changed on another device meanwhile, Postern asks: **This draft was changed on another device. Which version do you want to keep?** Choose **Keep mine** or **Use the other version**. **Discard draft** (under **More options**) deletes it; the notice offers **Undo** for a few seconds. A draft you close without writing anything is deleted by itself (**Empty draft deleted**). ## Formatting Messages are written as formatted text (HTML); Postern adds a plain-text version when sending. Show the formatting bar with the **Formatting** button (**Hide formatting** hides it): | Button | Key | |---|---| | **Bold** | `⌘B` / `Ctrl+B` | | **Italic** | `⌘I` / `Ctrl+I` | | **Underline** | `⌘U` / `Ctrl+U` | | **Strikethrough** | | | **Bulleted list**, **Numbered list** | | | **Quote** | | | **Link** | | **Link** asks for an address (**Paste or type a link**); **Remove link** takes it off again. Addresses you type are turned into links by themselves. You can also type Markdown-style shortcuts at the start of a line: `- ` or `* ` for a bulleted list, `1. ` for a numbered list, `> ` for a quote, `## ` and `### ` for headings, and `**bold**` or `*italic*` around words. ## Address suggestions When you type in **To**, **Cc** or **Bcc**, Postern suggests people after a short pause. The suggestions come from the mail in your mailboxes: people you wrote to and people who wrote to you. People you wrote to, wrote to often, or marked as VIP (marked **VIP**) come first, then the ones you were in touch with most recently. Pick one with the arrow keys and `Enter`, or with a click. You can paste several addresses at once, separated by commas, semicolons or new lines. Remove a recipient with its **Remove** button or `Backspace`. In the desktop and phone apps, suggestions come from the copy of your mail on that device. --- # Snooze, send later and follow-ups > Snooze, send later, undo send, templates and follow-up reminders in Postern, where each one runs, and what happens while your devices are off. Source: https://docs.posternmail.app/using/later/ This page covers the features that act at a later time: snooze, send later, undo send and follow-up reminders, plus templates. The short version: timers run on your Hub, so they work while every device is off. The table at the end says exactly who does what. ## Picking a time Snooze, send later and follow-ups all open the same time picker. It offers a few presets with their exact date, and a field where you type a time in words. A preview shows what Postern understood; press `Enter` to take it. If it cannot read the text it says **Couldn't understand that time**. Typed times that work include: `tomorrow 9am`, `friday at 5pm`, `next monday`, `in 3 days`, `in 2 hours`, `dec 24 3pm`, `24 dec`, `2026-12-24`, `today 18:00`, `9:30am`, `noon`. A day without a time means 8:00 in the morning. Times are in your device's time zone. ## Snooze Snoozing takes a conversation out of your Inbox until the time you choose. Then it comes back to the top of the Inbox and you get a notification. Snooze with **Snooze** in the conversation toolbar, the clock on a row when you hover over it, the selection bar, or `H`. The presets: | Preset | Time | Offered | |---|---|---| | **Later today** | In about 3 hours, on the hour | Before 18:00, if it is still today | | **This evening** | 18:00 today | Before 17:00 | | **Tomorrow** | 8:00 tomorrow | Always | | **This weekend** | Saturday 9:00 | Monday to Thursday | | **Next week** | Monday 8:00 (at least two days away) | Always | | **In a month** | 8:00, same day next month | Always | Snoozed conversations are listed in **Snoozed**, with the time they come back. In an open snoozed conversation the header says **Snoozed until …** with **Unsnooze**; **Change snooze** in the toolbar picks a new time. Search for them with `is:snoozed`. Snooze is a Postern feature: the messages stay where they are at your provider (still in the inbox, for other mail programs). Postern keeps the snooze on your Hub, keyed by the message's `Message-ID`, so every device shows the same state. **When the time comes,** the Hub removes the snooze, puts the conversation at the top of the Inbox and sends a notification titled **Snoozed: Sender** to your devices. This happens on the Hub, so it works with every device off. If the Hub itself was off at that moment, it does all of this as soon as it starts again. ## Send later **Send later** is the arrow next to **Send** in the composer. It schedules the message instead of sending it. The presets: | Preset | Time | Offered | |---|---|---| | **This evening** | 18:00 today | Before 16:00 | | **Tomorrow morning** | 8:00 tomorrow | Always | | **Tomorrow afternoon** | 13:00 tomorrow | Always | | **Monday morning** | 8:00 next Monday | Always | The notice says **Scheduled for …**. Scheduled messages are listed under **Scheduled** in the sidebar, which appears while there is one. Each has two buttons: - **Send now**: sends it right away. - **Stop and edit**: asks **Stop sending this message?** and puts it back in **Drafts** (**It goes back to Drafts, where you can change it and send it again.**). **While your devices are off:** a scheduled message is sent by your Hub at the chosen time. The desktop and phone apps hand a scheduled message to the Hub as soon as they can reach it. If the Hub cannot be reached when you schedule, the app keeps the message (**Will be handed to your Hub when it's reachable**) and hands it over later; if the send time comes and the Hub is still unreachable, the app sends it itself, as long as it is running. Each message has one sender at a time and is never sent twice. ### When a send fails If the provider refuses the message for a reason that may pass (a connection problem, a rate limit), the Hub tries again after 1, 5, 15 and 30 minutes, five tries in all. A provider that names a wait time is respected. A permanent refusal (for example a rejected address) stops at once. A message that could not be sent stays under **Scheduled** with **Not sent** and the reason (**Your mail provider didn't accept it.**). The mail list shows a banner, **1 message couldn't be sent.** with **Review**, and the Hub sends a notification **Message not sent** with the subject (on phones with previews off: **A message could not be sent**). Choose **Send now** to try again or **Stop and edit** to change it. If the Hub stops while a message is being handed to the provider, it cannot know whether the provider took it. Such a message is marked as not sent and is never sent again by itself, so nobody gets it twice; check your Sent folder before you send it again. ## Undo send Every message waits a short time before it goes out, so you can take it back. While it waits, the notice says **Sending…** with **Undo**. Undo, or `Z`, brings the message back into the composer: **Not sent. Your message is open again.** For a scheduled message: **Not scheduled any more. Your message is open again.** Once it has gone out: **Too late to undo: the message has already gone out.** Set the wait in **Settings → Reading & sending → Undo send**: | Choice | Wait | |---|---| | **Off** | None, it goes out at once. | | **5 seconds** | 5 s | | **10 seconds** | 10 s (default) | | **20 seconds** | 20 s | | **30 seconds** | 30 s | The waiting happens where the message is sent from, not in the browser tab: from the web app, the Hub sends it after the wait even if you close the tab. The desktop and phone apps send the message themselves, directly to your provider, after the wait; they keep working without the Hub. ## Follow-up reminders A follow-up reminder brings a conversation back if nobody replies by a certain time. Set one in two places: - **When sending:** **Remind me** in the composer, next to Send (**Remind me if nobody replies by…**). The button then shows the time. The reminder starts when the message is sent. - **On any conversation:** **More actions → Set a follow-up…** or `Shift+H` (**Remind me if nobody has replied by…**). **Change follow-up…** and **Remove the follow-up** change it later. The presets are **Tomorrow**, **In 3 days**, **In a week** and **In 2 weeks**, each at 8:00. Conversations with a reminder are listed in **Follow-ups** and show a bell in lists. The conversation header says **Follow-up …** with the time. **When a reply arrives** in the conversation after you set the reminder, the reminder is removed by itself, and nothing happens at the time. **When the time comes without a reply,** the Hub moves the conversation back to the Inbox (also at the provider, if it was archived), puts it at the top, and sends a notification **No reply yet: Subject**. This runs on the Hub and works with every device off. ## Templates Templates are text you send often. Create them in **Settings → Templates** with **New template**: | Field | What it is | |---|---| | **Name** | How the template is listed. | | **Shortcut** | Optional. A word (at least two letters, digits, `-` or `_`) you type after `;` to insert the template, for example `thanks` for `;thanks`. | | **Subject (optional)** | Used as the subject when the message has none yet. | | **Text** | The template itself, with formatting. Pictures from your computer cannot go in; copy them from a web page. | Insert a template while writing: - Type `;` and the shortcut, for example `;thanks`, at the start of a line or after a space, then press `Tab` or `Enter`. The shortcut is replaced by the template. - Or click **Insert template** in the composer toolbar and pick one. The menu shows each template's shortcut. Templates are kept on your Hub and synced to every device. Deleting a template does not change messages you already wrote with it. ## Where each one runs | Feature | Runs on | Devices off | Hub off | |---|---|---|---| | Snooze wake-up | Hub | Works. | Runs when the Hub starts again. A running desktop or phone app also brings the conversation back and notifies while the Hub is unreachable. | | Follow-up reminder | Hub | Works. | Same as snooze. | | Send later | Hub (a device only while the Hub is unreachable) | Works. | A running desktop or phone app sends it at the time. Otherwise it goes out when the Hub is back (late). | | Undo send wait | Hub for the web app; the device for the desktop and phone apps | Web app: the Hub sends. | Desktop and phone apps send directly. The web app needs the Hub. | | Templates, drafts | Stored on the Hub, synced | Not affected. | Apps use their synced copy; changes sync later. | Notifications for snooze wake-ups and follow-up reminders go to every device with notifications turned on. **Notify me about** and quiet hours apply only to new mail, not to these reminders (see [Notifications](https://docs.posternmail.app/using/notifications/)). For more on how the apps work without the Hub, see [Offline and direct mode](https://docs.posternmail.app/apps/offline/). --- # Screener > The Screener holds mail from people writing to you for the first time until you let them in or screen them out. How it decides, what each choice does, and where held mail goes. Source: https://docs.posternmail.app/using/screener/ The Screener keeps mail from people who write to you for the first time out of your Inbox until you decide about them. This page explains how it decides, what **Allow** and **Screen out** do, and where held mail is. ## Turn it on The Screener is off by default. Turn it on in **Settings → Reading & sending → Screener** (**Holds mail from first-time senders until you let them in.**). The setting syncs to all your devices. While it is on, **Screener** appears in the sidebar between **Follow-ups** and **Drafts**, with the number of unread conversations waiting. The Screener only acts on mail that arrives after you turn it on. Mail already in your Inbox stays there. ## How it decides The Screener runs on your Hub when new mail arrives, for all your mailboxes. A new message is held when all of these are true: - it arrived in an inbox (not Spam, not Trash, not a draft); - it is new mail, not mail found while a mailbox downloads its history; - you have never written to the sender; - the sender is not a VIP; - you have not decided about the sender yet, and this is the first message from that address Postern has seen (or an earlier one is still waiting in the Screener). Everything else goes to your Inbox as usual. Senders are matched by email address. A conversation stays held until you decide, or until you write to the sender: answering a held conversation or writing a new message to that address lets them in by itself. ## What you see Open **Screener** in the sidebar to see who is waiting. When nobody is, it says **No new senders waiting** (**People who write to you for the first time wait here until you let them in.**). Open a held conversation. A banner says **Anna Example is writing to you for the first time. Let their mail into your Inbox?** with two buttons: | Button | What happens | |---|---| | **Allow** | The sender is let in. All their held conversations move to your Inbox, and their future mail goes there directly. The notice says **anna@example.com can reach your Inbox**. | | **Screen out** | The sender is blocked. Their mail in your inboxes is moved to Spam at the provider, and their future mail goes to Spam too. The notice says **anna@example.com is screened out** and offers **Undo**. | Undo after **Screen out** (the notice's button, or `Z`) changes the decision to let the sender in. It does not clear **Blocked**, and mail already moved to Spam stays there: unblock the sender in **Settings → Senders** and use **Not spam** on their conversations if you want them back. ## Where held mail goes Holding is a Postern feature. A held message stays where it is at your provider, in the inbox; other mail programs still show it there. In Postern, a held conversation: - is not in **Inbox**, and appears in **Screener** instead; - is found by search and is listed in **All mail**; - does not notify you. Only **Screen out** moves mail at the provider (to Spam). ## Change a decision later Every decision is listed in **Settings → Senders**. Choose **Screener** at the top to see only those. Each sender shows **Let in** or **Screened out**, with a button to switch to the other choice: **Screen out** or **Let in**. A decision cannot be removed, only changed. Screening out also sets **Blocked**; letting a sender in again does not clear Blocked, so use the **Blocked** button on the same row if their mail should leave Spam again. ## Turn it off Turn off **Settings → Reading & sending → Screener** to stop holding new senders. The **Screener** entry disappears from the sidebar. Decide about the senders still waiting before you turn it off, so their conversations are back in your Inbox. ## Related - [Inbox and conversations](https://docs.posternmail.app/using/inbox/): VIP and Block. - [Notifications](https://docs.posternmail.app/using/notifications/): held mail never notifies. --- # Tags > Tags in Postern, one set for all your mailboxes: create, colour, apply, how they sync across devices and how they are stored as Gmail labels, Outlook categories or IMAP and JMAP keywords. Source: https://docs.posternmail.app/using/tags/ Tags mark conversations across all your mailboxes, for example "Clients" or "Receipts". This page explains how to create and apply them, how they sync, and how they are stored at each mail provider. ## One set of tags for all mailboxes You have one list of tags, no matter how many mailboxes you connect. A tag can be on a conversation in Gmail and on one in an IMAP mailbox at the same time. Each tag has a name and a colour. The list (names, colours and order) is kept on your Hub and syncs to every device. Tags appear: - in the sidebar under **Tags**, each with its colour and number of unread conversations. Click one to list its conversations; - on conversation rows, as coloured chips (up to two per row); - in the conversation header, where **Remove the tag Clients** takes one off; - in the command palette, under **Tags**. ## Create a tag There are two ways: - **Settings → Tags**: type a name in **New tag** (up to 60 characters) and click **Add**. It gets the next colour of the palette. - While tagging: press `L` (or **Tag** in the toolbar), type a name that does not exist yet and choose **Create tag "Name"**. The new tag is put on the conversation at once. Two tags cannot have the same name: **A tag with this name already exists**. Names are compared without case, accents and punctuation, so "To do" and "to-do" count as the same. ## Change, colour and delete In **Settings → Tags**: | What | How | |---|---| | Rename | Click the name, type, press `Enter` or click elsewhere. | | Colour | Click the colour dot and pick a colour. | | Delete | The bin icon. Postern asks first: **It is taken off 3 conversations. The conversations themselves stay.** | Each tag shows how many conversations carry it. Renaming a tag keeps it working at the provider: the stored keyword does not change (see below). ## Apply and remove tags | Where | How | |---|---| | Open conversation | **Tag** in the toolbar, or `L`. | | Selected conversations | **More actions → Tag…** in the selection bar, or `L`. | | Command palette | **Tag…** | | Conversation header | **Remove the tag …** next to a tag. | The tag picker (**Tag with…**) lists your tags; type to filter. Picking a tag puts it on, or takes it off if every chosen conversation already has it. The notice says **Tagged Clients** or **Removed the tag Clients**, with **Undo**. A tag goes on every message of the conversation. [Rules](https://docs.posternmail.app/rules/) can tag mail as it arrives. ## Find tagged mail Click the tag in the sidebar, or search with `tag:` (also `label:`): ```text tag:Clients is:unread label:"To do" older_than:2w ``` A search started from a tag's list searches only that tag. See [Search](https://docs.posternmail.app/using/search/). ## How tags are stored at the provider Tags are saved at your mail provider, so they survive a reinstall and other devices can read them. Each provider stores them differently: | Provider | Stored as | Notes | |---|---|---| | Gmail and Google Workspace | A Gmail label with the tag's name | An existing label with the same name is reused; otherwise Postern creates it. The label also shows up as a folder in Postern and in Gmail. | | Microsoft 365 and Outlook.com | An Outlook category with the tag's name | Categories that you set in Outlook map to a Postern tag only if a tag with that name exists. | | IMAP (iCloud, Yahoo, Fastmail over IMAP, other servers) | An IMAP keyword `$MC_` plus the tag's short form, for example `$MC_clients` | A keyword of this form found on a message creates the tag in Postern. | | JMAP (Fastmail) | A keyword, as for IMAP | | The short form is the tag name in lower case, with letters and digits kept and spaces, dots, slashes and underscores turned into `-` ("To do" becomes `to-do`). It is fixed when the tag is created and does not change when you rename the tag. (The `$MC_` prefix comes from Postern's former name, MailClient.) Some IMAP servers do not allow custom keywords. On those, the tag is not saved at the provider. Other mail programs show Gmail labels and Outlook categories, but usually not IMAP keywords. ## Tags and offline devices You can tag while your device is offline. The desktop and phone apps apply the tag at the provider themselves, and a new tag is created on the Hub when it is reachable again. --- # Keyboard shortcuts and command palette > Every keyboard shortcut of the Postern web app, how to change or turn them off, and the command palette. Source: https://docs.posternmail.app/using/shortcuts/ Postern can be used entirely from the keyboard. This page lists every shortcut of the web app, explains how to change them, and describes the command palette. The desktop app has the same shortcuts plus its menus; see [Desktop app](https://docs.posternmail.app/apps/desktop/) for the menu shortcuts. Press `?` anywhere to see all shortcuts in the app, in your own key bindings. ## How to read the keys - `⌘` on macOS, `Ctrl` on Windows and Linux. The tables write this as `⌘/Ctrl`. - `G` then `I` means: press `G`, let go, then press `I` within about a second. - Letters are shown in capitals but typed without Shift, unless the table says `Shift`. - `#`, `!` and `?` are the characters, however your keyboard layout types them. Shortcuts work when you are not typing in a text field. The ones marked "anywhere" also work while typing. ## Navigation | Action | Keys | |---|---| | Next conversation | `J` | | Previous conversation | `K` | | Open conversation | `O` | | Open the highlighted conversation | `Enter` (fixed) | | Back to list | `U` | | Search | `/` | | Select conversation | `X` | | Select all | `⌘/Ctrl+A` | | Clear the selection, then close the conversation | `Esc` (fixed) | ## Conversation These act on the selected conversations, or else on the open one, or else on the one under the keyboard cursor. | Action | Keys | |---|---| | Archive | `E` | | Move to Trash | `#` | | Report spam | `!` | | Star or unstar | `S` | | Snooze | `H` | | Set a follow-up | `Shift+H` | | Pin or unpin | `P` | | Mute | `M` | | Move to folder | `V` | | Tag | `L` | | Mark as read | `Shift+I` | | Mark as unread | `Shift+U` | | Undo the last action | `Z` or `⌘/Ctrl+Z` | Undo works for 60 seconds after an action and goes back up to 20 steps. It says what it undid (**Undone: Archived**) or **Nothing to undo**. ## Compose | Action | Keys | |---|---| | Reply | `R` | | Reply all | `A` | | Forward | `F` | | New message | `C` | | Send | `⌘/Ctrl+Enter` (anywhere), or `Enter` if you chose it | The Send key follows **Settings → Reading & sending → Send with** and cannot be changed in the shortcut settings. Inside the composer: | Action | Keys | |---|---| | Bold, italic, underline | `⌘/Ctrl+B`, `⌘/Ctrl+I`, `⌘/Ctrl+U` | | Insert a template | `;` and its shortcut, then `Tab` or `Enter` | | Close and keep as draft | `Esc` | ## Go to | Action | Keys | |---|---| | Go to Inbox | `G` then `I` | | Go to Starred | `G` then `S` | | Go to Snoozed | `G` then `Z` | | Go to Sent | `G` then `T` | | Go to Drafts | `G` then `D` | | Go to Archive | `G` then `E` | | Go to All mail | `G` then `A` | | Open settings | `G` then `,` | ## App | Action | Keys | |---|---| | Command palette | `⌘/Ctrl+K` (anywhere) | | Keyboard shortcuts | `?` | | Show or hide the sidebar | `⌘/Ctrl+.` or `⌘/Ctrl+\` | ## In lists and pickers - In the search box: arrow keys move through suggestions, `Tab` completes one, `Enter` searches. - In the snooze, send-later and follow-up picker: arrow keys pick a preset, `Enter` takes it or the time you typed. - In the folder and tag pickers: type to filter, arrow keys and `Enter` to choose. ## Change shortcuts Open **Settings → Keyboard shortcuts**. Every action is listed with its keys and three buttons: | Button | What it does | |---|---| | **Change** | Records new keys. Press a key or a combination; for a two-key sequence press a second key within about a second. `Esc` or a click elsewhere cancels. | | **Remove** | Leaves the action without a shortcut. | | **Reset** | Goes back to the default keys (only shown after a change). | Keys that another action already uses are refused: **is used by "Archive". Press other keys, or Esc to cancel.** A key that starts a sequence (such as `G`) cannot also be a shortcut of its own. `Enter` and `Esc` are fixed (**Always this key.**). If two actions still share keys from an older version, the list says **Also used by "…": only one of them works. Change one.** Your shortcuts are saved in your account and apply on every device. ## Turn off single-key shortcuts **Settings → Keyboard shortcuts → Single-key shortcuts** turns off every shortcut without `⌘` or `Ctrl`. Use it with a screen reader or keyboard tools that use the same keys. Shortcuts with `⌘` or `Ctrl` (the command palette, select all, the sidebar, Send) keep working. ## Command palette Press `⌘/Ctrl+K` to open the command palette (**Type a command or search…**). Type a few letters of any word in a command; every word you type must appear. `Enter` runs the highlighted command, `Esc` closes the palette. Each command shows its shortcut, if it has one. The palette holds: | Group | Commands | |---|---| | **Conversation** | Archive, Move to Trash, Report spam, Star or unstar, Snooze…, Set a follow-up…, Pin or unpin, Mute, Move to folder…, Tag…, Mark as read, Mark as unread, Select conversation, Select all, Clear selection, Undo the last action | | **Compose** | New message, New message from you@example.com (one per address), Reply, Reply all, Forward | | **Navigation** | Next conversation, Previous conversation, Open conversation, Back to list, Search mail | | **Go to** | Go to Inbox, Starred, Snoozed, Follow-ups, Screener, Drafts, Scheduled, Sent, All mail, Archive, Spam, Trash; Inbox of you@example.com (one per mailbox); Open settings; Settings: Notifications (one per settings section) | | **Folders** | Every folder, by path | | **Tags** | Every tag | | **Spaces** | Show all mailboxes, Switch to Work (one per Space) | | **App** | Theme: dark, Theme: light, Theme: match system, Density: compact or comfortable, Reading pane: right, bottom or off, Show or hide the sidebar, Keyboard shortcuts, Add a mailbox…, Connect a device…, Sign out, and in the desktop app Desktop app options… | Conversation commands are offered only where a conversation list is on screen. When you type, the palette also offers **Search mail for "what you typed"**. --- # Notifications > How Postern decides when to notify you, the account, per-mailbox and per-device notification settings, quiet hours, previews on phones, Web Push in browsers, desktop and mobile notifications. Source: https://docs.posternmail.app/using/notifications/ Your Hub decides when new mail is worth a notification and delivers it to all your devices, so every device follows the same rules. This page explains those rules, every notification setting, and how notifications reach a browser, the desktop app and a phone. ## How the Hub decides When a new message arrives in one of your inboxes, the Hub notifies you unless one of these is true: | Reason | Details | |---|---| | It is not new | Mail found while a mailbox downloads its history, mail moved back into a folder, or a copy of a message you were already told about (for example the same mail in two of your mailboxes). | | It is not in an inbox | Mail in Spam, Trash, other folders, drafts, and mail you sent yourself. | | It is already read | Read at the provider before the Hub saw it. | | The sender is blocked | See [Block](https://docs.posternmail.app/using/inbox/#pin-mute-and-vip). | | The conversation is muted, snoozed or held in the Screener | | | **Notify me about** says otherwise | **Nothing**, or **VIPs only** and the sender is not a VIP. | | The mailbox's own setting says otherwise | **None**, or **VIPs only**. | | Quiet hours | Unless the sender is a VIP. | A [rule](https://docs.posternmail.app/rules/steps/) can override all of this for the mail it matches, with a notify step that always or never notifies. At most 10 notifications go out for one batch of new mail. Besides new mail, the Hub notifies you when a snoozed conversation comes back, when a follow-up reminder is due, and when a message could not be sent. These go to every device with notifications on; **Notify me about**, the mailbox setting and quiet hours do not apply to them. ## Account settings (all devices) Open **Settings → Notifications**. The section **What to notify** syncs to all your devices: | Setting | Choices | Default | |---|---|---| | **Notify me about** | **All new mail**, **VIPs only**, **Nothing** | **All new mail** | | **Quiet hours** | On or off, with a start and end time | Off, 22:00 to 07:00 | | **Show sender and subject on phones** | On or off | On | **Quiet hours** pause new-mail notifications between the two times, every day. The window can run past midnight (22:00 to 07:00). Mail from VIPs still notifies. The times are in the time zone of your Hub (the server's `TZ`), not of your device. If your Hub runs in another time zone than you, set the hours in the Hub's time. **Show sender and subject on phones** is about push to phones only: see [Previews on phones](https://docs.posternmail.app/using/notifications/#previews-on-phones). ## Per mailbox Each mailbox has its own **Notifications** setting in **Settings → Mailboxes**: | Choice | Meaning | |---|---| | **Use my default** (default) | Follows **Notify me about**. | | **All new mail** | Every new message of this mailbox, whatever the default says. | | **VIPs only** | Only VIP senders. | | **None** | Never for this mailbox. | Quiet hours apply to every mailbox. There is no separate setting per Space; to silence a group of mailboxes, set each of them. To silence one conversation, mute it. ## Per device The section **This device** applies only to the device you are using: | Setting | What it does | Default | |---|---|---| | **Notifications in this browser** (web) / **Notifications on this computer** (desktop app) | Whether this device gets notifications at all. | On, once allowed | | **Sound** | Plays a sound with each notification. | On | A device with notifications off gets none, whatever the account settings say. Every device you are signed in to is listed in **Settings → Devices**, with **notifications on** next to those that get them. ## In the browser (Web Push) In the web app, click **Turn on** next to **Notifications in this browser**. The browser asks for permission; allow it. - If your browser supports Web Push, you see **Notifications are on for this browser, even when Postern is closed.** Notifications then arrive even when no Postern tab is open, as long as the browser is running. - If it does not, you see **Notifications are on while Postern is open.** They show only while a Postern tab is open. - If you blocked notifications for the site, the row says **Blocked for this site. Allow notifications in your browser's site settings, then turn them on here.** and the button is disabled. Change it in the browser's site settings first. Browsers allow Web Push only on secure pages: your Hub must be opened over `https://` (or `http://localhost`). See [Reaching your Hub](https://docs.posternmail.app/reach/). While Postern is the tab you are looking at, new mail shows as a short notice inside the app instead of a system notification. When the tab is hidden, you get a system notification. The Hub creates its own Web Push keys on first start; there is nothing to configure. A Web Push message contains the sender, the subject and the first words, encrypted for your browser: the browser's push service (Google, Mozilla or Apple) passes it on but cannot read it. **Show sender and subject on phones** does not apply to browsers. **Turn off** stops notifications for that browser and removes its push registration. ## In the desktop app Turn on **Notifications on this computer** in **Settings → Notifications**. The desktop app shows a system notification for new mail whenever its window is not the one you are working in, also when it is on screen behind another app. Closing the main window keeps the app running, so notifications keep arriving. While the Hub is unreachable, the desktop app notices new mail itself and still notifies you. The same section has **Default mail app** (open email links on this computer in Postern) and **Desktop app options…** (menu bar or tray icon, opening at login, quick compose, spelling). See [Desktop app](https://docs.posternmail.app/apps/desktop/). ## On phones Phones get notifications through Apple's and Google's push services, which only accept pushes sent with the app developer's keys. Your Hub hands them to a **push relay** that forwards them. Without a relay configured on your Hub (`POSTERN_RELAY_URL`), phones get no push. Setting up the relay, and what it can see, is explained in [Push relay](https://docs.posternmail.app/relay/). Turn notifications on in the phone app's **Settings → Notifications**; the phone asks for permission. The phone app shows the same account settings as the web app (its preview switch is called **Show previews on phones**). See [iOS](https://docs.posternmail.app/apps/ios/) and [Android](https://docs.posternmail.app/apps/android/). ### Previews on phones | **Show sender and subject on phones** | What the push contains | |---|---| | On (default) | The sender, the subject and the first words of the message. This text passes through the relay and Apple or Google. | | Off | Only a generic title: **New mail**, **A snoozed conversation is back**, **Follow-up reminder** or **A message could not be sent**. No sender, subject or text leaves your Hub. The app fetches the details itself when you open it. | The setting affects only push to phones. Browsers and the desktop app always show sender and subject, because their notifications do not pass through Apple or Google in readable form. More in [What the relay sees](https://docs.posternmail.app/relay/what-it-sees/). ## Alerts about rules The same page has a section **Alerts about rules**, which sends warnings about rules (sending paused, the sending queue needs you) to ntfy, Discord or Gotify. These are not mail notifications; see [Rule alerts](https://docs.posternmail.app/rules/alerts/). ## When notifications do not arrive | Symptom | What to check | |---|---| | No notifications anywhere | **Notify me about** is not **Nothing**; quiet hours; the mailbox's own setting; whether the conversation is muted or held in the Screener. | | None in one browser | **Notifications in this browser** is on, the site is allowed in the browser's settings, and the Hub is opened over https. | | Only while the tab is open | The browser has no Web Push, or the page is not secure. | | None on the phone | `POSTERN_RELAY_URL` is set on the Hub, and the app has permission; see [Push relay](https://docs.posternmail.app/relay/). | | At the wrong time of night | Quiet hours follow the Hub's time zone. | --- # Settings reference > A tour of every Settings screen of the Postern web app, with each setting, what it does, its default, and whether it syncs to all devices or applies to one device. Source: https://docs.posternmail.app/using/settings/ This page goes through every screen under **Settings** in the web app, in the order of the settings menu, and lists each setting with what it does and its default. The desktop and phone apps show the same settings (the phone app shows fewer). Open Settings with the gear at the bottom of the sidebar, `G` then `,`, or **Settings: …** in the command palette. ## What syncs and what does not | Kind | Where it is kept | Example | |---|---|---| | **Synced** | Your account on the Hub. A change appears on all your devices. | Theme, undo send, Screener, notification rules, shortcuts, mailboxes, identities, Spaces, tags, templates, rules. | | **This device** | Your account on the Hub, separately for each device. | **Notifications in this browser**, **Sound**. | | **This browser or app only** | Stored locally, not on the Hub. | The Space you have chosen, recent searches, which mailboxes are expanded in the sidebar. | Most switches and choices save as soon as you change them. Text fields save when you leave them or press `Enter` and say **Saved**. If saving fails, the setting goes back and you see **That setting wasn't saved.** with the reason. ## You ### Account **Your account: one sign-in for all your mailboxes, on every device.** | Section | Settings | |---|---| | **Profile** | **Name**; **Sign-in email** (to change it, enter your **Current password**: **Needed to change the sign-in email.**). **Save**. | | **Password** | **Current password**, **New password** (**At least 10 characters.**), **Change password**. **Changing it signs out your other devices.** | | **Your data** | **Export settings → Download**: a file with your mailboxes (without passwords), identities, rules, templates and settings. | | **Delete account** | **Delete account…** removes your account, mailbox sign-ins and settings from your Hub and signs out every device. Nothing is deleted at your mail providers. You confirm with your password. | **Sign out…** signs this browser (or computer) out and removes the mail saved in it. More about accounts and sign-in: [Users](https://docs.posternmail.app/admin/users/) and [Sign-in](https://docs.posternmail.app/admin/sign-in/). ### Security | Section | What it does | |---|---| | **Two-step verification** | **Set up** adds a code from an authenticator app when you sign in with a password. You save recovery codes during setup. **Turn off…** removes it. | | **Passkeys** | Sign in with Face ID, Touch ID, Windows Hello or a security key. **Add a passkey**, **Remove**. Passkeys only work when your Hub is opened over `https://`; in the desktop app they are managed in the web app (**Open web app**). | | **Recent security activity** | Recent events of your account: sign-ins and failed sign-ins, devices paired or signed out, password, two-step and passkey changes, mailboxes added or removed, exports, and apps fetching mailbox sign-ins. | ### Devices Every device you are signed in to, with **active now** or **last seen …** and **notifications on** when it gets notifications. **This device** marks the one you are using. - **Rename** a device. - **Sign out…** ends its session now; the mail saved on it is removed the next time it connects. - **Connect a device** shows a code to sign in a new phone or computer; see [Pairing](https://docs.posternmail.app/apps/pairing/). ## Mail ### Mailboxes The mail accounts you connected. **Add mailbox** connects another one; see [Connect mailboxes](https://docs.posternmail.app/providers/). For each mailbox: | Setting | What it does | Default | |---|---|---| | Status line | Provider, state (for example live, downloading with a progress bar, paused, needs sign-in) and when it was last checked. **Technical details** shows the provider's error. | | | **Color** | The mailbox colour for the spine, dots and the unread bar. | Assigned when added | | **Sender name** | The name people see on mail you send from this mailbox. | From the mailbox | | **Notifications** | **Use my default**, **All new mail**, **VIPs only**, **None**. See [Notifications](https://docs.posternmail.app/using/notifications/#per-mailbox). | **Use my default** | Buttons: | Button | What it does | |---|---| | **Reconnect** | Shown when the mailbox needs you to sign in again. | | **Pause** / **Resume** | Stops or restarts getting new mail for this mailbox. | | **Download again…** | Fetches all mail of this mailbox again from the provider. Nothing is deleted, but it takes a while and uses data. | | **Update sign-in** | Signs in again (Google, Microsoft), or takes a new password or API token. | | **Remove…** | Removes the mailbox from Postern on all your devices. Nothing is deleted at the provider. | All of this syncs. ### Identities & signatures The addresses you send from, grouped by mailbox. Each has **Name**, **Reply-to** (optional), **Signature** (**Save signature**), and **Make default** or delete for addresses that are not the default. **Add an address** adds an alias. Details in [Compose](https://docs.posternmail.app/using/compose/#identities-and-the-from-address). Synced. ### Spaces Groups of mailboxes with their own Inbox and counts. **New space**, **Edit** (Name, Color, Mailboxes), delete. See [Spaces](https://docs.posternmail.app/using/inbox/#spaces). Synced; the chosen Space is per browser or app. ### Tags One set of tags for all mailboxes: rename, colour, delete, and **New tag**. See [Tags](https://docs.posternmail.app/using/tags/). Synced. ### Senders People you marked as **VIP**, **Blocked** or **Always show images**, and your Screener decisions (**Let in**, **Screened out**). Search with **Search senders**, filter with **All**, **VIP**, **Blocked**, **Always show images** and **Screener**. Each row has toggle buttons for VIP, Blocked and Always show images, **Let in** or **Screen out** for a Screener decision, and **Clear** to switch off VIP, Blocked and Always show images at once. Every change offers **Undo**. Domains allowed with **Always load from example.com** are listed here too. Synced. ### Split inbox | Setting | What it does | Default | |---|---|---| | **Split inbox** | Shows your Inbox as sections. | Off | | **Tabs** | The built-in **People**, **Notifications** and **Newsletters** (each can be turned off), and your own tabs with a name and a search query (**Add tab**). | All three built-ins on | See [Split inbox](https://docs.posternmail.app/using/inbox/#split-inbox). Synced. ### Templates Text you send often, with an optional `;shortcut`. **New template**, **Edit**, delete. See [Templates](https://docs.posternmail.app/using/later/#templates). Synced. ## Rules These screens belong to rules, which run on your Hub. Each has its own page: | Screen | What it is | Page | |---|---|---| | **Rules** | Your rules, in the order they run, with **New rule**, on/off, order, **Edit** and delete; below them **Limits and storage**. | [Rules](https://docs.posternmail.app/rules/), [Limits](https://docs.posternmail.app/rules/limits/) | | **Rule activity** | What rules did or would have done, with Undo. | [Activity](https://docs.posternmail.app/rules/activity/) | | **Captured mail** | Copies that rules kept. | [Captured mail](https://docs.posternmail.app/rules/captured-mail/) | | **Sending queue** | Mail that rules redirect or forward, and what needs your attention. | [Sending queue](https://docs.posternmail.app/rules/sending-queue/) | ## App ### Notifications | Setting | Scope | Default | |---|---|---| | **Notify me about**: **All new mail**, **VIPs only**, **Nothing** | Synced | **All new mail** | | **Quiet hours**, with start and end | Synced | Off, 22:00 to 07:00 | | **Show sender and subject on phones** | Synced | On | | **Notifications in this browser** / **Notifications on this computer** | This device | On, once allowed | | **Sound** | This device | On | | **Default mail app** (desktop app) | This computer | | | **Desktop app options…** (desktop app) | This computer | | | **Alerts about rules** | Synced | None set up | Details in [Notifications](https://docs.posternmail.app/using/notifications/) and [Rule alerts](https://docs.posternmail.app/rules/alerts/). ### Appearance **Synced to all your devices.** | Setting | Choices | Default | |---|---|---| | **Theme** | **Light**, **Dark**, **System** | **System** | | **Accent color** | The colour of selected items and main buttons: eight swatches or your own colour. | Blue (`#3b6cf6`) | | **Density** | **Comfortable**, **Compact** (more conversations on screen, one line each) | **Comfortable** | | **Reading pane** | **Right**, **Bottom**, **Off** (the conversation replaces the list) | **Right** | | **Fold messages you've read** | In a conversation, only the newest and unread messages open in full. | On | | **Time format** | **System**, **12-hour**, **24-hour** | **System** | ### Reading & sending **Synced to all your devices.** | Section | Setting | Choices | Default | |---|---|---|---| | **Reading** | **Mark as read** | **When opened**, **After 2 seconds**, **Only when I say so** | **When opened** | | | **Pictures in messages** | **Ask every time**, **Load from people I know**, **Always load**. See [Remote images](https://docs.posternmail.app/using/inbox/#remote-images). | **Load from people I know** | | | **After archiving or deleting** | **Open the next (older) conversation**, **Open the previous (newer) conversation**, **Go back to the list** | Next (older) | | | **Split inbox** | On or off (**Choose the tabs** opens Split inbox) | Off | | | **Screener** | On or off. See [Screener](https://docs.posternmail.app/using/screener/). | Off | | **Swiping** | **Swipe left** | **Archive**, **Move to Trash**, **Mark as read or unread**, **Star**, **Snooze**, **Nothing** | **Archive** | | | **Swipe right** | The same | **Mark as read or unread** | | **Sending** | **Undo send** | **Off**, **5 seconds**, **10 seconds**, **20 seconds**, **30 seconds** | **10 seconds** | | | **Default reply** | **Reply**, **Reply all**: what the reply box under a conversation starts | **Reply** | | | **Send with** | `⌘/Ctrl+Enter`, or `Enter` (then `Shift+Enter` starts a new line) | `⌘/Ctrl+Enter` | | **Where your mail is kept** | **Keep a full copy of my mail on my Hub** | On or off | Off | Swiping works on touch screens and in the phone app; it does nothing with a mouse. **Keep a full copy of my mail on my Hub.** The desktop and phone apps get mail straight from your providers. The Hub only keeps a full copy of your mail while you use the web app: for 7 days after your last visit it keeps everything up to date; after that it only watches your inboxes (enough for notifications, rules, the Screener, snooze and follow-ups) and keeps the rest as it was, until `POSTERN_HUB_MAIL_COPY_DAYS` (default 30) after your last visit, when it drops everything outside the recent inbox. Coming back to the web app starts a catch-up. Turn the setting on to keep a complete, current copy on the Hub at all times, for example for faster web searches after a break. See [Configuration](https://docs.posternmail.app/configuration/). ### Keyboard shortcuts **Single-key shortcuts** (default on), and every shortcut with **Change**, **Remove** and **Reset**. Synced. See [Keyboard shortcuts](https://docs.posternmail.app/using/shortcuts/). ### AI assist This screen is meant for optional summaries and reply drafts with your own API key. In this version of Postern no Hub offers it, so the screen shows **AI assist isn't turned on for your Hub**, and there is nothing to set. ## Hub ### Admin Shown only to Hub admins: the Hub's status, people and invites, sign-in with Google and Microsoft, and the mailboxes on the Hub. See [Admin panel](https://docs.posternmail.app/admin/admin-panel/). --- # Rules > What rules are, where and when they run, the order they run in, a first rule step by step, and how Postern keeps rule actions safe. Source: https://docs.posternmail.app/rules/ Rules act on new mail the moment it arrives: they tag, move, forward, redirect, answer, keep or report it. This page explains how rules work as a whole and walks you through a first rule. The pages under **Rules** in the sidebar cover each part in detail. You find rules in the web app under **Settings → Rules**. The same group in the settings holds **Rule activity**, **Captured mail** and **Sending queue**. ![The rule editor with a redirect rule in Test mode and the "Test against recent mail" panel](https://posternmail.app/img/rules.webp) ## Where and when rules run Rules run on your [Hub](https://docs.posternmail.app/how-it-works/), not in an app. The Hub syncs your mailboxes all the time, so a rule acts on new mail within moments of its arrival, also while your computer and phone are switched off. - A rule runs once for each **new** message, right after the Hub has stored it and before it announces the message to your devices. A rule that only tags or moves mail is therefore done before your phone shows a notification. - Rules do not run again on mail you already have. To apply a rule's simple actions to existing mail, use **Save and apply to mail I already have** in the editor (see [below](https://docs.posternmail.app/rules/#apply-a-rule-to-mail-you-already-have)). - A rule that needs the message text, an attachment name or an unusual header (see [Conditions](https://docs.posternmail.app/rules/conditions/#conditions-that-need-the-message-text)) is decided a little later, after the Hub has fetched the message body. The editor says so under such a condition: "This needs the message text, so the rule may run a little later." > [!NOTE] > The desktop and mobile apps connect to your mail providers directly. If your Hub has been > unreachable for more than two minutes, an app runs your rules itself for mail that arrives in > the meantime, but only the steps that change a message (tag, move, mark, star, Trash). > Everything that sends mail, keeps a copy, deletes for good or calls out (redirect, forward, > automatic reply, capture, copy, delete for good, web address, notification) runs only on the > Hub. Running a rule twice does no harm: actions are done once per message. ## What a rule is made of | Part | In the editor | What it means | |---|---|---| | Name | **Name** | Shown in the rule list, the activity log and the sending queue. Up to 200 characters. | | Mode | **Mode**: **Live** or **Test** | Live rules act. Test rules only write what they would do into the activity log. See [Test mode](https://docs.posternmail.app/rules/test-mode/). | | Mailboxes | **In mailboxes**: **All** or one or more mailboxes | Which mailboxes the rule watches. **All** includes mailboxes you add later. | | Conditions | **When**, with **all of these match** or **any of these matches** | What a message must look like. Up to 20 conditions. See [Conditions](https://docs.posternmail.app/rules/conditions/). | | Exceptions | **Except when** | If **any** exception matches, the rule does not apply. Up to 20 exceptions. | | Search | **Advanced: match with a search** | Optional. A search in the same language as the search box. When set, mail must match the search **and** the conditions. See [Search](https://docs.posternmail.app/using/search/). | | Steps | **Then** | What the rule does, in order. See [Steps](https://docs.posternmail.app/rules/steps/). | | Stop | **Skip the rules below this one** | When this rule matched, later rules do not run for the message. | A rule needs a name, at least one condition or a search, and at least one step. The switch next to a rule in the list turns it on or off without deleting it. ## Order of evaluation Rules run from top to bottom in the order of the list. Use the arrows next to a rule to move it. For each new message the Hub does this: 1. It skips rules that are off and rules that do not watch the message's mailbox. 2. It checks each remaining rule: conditions, then exceptions, then the search (if any). 3. **Every** rule that matches acts, not only the first one. If a matching rule has **Skip the rules below this one** and is Live, the rules below it are not checked for this message. 4. Within a rule, steps run in the order shown. The one step that takes the message out of its folder (redirect, capture, delete, archive, move, Spam) always runs last, whatever its position. A rule can have only one such step. 5. When a step takes the message away for good (redirect, capture, delete), rules further down do not run for it. Their entries in the activity log say "The message was already removed by another rule". When several matching rules move the message, only one move happens. Trash wins over Spam, Spam over a move to a folder, a move over Archive. Between two moves to folders, the lower rule wins. The other rules' moves show "Another rule moved the message" in the activity log. Tags, read and star changes of all matching rules are all applied. > [!TIP] > A rule in Test mode never stops later rules, even with **Skip the rules below this one** > ticked. The editor says "While the rule is in Test, the rules below still run." This lets you > test a new rule above your existing ones without changing what they do. ## Your first rule, step by step This example tags receipts from one shop and archives them. 1. Open **Settings → Rules** and choose **New rule**. 2. In **Name**, type `Receipts from Acme`. 3. Leave **Mode** on **Live**. Under **In mailboxes**, keep **All** or pick one mailbox. 4. Under **When**, the first condition is already there. Set it to **Address**, **From**, **is at domain**, and type `acme.com`. This matches `billing@acme.com` and `noreply@shop.acme.com`. 5. Choose **Add a condition**, set it to **Text**, **Subject**, **contains**, `receipt`. Leave the match setting on **all of these match**. 6. Under **Then**, choose **Add a step** → **Tag** and pick a tag. Then **Add a step** → **Archive**. 7. Look at **Test against recent mail** on the right. It shows how many of your last 50 messages match and what the rule would do to each. Nothing is changed. 8. Choose **Save**. The rule list now shows the rule with the line "From is at domain “acme.com” and subject contains “receipt”". > **Check:** the next receipt from Acme arrives tagged and archived. **Settings → Rule activity** > lists the rule's actions with the outcome **Done**, and the rule list shows "matched 1 time". > **If it did not work:** open **Rule activity** and filter by the rule. No entry means the rule > did not match: compare the message with the conditions in **Test against recent mail**. An > entry with **Failed** says why in its detail line, for example when the mailbox needs you to > sign in again. ### Apply a rule to mail you already have **Save and apply to mail I already have** saves the rule and runs it on the newest 10,000 matching conversations you already have. Only the simple actions run: tag, mark as read, star, archive, move, Spam, Trash. Steps such as redirect, forward, reply, copy, capture, delete or calling a web address never run on old mail. A rule in Test mode only counts: "Rule saved. It's in Test, so nothing was changed: 12 conversations you already have match." ## How Postern keeps rule actions safe Rules can send mail and remove messages from your mailbox. A mistake there costs more than a wrong tag, so these actions have extra protection. ### A copy first Before a rule removes a message for good (redirect, capture, delete for good), the Hub stores an encrypted copy, reads it back and checks it. Only then is the message deleted from the mailbox. You can put it back from **Captured mail**, the **Sending queue** or with **Undo** in the activity log. See [Captured mail](https://docs.posternmail.app/rules/captured-mail/). ### Nothing is lost in a restart Every rule action that sends, keeps or calls out is written to the Hub's database before it starts, and every stage of its progress is recorded. If the Hub stops (an update, a power cut), it carries on where it stopped when it starts again. See [Sending queue](https://docs.posternmail.app/rules/sending-queue/). ### It retries, then asks you A send or a web call that fails is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. After that it waits for you in the sending queue with **Retry**, **Change recipient**, **Restore to mailbox** and **Download .eml**. If the Hub cannot tell whether an interrupted send went out, it checks your Sent folder, and if that does not settle it, it asks you rather than risk sending the message twice. ### Limits and loop guards Rules that send mail stop at daily limits (100 a day per rule, 200 per mailbox) and pause for 15 minutes when more than 20 go out in a minute. They never send on mail that a rule sent, automatic replies or bounces, and never to the mailbox's own address. See [Limits and guards](https://docs.posternmail.app/rules/limits/). ### Test mode New rules that send mail start in Test mode. They write what they would do into the activity log and change nothing. See [Test mode](https://docs.posternmail.app/rules/test-mode/). ### Alerts When rule mail needs you (sending paused, a message that could not be sent or bounced, a mailbox that needs you to sign in, a web address that never answered), the Hub raises an alert. Open alerts appear at the top of **Settings → Rules** under **Needs your attention**, your devices get one notification, and you can have alerts sent to ntfy, Discord or Gotify. See [Alerts](https://docs.posternmail.app/rules/alerts/). ## The pages in this section | Page | What it covers | |---|---| | [Conditions](https://docs.posternmail.app/rules/conditions/) | Every condition and exception, operators, patterns, time of day and time zone | | [Steps](https://docs.posternmail.app/rules/steps/) | Every step, what it does on Gmail, Microsoft, IMAP and JMAP, and its risks | | [Test mode](https://docs.posternmail.app/rules/test-mode/) | Test mode, "Test against recent mail", switching a rule to Live | | [Activity and undo](https://docs.posternmail.app/rules/activity/) | The activity log, how long it is kept, what Undo can and cannot reverse | | [Sending queue](https://docs.posternmail.app/rules/sending-queue/) | Stages, retries, unconfirmed sends, Retry, Change recipient, Restore, Download | | [Captured mail](https://docs.posternmail.app/rules/captured-mail/) | Mail the Hub keeps for rules: encryption, retention, restore | | [Limits and guards](https://docs.posternmail.app/rules/limits/) | Daily limits, the burst pause, loop and bounce guards | | [Alerts](https://docs.posternmail.app/rules/alerts/) | ntfy, Discord and Gotify, what raises an alert | | [Webhooks](https://docs.posternmail.app/rules/webhooks/) | The **Call a web address** step and its JSON payload | | [Import from MailManager](https://docs.posternmail.app/rules/mailmanager/) | `postern-hub import-mailmanager` | --- # Conditions and exceptions > Every rule condition and exception, with its fields, operators and value formats, pattern syntax, how addresses and headers are matched, automated mail, and time of day. Source: https://docs.posternmail.app/rules/conditions/ Conditions decide which messages a rule acts on. This page lists every condition, its operators and what exactly each one compares. Exceptions use the same conditions. ## How conditions combine - Under **When**, a rule applies when **all of these match** (the default) or **any of these matches**. The choice appears once the rule has two or more conditions. - Under **Except when**, the rule does not apply if **any** exception matches. - Under **Advanced: match with a search**, an optional search in the same language as the search box (`from:`, `to:`, `subject:`, `has:attachment`, `list:`, `-word`, `OR`, see [Search](https://docs.posternmail.app/using/search/)). When it is set, a message must match the search **and** the conditions. A rule can also use only a search and no conditions. So a rule matches when: the search matches (if there is one) **and** the conditions match **and** no exception matches. | Limit | Value | |---|---| | Conditions per rule | 20 | | Exceptions per rule | 20 | | Length of a text value | 1 to 500 characters | | Length of a header name | up to 100 characters | | Length of the search | up to 2,000 characters | Text values are trimmed: spaces at the start and the end are removed when you save. ## The conditions | Condition | In the editor | Value | |---|---|---| | [Address](https://docs.posternmail.app/rules/conditions/#address) | **Address** | A part (From, To, ...), an operator and a text | | [Text](https://docs.posternmail.app/rules/conditions/#text) | **Text** | Subject, message text or attachment name, an operator and a text | | [Header](https://docs.posternmail.app/rules/conditions/#header) | **Header** | A header name, an operator and (except for present or missing) a text | | [Attachments](https://docs.posternmail.app/rules/conditions/#attachments) | **Attachments** | **Has attachments** or **Has no attachments** | | [Size](https://docs.posternmail.app/rules/conditions/#size) | **Size** | **Larger than** or **Smaller than** a number of KB | | [Time received](https://docs.posternmail.app/rules/conditions/#time-received) | **Time received** | Weekdays and a time window | | [Is a reply](https://docs.posternmail.app/rules/conditions/#is-a-reply) | **Is a reply** | **Is a reply** or **Is not a reply** | | [Sent automatically](https://docs.posternmail.app/rules/conditions/#sent-automatically) | **Sent automatically** | **Sent automatically (newsletters, notifications)** or **Sent by a person** | All text comparisons ignore upper and lower case. ### Address Compares the addresses in one part of the message. | Part | In the editor | Which addresses | |---|---|---| | `from` | **From** | The sender | | `to` | **To** | Every address in To | | `cc` | **Cc** | Every address in Cc | | `reply_to` | **Reply-To** | Every address in Reply-To | | `any_recipient` | **To or Cc** | Every address in To and Cc together. Bcc is not visible in received mail. | | Operator | In the editor | Matches when | |---|---|---| | `contains` | **contains** | One of the addresses contains the text, in the address **or** in the display name. `acme` matches `Acme Billing `. | | `not_contains` | **doesn't contain** | **None** of the addresses contains the text, in address or name. A part with no addresses (an empty Cc) matches. | | `equals` | **is** | One of the addresses is exactly the text, for example `billing@acme.com`. The display name is not compared. | | `domain` | **is at domain** | One of the addresses is at this domain **or one of its subdomains**. `acme.com` matches `a@acme.com` and `a@mail.acme.com`, not `a@notacme.com`. A leading `@` is ignored, so `@acme.com` works too. | | `regex` | **matches pattern** | The [pattern](https://docs.posternmail.app/rules/conditions/#patterns) matches either `Name
` or the bare address. | Addresses are compared as written in the message. A `+tag` is part of the address here: **is** `you@example.com` does not match `you+shop@example.com`, but **contains** `you` does. ### Text | Part | In the editor | What is compared | |---|---|---| | `subject` | **Subject** | The subject line | | `body` | **Message text** | The plain-text part of the message. A message that only has HTML is converted to text first. | | `attachment_name` | **Attachment name** | The file name of each attachment. Inline images without a name are not counted. | | Operator | In the editor | Matches when | |---|---|---| | `contains` | **contains** | The text appears anywhere | | `not_contains` | **doesn't contain** | The text appears nowhere. For **Attachment name**: no attachment name contains it, which includes messages without attachments. | | `equals` | **is** | The whole value is exactly the text (spaces at the ends ignored) | | `starts_with` | **starts with** | The value starts with the text (spaces and line breaks at the start ignored) | | `ends_with` | **ends with** | The value ends with the text (spaces and line breaks at the end ignored) | | `regex` | **matches pattern** | The [pattern](https://docs.posternmail.app/rules/conditions/#patterns) matches somewhere in the value | For **Attachment name**, the condition matches when **one** of the attachments matches (except **doesn't contain**, see above). ### Header Compares any header of the message, such as `List-Id`, `X-Spam-Flag` or `Authentication-Results`. The editor suggests `List-Id`, `List-Unsubscribe`, `Auto-Submitted`, `Precedence`, `X-Spam-Flag`, `X-Mailer` and `Authentication-Results`, but you can type any name. The name is not case sensitive (`list-id` is the same as `List-Id`) and is written without the colon. It may contain printable ASCII characters except `:`. | Operator | In the editor | Matches when | |---|---|---| | `exists` | **is present** | The message has this header (no value needed) | | `not_exists` | **is missing** | The message does not have this header | | `contains` | **contains** | A value of the header contains the text | | `equals` | **is** | A value of the header is exactly the text (spaces at the ends ignored) | | `regex` | **matches pattern** | The [pattern](https://docs.posternmail.app/rules/conditions/#patterns) matches somewhere in a value | A header that appears several times (like `Received`) matches when one of its values matches. `From`, `To`, `Cc`, `Reply-To`, `Subject` and `In-Reply-To` can always be used, even when the stored copy of the message has no header block; the address headers are then compared in the form `Name
`, several addresses separated by `, `. #### Conditions that need the message text The Hub keeps a few headers of every message without downloading its body: `From`, `To`, `Cc`, `Reply-To`, `Subject`, `Message-Id`, `In-Reply-To`, `References`, `List-Id`, `List-Unsubscribe`, `List-Unsubscribe-Post`, `Auto-Submitted`, `Precedence`, `X-Auto-Response-Suppress` and `Authentication-Results`. Conditions on these, and on everything else on this page except the two below, are decided the moment the message arrives. These need the full message: - **Text** with **Message text** or **Attachment name** (a message without attachments is decided at once for **Attachment name**), - **Header** with any other header name. For such a rule the Hub fetches the message body in the background and decides then, usually within seconds. Rules that do not need the body are never held up by it. Two things follow: - Rules below a waiting rule also wait, but only if the waiting rule could stop them (it is Live and has **Skip the rules below this one** or a step that takes the message away). - A rule decided this late can no longer change whether you get a notification or which Inbox tab the message lands in. In the activity log, **Notify me** and **Inbox tab** steps of such a rule show **Skipped** with "Decided after the message was announced (the rule needed the message body)". Everything else runs normally. If the body cannot be fetched (the provider is down, the mailbox needs you to sign in), the Hub tries again after 30 seconds, 2, 10 and 30 minutes, 1, 3, 6, 12 and 12 hours. After 10 attempts (about two days) it gives up and writes a **Failed** entry for each waiting rule: "The message body could not be loaded: ...". ### Attachments **Has attachments** or **Has no attachments**, as your mail provider reports it. Once the body is known, a message with any attachment part counts as having attachments. ### Size **Larger than** or **Smaller than** a size in KB (1 KB = 1,024 bytes), from 1 to 1,000,000. The size is the whole message as the provider reports it, attachments included. A message of exactly the given size matches neither. ### Time received Matches messages received on certain weekdays within a time window. - **Days**: pick one or more of Sun to Sat. - **from** and **to**: times in 24-hour `HH:MM`. Both ends are included. - If **to** is earlier than **from**, the window runs over midnight: **from** `18:00` **to** `08:00` means 18:00 to 23:59 and 00:00 to 08:00. The editor then says "Runs over midnight." - The weekday is the weekday of the moment the message arrived. With Mon to Fri and 18:00 to 08:00, a message on Saturday at 02:00 does not match, because Saturday is not picked. The time is the time your provider received the message (for example IMAP's internal date), or the message's `Date` header when the provider does not report one. **Time zone.** The times are read in the time zone set under **Settings → Rules → Limits and storage → Time zone for “Time received”**. The default, **Your Hub's time zone**, is the time zone of the machine or container the Hub runs in. > [!IMPORTANT] > The Docker Compose setup runs the Hub in UTC unless you set `TZ` in `.env`. If your windows > seem shifted by some hours, pick your time zone in the rule settings (for example > `Europe/Berlin`). A desktop or mobile app that runs rules while the Hub is away uses its own > time zone. ### Is a reply **Is a reply** matches a message that has an `In-Reply-To` header or whose subject starts with `Re:`, `AW:`, `SV:`, `Antw:` or `WG:` (any case, spaces before the colon allowed). **Is not a reply** matches all others. ### Sent automatically **Sent automatically (newsletters, notifications)** matches a message with at least one of: - an `Auto-Submitted` header with any value other than `no` (out-of-office and other automatic replies, mail sent by programs), - a `List-Id` header (mailing lists), - a `List-Unsubscribe` header (newsletters and most marketing mail), - a `Precedence` header of `bulk`, `list` or `junk`. **Sent by a person** matches messages with none of these. All four headers are kept with every message, so this condition is decided at once. ## Patterns **matches pattern** uses regular expressions in the [RE2 syntax](https://github.com/google/re2/wiki/Syntax), the syntax of Go. They are always case insensitive and run in linear time, so a pattern cannot slow the Hub down. - A pattern matches anywhere in the value. Use `^` and `$` to match the start and end: `^invoice` versus `invoice`. - Alternatives: `invoice|receipt`. Character classes: `[0-9]{6}`. Escape dots: `acme\.com`. - Look-ahead and look-behind (`(?=...)`, `(?<=...)`) and back-references (`\1`) are not supported. The Hub checks the pattern when you save. An invalid one is refused with "Not a valid regular expression:" and the reason, for example `missing closing )`. The editor also marks a pattern it cannot read with "This pattern isn't valid." before you save. | Goal | Condition | |---|---| | Any sender at a company and its subdomains | Address, From, is at domain, `acme.com` | | Invoices with a number in the subject | Text, Subject, matches pattern, `invoice\s*#?\d+` | | PDF attachments | Text, Attachment name, ends with, `.pdf` | | Mail flagged as spam by your provider | Header, `X-Spam-Flag`, is, `YES` | | Mail that failed DMARC | Header, `Authentication-Results`, contains, `dmarc=fail` | | Mail outside working hours | Time received, Mon to Fri, from `18:00` to `08:00` | | Newsletters | Sent automatically, Sent automatically (newsletters, notifications) | ## Messages from the editor | Message | Meaning | |---|---| | Enter something to look for. | A text value is empty. | | Use at most 500 characters. | A text value is too long. | | This pattern isn't valid. | The pattern cannot be read. | | Enter a header name. | A header condition without a name. | | Enter a size between 1 and 1,000,000 KB. | The size is out of range. | | Pick at least one day. | A time condition without weekdays. | | Enter a time. | A time is missing. | | Add a condition, or a search under Advanced. | The rule has neither. | | Use at most 20 conditions. / Use at most 20 exceptions. | Too many rows. | | This needs the message text, so the rule may run a little later. | A hint, not an error: see [above](https://docs.posternmail.app/rules/conditions/#conditions-that-need-the-message-text). | --- # Steps > Every rule step, what it does on Gmail, Microsoft, IMAP and JMAP, its fields and limits, which steps can be combined, and the risks of the steps that send or remove mail. Source: https://docs.posternmail.app/rules/steps/ Steps are what a rule does with a message that matches. This page lists every step in the **Then** menu of the rule editor, what it does at your mail provider and what to watch out for. ## How steps work together - Steps run in the order shown in the editor, with one exception: the step that takes the message out of its folder runs last, wherever it is in the list. - A rule can have **only one** step that takes the message away: **Redirect**, **Capture**, **Delete**, or a move (**Archive**, **Move to folder**, **Move to Spam**, and **Move to Trash** in older rules). The menu marks such a step **Only one** once the rule has one. If you try to save two, the Hub refuses: "A rule can contain only one of Redirect, Capture, Delete or a move (Archive, Trash, Spam, Move to folder)". - **Mark as read** and **Mark as unread** cannot be in the same rule, nor can **Star** and **Remove star**. The menu shows **Conflicts** next to the other one. - **Tag**, **Copy to folder**, **Forward** and **Call a web address** can be added several times. Every other step once. - A rule can have up to 10 of the newer steps (everything except Archive, Move to folder, Move to Spam, Move to Trash, Mark as read, Star, Tag, Inbox tab and Notify me). Within that, the editor allows 20 rows in all. - Steps that are not filled in yet (an empty address, no folder picked) are left out of **Test against recent mail** until you fill them in. ### Which steps run where All steps run on the Hub. When the Hub has been unreachable for more than two minutes, a desktop or mobile app runs the rules itself, but only these steps: **Archive**, **Move to folder**, **Move to Spam**, **Move to Trash**, **Delete** to Trash, **Mark as read**, **Mark as unread**, **Star**, **Remove star**, **Tag**, **Inbox tab** and **Notify me**. The others (Redirect, Forward, Reply automatically, Capture, Copy to folder, Delete for good, Call a web address, Send a notification) run only on the Hub, which handles the message when it is back. ### Steps on mail you already have **Save and apply to mail I already have** runs only Tag, Mark as read, Star, Archive, Move to folder, Move to Spam and Move to Trash. See [Apply a rule to mail you already have](https://docs.posternmail.app/rules/). ## The step menu | Group | Step | Hint in the menu | Sends mail | Removes the message | |---|---|---|---|---| | Move or remove | [Archive](https://docs.posternmail.app/rules/steps/#archive) | Skip the Inbox. | | Out of the Inbox | | | [Move to folder](https://docs.posternmail.app/rules/steps/#move-to-folder) | | | Out of its folder | | | [Copy to folder](https://docs.posternmail.app/rules/steps/#copy-to-folder) | | | | | | [Move to Spam](https://docs.posternmail.app/rules/steps/#move-to-spam) | | | Out of its folder | | | [Delete](https://docs.posternmail.app/rules/steps/#delete) | Move to Trash, or delete for good. | | To Trash, or for good | | | [Capture](https://docs.posternmail.app/rules/steps/#capture) | Keep a copy on your Hub and take it out of the mailbox. | | For good (copy on the Hub) | | Mark | [Mark as read](https://docs.posternmail.app/rules/steps/#mark-as-read-and-mark-as-unread) | | | | | | [Mark as unread](https://docs.posternmail.app/rules/steps/#mark-as-read-and-mark-as-unread) | | | | | | [Star](https://docs.posternmail.app/rules/steps/#star-and-remove-star) | | | | | | [Remove star](https://docs.posternmail.app/rules/steps/#star-and-remove-star) | | | | | | [Tag](https://docs.posternmail.app/rules/steps/#tag) | | | | | | [Inbox tab](https://docs.posternmail.app/rules/steps/#inbox-tab) | Put it in an Inbox tab. | | | | Tell me or another service | [Notify me](https://docs.posternmail.app/rules/steps/#notify-me) | Always or never notify for this mail. | | | | | [Send a notification](https://docs.posternmail.app/rules/steps/#send-a-notification) | A notification with your own text. | | | | | [Call a web address](https://docs.posternmail.app/rules/steps/#call-a-web-address) | Tell another service that mail arrived. | | | | Send mail | [Redirect](https://docs.posternmail.app/rules/steps/#redirect) | Send it on unchanged, then take it out of the mailbox. | Yes | For good (copy on the Hub) | | | [Forward](https://docs.posternmail.app/rules/steps/#forward) | Send a copy to someone else. | Yes | | | | [Reply automatically](https://docs.posternmail.app/rules/steps/#reply-automatically) | Answer the sender with a fixed text. | Yes | | The steps under **Send mail** carry a **Sends mail** label in the editor. A new rule with one of them starts in [Test mode](https://docs.posternmail.app/rules/test-mode/). ## Move or remove ### Archive Takes the message out of the Inbox. | Provider | What happens | |---|---| | Gmail | The **Inbox** label is removed. The message stays in **All Mail** and under its other labels. | | Microsoft | The message is moved to the **Archive** folder. | | IMAP | The message is moved to the archive folder. If the server marks none, a folder named `Archive` is used. On Gmail over IMAP, the Inbox label is removed. | | JMAP | The message is put in the archive mailbox (created as `Archive` if there is none) and taken out of the Inbox. | ### Move to folder Moves the message to a folder you pick. The picker shows your own folders and the archive folder of the mailboxes the rule watches. A folder belongs to one mailbox. For a message in another mailbox the move fails with "Moving mail to a folder of a different mailbox isn't supported yet. Pick a folder in the mailbox the conversation belongs to." So for a move, limit the rule to the folder's mailbox under **In mailboxes**, and make one rule per mailbox if you need more. | Provider | What happens | |---|---| | Gmail | The folder is a label: the label is added and the **Inbox** label (or the label the message came from) is removed. | | Microsoft, IMAP | The message is moved to the folder. | | JMAP | The message is moved to the mailbox. | ### Copy to folder Puts a copy of the message in another folder and leaves the original where it is. You can add this step several times. Runs only on the Hub. | Provider | What happens | |---|---| | Gmail | The folder's label is added. Gmail keeps one message with two labels, not two copies. | | JMAP | The message is added to the second mailbox. JMAP keeps one message in two mailboxes. | | Microsoft, IMAP | A copy is uploaded to the folder with the same read and star state and the same date. These are two separate messages from then on. | A failed copy appears in the [sending queue](https://docs.posternmail.app/rules/sending-queue/) with **Cancel copy**. The activity log has no **Undo** for a copy. ### Move to Spam Moves the message to the spam folder. | Provider | What happens | |---|---| | Gmail | The **Spam** label is added; **Inbox** and **Trash** are removed. | | Microsoft | The message is moved to **Junk Email**. | | IMAP | The message gets the `$Junk` keyword where the server allows it and is moved to the junk folder (`Junk` if the server marks none). | | JMAP | The message is moved to the junk mailbox and gets the `$junk` keyword. | ### Delete Without options, moves the message to Trash. With **Delete for good instead of moving to Trash** ticked, the message is deleted permanently at the provider. **To Trash**: Gmail adds the **Trash** label; Microsoft moves to **Deleted Items**; IMAP moves to the trash folder (`Trash` if the server marks none); JMAP moves to the trash mailbox. Your provider empties Trash on its own schedule (Gmail after 30 days). **For good**: the editor shows "Your Hub keeps a copy for {n} days, so you can still get it back." The Hub first stores an encrypted copy of the message, reads it back and checks it, and only then deletes the message at the provider. You find the copy in [Captured mail](https://docs.posternmail.app/rules/captured-mail/) under **Deleted for good** until it expires (30 days by default, see [Limits and storage](https://docs.posternmail.app/rules/limits/#limits-and-storage-settings)). Runs only on the Hub. | Provider | How "for good" deletes | |---|---| | Gmail | Permanent delete through the Gmail API. The message does not go to Trash. | | Microsoft | Permanent delete through Microsoft Graph. It does not go to **Deleted Items**. | | IMAP | The message is flagged deleted and expunged. On Gmail over IMAP it is first moved to Trash, then expunged there, because Gmail would otherwise only remove a label. | | JMAP | The message is destroyed. | > [!WARNING] > After the Hub's copy has expired, a message deleted for good cannot be recovered by Postern. > Whether your provider can still restore it depends on the provider. ### Capture Keeps the message on your Hub and takes it out of the mailbox. Use it for mail you want to keep but not have in your mail account, for example to stay under a storage quota. Runs only on the Hub. The Hub stores an encrypted copy, checks it, then deletes the message at the provider in the same permanent way as **Delete for good**. Unlike a deleted message, a captured message is kept until you delete it yourself under [Captured mail](https://docs.posternmail.app/rules/captured-mail/). The activity log shows "Capture (keep on the Hub)". > [!NOTE] > A captured message is gone from all your apps and from the provider's web mail. It exists > only on your Hub. Include the Hub's data in your [backups](https://docs.posternmail.app/admin/backups/). ## Mark ### Mark as read and Mark as unread Set the message's read state. Gmail removes or adds the `UNREAD` label, Microsoft sets `isRead`, IMAP sets or clears `\Seen`, JMAP sets or clears `$seen`. ### Star and Remove star Set or clear the star. Gmail uses the **Starred** label, Microsoft the flag, IMAP `\Flagged` and JMAP `$flagged`. ### Tag Adds one of your [tags](https://docs.posternmail.app/using/tags/). Add the step several times for several tags. How the tag is stored at the provider: | Provider | Stored as | |---|---| | Gmail | A Gmail label with the tag's name, created when it is first needed | | Microsoft | An Outlook category | | IMAP | A keyword on the message, if the server allows keywords | | JMAP | A keyword on the message | ### Inbox tab Puts the message in one of the Inbox tabs: **People**, **Notifications** or **Newsletters**, whatever tab Postern would have picked on its own. See [The inbox](https://docs.posternmail.app/using/inbox/). Like **Notify me**, it is decided before your devices are told about the message. ## Tell me or another service ### Notify me **Always** or **Never** notify for this mail. **Always** asks your devices to notify for it, **Never** keeps it quiet. Without this step, mail that a rule archives, moves to Spam or Trash, or takes out of the mailbox does not notify. See [Notifications](https://docs.posternmail.app/using/notifications/). This step decides before your devices are told about the message. A rule that needed the message text (see [Conditions](https://docs.posternmail.app/rules/conditions/#conditions-that-need-the-message-text)) is decided too late for it, and the activity log shows it as **Skipped**. ### Send a notification Sends a notification of its own to your devices, independent of the normal new-mail notification. Runs only on the Hub. | Field | Meaning | |---|---| | Text (placeholder "Same as for new mail") | Optional, up to 500 characters. With a text, the notification's title is your text and its body "From" and the sender's address. Empty, it looks like a new-mail notification: sender as title, the start of the message as body. | | **Also send it to your alert channels** | Also posts to your ntfy, Discord or Gotify channel. The text there reads `Rule “Invoices”: your text`, or `Rule “Invoices”: “subject” from sender@example.com` without a text. Set the channels up under [Alerts](https://docs.posternmail.app/rules/alerts/). | ### Call a web address Sends a JSON message to a web address you choose (a webhook). The editor says "Gets the rule name, mailbox, sender and subject. Never the message text." Runs only on the Hub. The web address must start with `http://` or `https://`, be at most 2,000 characters, and point to a public address unless your admin allows local ones. See [Webhooks](https://docs.posternmail.app/rules/webhooks/) for the payload, retries and security. ## Send mail All three steps send from the mailbox the message arrived in, through that mailbox's provider. They run only on the Hub, go through the [sending queue](https://docs.posternmail.app/rules/sending-queue/), count toward the [daily limits](https://docs.posternmail.app/rules/limits/) and are checked by the [loop guards](https://docs.posternmail.app/rules/limits/#loop-guards). Every message a rule sends carries headers that mark it as automatic: `Auto-Submitted`, plus `X-Postern-Id` and `X-Postern-Rule`. ### Recipients **Redirect** and **Forward** take one to five addresses, separated by commas. Addresses are stored in lower case. Saving is refused if one of them is an address of the mailbox itself (its address or one of its aliases), because the message would come back and match the rule again. The comparison ignores case, `+tag` parts, dots in Gmail addresses and treats `googlemail.com` as `gmail.com`. The error reads, for example: "steps.0.to: you@example.com is this mailbox's own address, so the message would come back and match again". ### Redirect Sends the message on unchanged, then takes it out of the mailbox. Use it to hand mail over to another address, for example a shared support inbox. | Field | Meaning | |---|---| | **Redirect to** | One to five addresses | | **Put before the subject** | A text placed before the subject, `[REDIR]` by default, up to 50 characters. Empty (placeholder "Nothing") leaves the subject as it is. Not added twice if the subject already starts with it. | What the recipient gets: - **From** is your mailbox's address (its default sender), because providers do not let you send in someone else's name. **Reply-To** is the original Reply-To or, without one, the original sender, so a reply goes to the original sender. - **To** is the redirect address. The original Cc and Bcc are not sent along. - The message body and attachments are byte for byte the original. The original `Date` is kept. - Headers tied to the original delivery are dropped: `Received`, DKIM and ARC signatures, `Authentication-Results`, `Return-Path`, `Delivered-To`, `Resent-*` and similar. `X-Postern-Original-Message-Id` holds the original Message-ID. The order of events: the Hub stores an encrypted copy and checks it, deletes the message at the provider (permanently, as with **Delete for good**), then sends. After the send it removes the copy of the redirect that the provider put in your Sent folder, so your Sent folder does not fill up with redirects. The Hub's copy stays in [Captured mail](https://docs.posternmail.app/rules/captured-mail/) under **Redirected** for 30 days by default. > [!WARNING] > A redirect removes the message from your mailbox. If the target address is wrong, the message > is still on your Hub: use **Restore to mailbox** in the sending queue or **Undo** in the > activity log. A redirect that was already delivered cannot be called back. ### Forward Sends a copy of the message to other addresses. The original stays in your mailbox. | Field | Meaning | |---|---| | **Forward to** | One to five addresses | | **Note above the forwarded message (optional)** | Up to 5,000 characters, placed above the forwarded message | | **Forward as an attachment** | Attach the original as an `.eml` file instead of quoting it | | **Keep a copy in Sent** | On by default. Off, the Hub removes the forward from your Sent folder after sending. | A normal forward has the subject `Fwd: ` plus the original subject (unless it already starts with `Fwd:` or `FW:`), your note, a "---------- Forwarded message ---------" block with From, Date, Subject, To and Cc, the original text and HTML, and the original attachments. As an attachment, the text is your note or "Forwarded message attached." and the original is attached whole. ### Reply automatically Answers the sender with a fixed text, for example while you are away. | Field | Meaning | |---|---| | **Reply text** | The reply, 1 to 10,000 characters, plain text. No signature is added. | | **Keep a copy in Sent** | On by default. Off, the Hub removes the reply from your Sent folder after sending. | The editor says "Sent at most once a day to each sender, and never to newsletters or no-reply addresses." In detail, no reply is sent: | Activity detail | When | |---|---| | No automatic reply to mail sent from this mailbox | The message came from your own mailbox | | The message has no sender to reply to | No From or Reply-To address | | No automatic reply to automated mail or mailing lists | `Auto-Submitted` other than `no`, any `List-*` header, `Precedence: bulk`, `list` or `junk`, or `X-Auto-Response-Suppress` asking for no replies | | No automatic reply to a no-reply address | Addresses such as `noreply@`, `no-reply@`, `do-not-reply@`, `mailer-daemon@`, `postmaster@`, `bounce@`, `listserv@`, `majordomo@`, `owner-...@`, `...-request@`, `...-bounces@` | | Loop guard: the sender is this mailbox | The reply would go to the mailbox itself | | Already replied to sender@example.com in the last 24 hours | An automatic reply from this mailbox already went to this sender in the last 24 hours (from any rule) | | No automatic reply to a delivery report | The full message turns out to be a bounce | The reply goes to the original Reply-To, or the sender without one. The subject is `Re: ` plus the original subject; `In-Reply-To` and `References` make it part of the conversation. It also carries `Auto-Submitted: auto-replied` and `X-Auto-Response-Suppress: All`, so other auto-responders do not answer it. ## Risks at a glance | Step | What can go wrong | What protects you | |---|---|---| | Redirect | A wrong address gets your mail; the message leaves your mailbox | Test mode for new rules, own-address check, encrypted copy, **Restore to mailbox**, **Undo** | | Forward | A wrong address gets a copy; a loop between two mailboxes | Test mode, loop guards, daily limits, burst pause | | Reply automatically | Answering newsletters, bots or a loop with another auto-responder | No replies to automated mail and no-reply addresses, once a day per sender, loop guards | | Delete for good, Capture | A too broad rule removes mail you wanted | Encrypted copy on the Hub, **Undo**, [Captured mail](https://docs.posternmail.app/rules/captured-mail/) | | Call a web address | The service receives sender and subject | Only public addresses by default; no message text is sent | Before you switch a rule that sends or removes mail to Live, run it in [Test mode](https://docs.posternmail.app/rules/test-mode/) for a few days. --- # Test mode > How Test mode works, what "Test against recent mail" shows, why rules that send mail start in Test, and how to switch a rule to Live safely. Source: https://docs.posternmail.app/rules/test-mode/ Test mode lets you watch a rule on real new mail before it changes anything. This page explains the two ways to try a rule (Test mode and **Test against recent mail**) and how to move a rule to Live. | | Test mode | Test against recent mail | |---|---|---| | Where | **Mode** switch in the rule editor | Panel on the right of the rule editor | | Which mail | New mail, from now on, for as long as the rule stays in Test | The newest 50 messages you already have in the rule's mailboxes | | Result | Entries in **Rule activity** with the outcome **Simulated** | A count and a list in the editor, right away | | Changes anything | No | No | | Writes to the activity log | Yes | No | ## Test mode Every rule has a **Mode**: **Live** or **Test**. Under the switch the editor explains it: - **Live**: "Steps run on new mail." - **Test**: "Nothing is changed or sent. Each step is written to the activity log as simulated." A rule in Test mode is checked against every new message like a live rule. When it matches, each of its steps is written to **Settings → Rule activity** with the outcome **Simulated** and the same summary a live step would have, for example "Redirect to helpdesk@example.com". Nothing happens to the message: no move, no tag, no mail sent, no web address called. The rule list shows a **Test** label next to the rule, and its match counter ("matched 3 times") counts in Test mode too. A rule in Test mode never stops later rules. **Skip the rules below this one** only takes effect in Live, and the editor says "While the rule is in Test, the rules below still run." ### Rules that send mail start in Test A rule with **Redirect**, **Forward** or **Reply automatically** is put in Test mode when you create it, unless you picked a mode yourself. The editor says "This rule sends mail, so it starts in Test. Check the activity log for a few days, then switch it to Live." The same happens when you add the first sending step to an existing live rule: the editor switches the rule to Test, unless you set the mode by hand. The Hub enforces this as well: a rule created without a mode, or changed to contain its first sending step without a mode, is stored in Test. If you switch a sending rule to Live, the editor warns "This rule sends mail as soon as you save it." ### What a simulated entry does not tell you A simulated step shows what the rule **would** do. Some checks happen only when a step really runs, so a step that shows **Simulated** in Test can still be skipped or fail in Live: - the [loop guards](https://docs.posternmail.app/rules/limits/#loop-guards) (mail sent by a rule, automatic mail, bounces), - the checks of **Reply automatically** (newsletters, no-reply addresses, once a day per sender), - the [daily limits and the burst pause](https://docs.posternmail.app/rules/limits/), - errors from your provider (a refused recipient, a mailbox that needs you to sign in). If a live rule above this one takes the message away (redirect, capture, delete), the test rule's entries show **Skipped** with "The message was already removed by another rule", as they would in Live. ## Test against recent mail The panel on the right of the rule editor runs the rule against your recent mail while you edit it. It updates a moment after each change. - It takes the newest 50 messages in the mailboxes the rule watches. - It shows how many match: "4 of your last 50 messages match. Nothing was changed." - Under the count it lists the matching messages with sender, date, subject and what the rule would do to each. **Show all 50 messages** adds the ones that do not match (marked **No match**); **Show only matches** goes back. - A step that the rule could not run shows **skipped** with the reason. Nothing is changed, sent or logged. The panel also works for a rule in Live mode. ### Messages in the panel | Message | Meaning | |---|---| | Add a condition to see which of your recent messages it catches. Nothing is changed. | The rule has no condition and no search yet. | | Checking your recent mail… | The test is running. | | 2 messages need their text to decide, which didn't load in time. | The rule needs the message text (see [Conditions](https://docs.posternmail.app/rules/conditions/#conditions-that-need-the-message-text)). The Hub fetches bodies for up to 15 seconds. Messages it could not fetch in time show **Can't tell yet**. | | Fix the marked field to see what the rule catches. | The Hub refused a value, for example an invalid pattern. The field is marked in red. | | The test didn't run. Try again. | Another error, for example the Hub was unreachable. | | 12 conversations match. | A rule that uses only a search and no conditions. The count is of conversations, from the search. | Steps you have not filled in yet are left out of the test until they are complete. ## Switch a rule to Live Do this once the activity log shows that the rule catches the right mail and nothing else. 1. Open **Settings → Rule activity**, choose the rule in the rule filter and look at the **Simulated** entries of the last days. Check every sender and subject: would you really want the step to run on this message? 2. Look for mail the rule should have caught but did not. Search for it and compare it with the conditions in **Test against recent mail**. 3. For a redirect or forward, check the target address once more, letter by letter. 4. Open the rule in **Settings → Rules**, set **Mode** to **Live** and choose **Save**. > **Check:** the next matching message produces entries with the outcome **Done** in **Rule > activity**. For a sending rule, the message appears in **Settings → Sending queue** as > **Sent**, and the recipient receives it. > **If it did not work:** an entry with **Skipped** or **Failed** gives the reason in its detail > line. See [Limits and guards](https://docs.posternmail.app/rules/limits/) for skipped sends and the > [Sending queue](https://docs.posternmail.app/rules/sending-queue/) for mail that waits. To go back, set **Mode** to **Test** > again: this takes effect for the next message. > [!TIP] > To try a sending rule end to end without risk, create a second rule like it that watches only > a test mailbox and redirects or forwards to an address of your own in another mailbox. --- # Activity and undo > The rule activity log, what each entry and outcome means, the detail messages, how long entries are kept, and what Undo can and cannot reverse. Source: https://docs.posternmail.app/rules/activity/ The activity log shows what your rules did to new mail, one entry per step, and lets you undo many of those steps. Open it under **Settings → Rule activity**. The page says "What your rules did to new mail, newest first. Rules in Test show what they would have done." ## What an entry shows Each step of a matching rule writes one entry. A rule that tags and archives a message writes two. | Part | Example | Meaning | |---|---|---| | Summary | Redirect to helpdesk@example.com | What the step does | | Outcome | **Done** | See the table below | | **Test** label | **Test** | The rule was in Test mode and the step was skipped or failed (simulated entries need no label) | | Subject and sender | Invoice 1042, from billing@acme.com · Receipts from Acme | The message and the rule's name | | Detail | Queued (rob_...) | Extra information or the reason for a skip or failure | | Time | 09:14 | When the entry was written. Hover for the full date. | | **Undo** | | Shown when the step can be reversed. See [Undo](https://docs.posternmail.app/rules/activity/#undo). | | Outcome | Meaning | |---|---| | **Done** | The step ran, or was handed to the sending queue or the job worker. | | **Simulated** | The rule is in [Test mode](https://docs.posternmail.app/rules/test-mode/). Nothing was changed. | | **Skipped** | The step did not run, on purpose. The detail says why. | | **Failed** | The step was tried and did not work. The detail says why. | Use the **Rule** menu (**All rules** or one rule) and the outcome buttons **Done**, **Simulated**, **Skipped** and **Failed** to filter. Without a button pressed, all outcomes are shown. The page loads 50 entries at a time; **Show older** loads more. Rules that run in a desktop or mobile app while the Hub is away (see [Rules](https://docs.posternmail.app/rules/)) do not write to the activity log. ## Summaries | Step | Summary in the log | |---|---| | Archive | Archive | | Move to folder | Move to folder | | Move to Spam | Move to Spam | | Move to Trash, Delete | Move to Trash | | Delete for good | Delete permanently | | Capture | Capture (keep on the Hub) | | Copy to folder | Copy to folder | | Mark as read, Mark as unread | Mark as read, Mark as unread | | Star, Remove star | Flag, Clear flag | | Tag | Add tag, followed by the tag's internal ID | | Inbox tab | Set category people, notifications or newsletters | | Notify me | Always notify, Don't notify | | Send a notification | Send notification | | Call a web address | Call webhook, with the host name | | Redirect | Redirect to, with the addresses | | Forward | Forward to (or Forward (as attachment) to), with the addresses | | Reply automatically | Send automatic reply | ## Detail messages | Detail | Outcome | Meaning | |---|---|---| | Queued (rob_...) | Done | The mail was handed to the [sending queue](https://docs.posternmail.app/rules/sending-queue/). The ID is the queue item's. | | Sent to helpdesk@example.com | Done | The queue item was sent. | | Delivered (HTTP 200) | Done | The web address answered with this status. See [Webhooks](https://docs.posternmail.app/rules/webhooks/). | | Already in Trash | Done | The message was in Trash already. | | Another rule moved the message | Skipped | Several rules wanted to move the message; another one won. See [Order of evaluation](https://docs.posternmail.app/rules/). | | The message was already removed by another rule | Skipped | A rule above took the message away (redirect, capture, delete). | | Decided after the message was announced (the rule needed the message body) | Skipped | A **Notify me** or **Inbox tab** step of a rule that needed the message text. See [Conditions](https://docs.posternmail.app/rules/conditions/#conditions-that-need-the-message-text). | | Not available yet | Skipped | This Hub version cannot run the step. | | Loop guard: ... | Skipped or Failed | A loop guard stopped a send. See [Limits and guards](https://docs.posternmail.app/rules/limits/#loop-guards). | | No automatic reply to ... | Skipped | **Reply automatically** did not answer. See [Steps](https://docs.posternmail.app/rules/steps/#reply-automatically). | | Already replied to sender@example.com in the last 24 hours | Skipped | The once-a-day limit of automatic replies. | | Webhook failed: ... | Failed | The web address could not be reached after all retries, or refused the call. | | The message body could not be loaded: ... | Failed | The rule needed the message text and the Hub could not fetch it in about two days. The summary of this entry is "Check the rule's conditions". | Entries for mail in the sending queue are updated as the item moves on. An item that waits for you shows its error in the [sending queue](https://docs.posternmail.app/rules/sending-queue/). ## How long entries are kept Entries are kept for 90 days by default and then deleted, once an hour. Change this under **Settings → Rules → Limits and storage → Keep the activity log for … days** (1 to 3,650 days). See [Limits and storage](https://docs.posternmail.app/rules/limits/#limits-and-storage-settings). ## Undo **Undo** reverses one step for one message. It appears only on entries with the outcome **Done** that can be reversed and were not undone yet. After an undo the entry says "Undone" with the time, and a message confirms it: "Undone: Archive". | Step | What Undo does | When Undo is offered | |---|---|---| | Tag | Removes the tag | Only if the message did not have the tag before | | Mark as read | Marks the message unread | Only if it was unread before | | Mark as unread | Marks it read | Only if it was read before | | Star | Removes the star | Only if it had no star before | | Remove star | Stars it again | Only if it had a star before | | Archive, Move to folder, Move to Trash, Delete to Trash | Moves the message back to where it was: the Inbox, Spam, or the folder it was in | When the rule's move ran | | Move to Spam | Marks it as not spam, which moves it back to the Inbox | When the rule's move ran | | Redirect, Capture, Delete for good | Cancels the action if it has not happened yet. Otherwise puts the kept copy back into the mailbox, in its original folder, with its read and star state and its date. | While the Hub still has the action or its copy | No undo for **Inbox tab**, **Notify me**, **Forward**, **Reply automatically**, **Copy to folder**, **Call a web address** and **Send a notification**: what they did cannot be taken back. A forward or automatic reply that is still waiting in the sending queue can be cancelled there with **Restore to mailbox**. > [!IMPORTANT] > Undo on a redirect puts the message back into your mailbox. If the redirect was already sent, > the recipient still has it: mail cannot be called back. If a redirect's queue item has already been cleaned up (30 days after it finished), Undo uses the copy in [Captured mail](https://docs.posternmail.app/rules/captured-mail/), as long as that copy is still kept. ### When Undo does not work | Message | Meaning | What to do | |---|---|---| | This can't be undone any more. The message was probably moved or deleted since. | The message is no longer where the rule put it, or the kept copy is gone. The **Undo** button disappears. | Find the message with the search, or in [Captured mail](https://docs.posternmail.app/rules/captured-mail/). | | Your mail provider refused the change, so nothing was undone. Try again in a few minutes. | The provider returned an error. | Try again later. If it keeps failing, check whether the mailbox needs you to sign in again. | | This entry isn't in the activity log any more. | The entry was deleted because it was older than the retention period. | | | Your Hub can't undo this yet. | The Hub is older than the app. | Upgrade the Hub. | | That wasn't undone. Try again. | Another error, for example the Hub was unreachable. | Try again. | --- # Sending queue > The sending queue for rule mail, its stages and statuses, retries, unconfirmed sends, bounces, and the actions Retry, Change recipient, Restore to mailbox and Download .eml. Source: https://docs.posternmail.app/rules/sending-queue/ The sending queue shows every message your rules send (redirects, forwards, automatic replies) and where each one is. A message that cannot be sent waits here for you; it is never dropped. Open it under **Settings → Sending queue**. When something needs you, the sidebar shows **Rule mail needs you** with a count. ![The sending queue with a redirect that needs attention and the actions Retry, Change recipient and Restore to mailbox](https://posternmail.app/img/queue.webp) ## What is listed | Item | Listed | |---|---| | Redirect, Forward, Automatic reply | Always, from the moment the rule matched | | Capture, Permanent delete, Copy | Only while they need you. Normally these finish in seconds and never show up. | Each item shows the subject, its status, the kind and recipients ("Redirect to helpdesk@example.com"), the mailbox, the rule, its progress, any error, and the number of tries with the time of the next one ("2 tries · next try in 5 minutes"). Use the buttons at the top to filter: **Needs you** (with a count), **Not sent yet** and **All**. Finished items are removed 30 days after they finished. ## Statuses | Status | Meaning | |---|---| | **Waiting** | Due to run, or waiting for its next try | | **Sending** | Being sent right now | | **Paused** | Held by a [daily limit or the burst pause](https://docs.posternmail.app/rules/limits/). It goes on by itself. | | **Needs you** | Stopped. The Hub will not try again until you act. | | **Sent** | Done | | **Put back** | You restored the message to the mailbox. The item is closed. | ## Stages Each item goes through fixed stages. The Hub records each stage in its database before it moves on, so after a restart (an update, a power cut) it continues exactly where it stopped and never repeats a finished stage. | Stage | Redirect | Forward | Automatic reply | Capture, Delete for good | |---|---|---|---|---| | **Copy saved**: encrypted copy stored on the Hub and checked | Yes | Yes (kept hidden, for **Restore**) | | Yes | | **Taken out of the mailbox**: deleted at the provider | Yes | | | Yes | | **Ready to send** | Yes | Yes | Yes | | | **Sent** | Yes | Yes | Yes | | | **Done**: clean-up finished | Yes | Yes | Yes | Yes | A redirect removes the original before it sends. If the send then fails, the message is still safe on your Hub: you can send it again, send it elsewhere, or put it back. After a redirect is sent, the Hub removes the copy that your provider put into the Sent folder. For a forward or automatic reply it does this only if **Keep a copy in Sent** is off. It waits up to 10 minutes for the provider's copy to appear. On Gmail, if the message also has another label, only the **Sent** label is removed. ## Retries A send that fails with a temporary error (the server is down, a timeout, too many requests) is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. If the provider asks for a longer wait (`Retry-After`), the Hub waits longer. After the fifth retry the item goes to **Needs you** and you get an [alert](https://docs.posternmail.app/rules/alerts/). Some errors go to **Needs you** at once, without retries: | Error shown | Cause | What to do | |---|---|---| | The mailbox needs you to sign in again. | The provider no longer accepts the Hub's sign-in. | Choose **Sign in to you@example.com again**. Once the mailbox syncs again, waiting items start by themselves. | | The mail was refused. | The provider refused the message for good, for example an invalid recipient, or the provider does not support sending (a JMAP server without submission). | Read the error after the label. Fix the address with **Change recipient**, or **Restore to mailbox**. | | We could not confirm whether this was sent. Check your Sent folder or ask a recipient; Retry sends it again. | See [Unconfirmed sends](https://docs.posternmail.app/rules/sending-queue/#unconfirmed-sends). | Check, then **Retry** or leave it. | Items that wait for a sign-in start again on their own when the mailbox syncs again: the first time right away, after that no more often than 15 minutes, 1 hour, 6 hours and 24 hours apart. Other labels you can see while an item is still moving: | Error shown | Meaning | |---|---| | The mail server had a problem. It is tried again. | A temporary error. The next try is shown. | | A daily limit was reached. | **Paused** by a [daily limit](https://docs.posternmail.app/rules/limits/). | | Sending is paused because many messages went out in a short time. | **Paused** by the [burst pause](https://docs.posternmail.app/rules/limits/). | ## Unconfirmed sends A send can be interrupted after the message left the Hub but before the provider answered, for example by a restart or a lost connection. Sending again could deliver the message twice, so the Hub first finds out what happened: 1. It waits 10 minutes after the send started, so the provider has time to file the message. 2. It looks in the mailbox's Sent folder for the message, by its unique Message-ID. 3. If it finds it, the item is recorded as **Sent**. 4. If it finds nothing, it sends again with the same Message-ID. 5. If it cannot tell (the lookup keeps failing for 6 hours, or the provider cannot be searched), the item goes to **Needs you** with "We could not confirm whether this was sent". On IMAP mailboxes that are not Gmail, the Hub itself stores the copy in Sent, marked unread, just before it sends, and marks it read afterwards. An unread copy found later means the send may not have happened, so this also ends as unconfirmed rather than as sent. For an unconfirmed item: look in your Sent folder or ask the recipient. If the message did not arrive, choose **Retry**. If it did, leave the item; it does nothing further. ## Bounces For 14 days after a rule sent mail, the Hub watches the mailbox for bounces (delivery failure reports). It recognises them by the sender (`mailer-daemon`, `postmaster`), typical subjects ("Undeliverable", "Delivery Status Notification", "Mail delivery failed", "Unzustellbar" and others) or the report format, and matches them to the item by its headers. A matching bounce: - moves the item to **Needs you** with "Bounced 2 hours ago: 550 5.1.1 user unknown" (the reason from the report), - raises the alert "A rule mail bounced: ...", - moves the bounce message itself to Trash, so it does not clutter your Inbox. **Retry** on a bounced item sends it again with a new Message-ID. **Change recipient** sends it to another address. ## Actions Actions appear on items that are not **Sent** or **Put back**. While an item is **Sending**, they are disabled; if you are too quick, the Hub answers "This item is being sent right now. Try again in a moment." ### Retry Starts the item again with fresh retries, also for a **Needs you** item. The message is "Trying again shortly." Daily limits still apply. If the item finished in the meantime, the Hub answers "This message was already sent", "This action is already done" or "The message was put back into the mailbox; this item is closed". ### Change recipient For redirects and forwards. Opens a dialog **Send to** with the current addresses. Type one or more addresses separated by commas and choose **Send to this address**. The dialog says "The message is sent to the new address. The rule itself stays as it is." The message gets a new Message-ID and is sent shortly ("Recipient changed. It is sent again shortly."). An address of the mailbox itself is refused, as in the rule editor. | Message | Meaning | |---|---| | Add at least one address. | The field is empty. | | “you@example” isn't an email address. | One of the addresses is not valid. | To change the address for future mail, edit the rule. ### Restore to mailbox Puts the message back into the mailbox and does not send it. The confirmation reads "The message goes back into you@example.com and is not sent." After **Restore** you see "Put back in you@example.com." and the item shows **Put back**. - If the message was not taken out of the mailbox yet, nothing needs to be imported: the item is just cancelled. - If it was, the Hub imports its copy into the original folder (or the Inbox if that folder is gone), with the read and star state and the original date. - A forward or automatic reply that was already sent cannot be restored: "This message was already forwarded; the original is still in the mailbox" or "This automatic reply was already sent". For a **Copy** item that needs you, the button is **Cancel copy** instead: "The message is not copied. It stays where it is." ### Download .eml Downloads the message as a `.eml` file you can open in any mail program: for a send, the message exactly as it would be sent; for capture and delete, the kept original. A **Copy** item has nothing to download: "No copy of this message is kept". ## When the queue does not move | You see | Check | |---|---| | Many items **Waiting** with growing tries | The provider has a problem, or the Hub cannot reach it. See the error under the item and the Hub's logs. | | Items **Paused** | A daily limit or the burst pause. They continue by themselves. See [Limits and guards](https://docs.posternmail.app/rules/limits/). | | **Needs you** with a sign-in error | Sign the mailbox in again under **Settings → Mailboxes**. | | Nothing listed although a rule should have sent | Check **Settings → Rule activity**. The rule may be in Test mode, or a guard skipped the send. | --- # Captured mail > The mail your Hub keeps for rules (captured, redirected and deleted-for-good messages), how it is stored and encrypted, how long it is kept, and how to read, download, restore or delete it. Source: https://docs.posternmail.app/rules/captured-mail/ When a rule takes a message out of your mailbox, the Hub keeps a copy first. This page explains what is kept, how it is protected, for how long, and how you get a message back. Open the list under **Settings → Captured mail**. The page says "Mail your rules took out of a mailbox and kept on your Hub. Read it, download it, or put it back." ## What is kept, and for how long | Kind | Filter | Comes from | Kept | |---|---|---|---| | Captured | **Captured** | The [Capture](https://docs.posternmail.app/rules/steps/#capture) step | Until you delete it ("Kept until you delete it") | | Redirected | **Redirected** | The original of a [Redirect](https://docs.posternmail.app/rules/steps/#redirect) | 30 days by default ("Kept until 12 Jan") | | Deleted for good | **Deleted for good** | [Delete](https://docs.posternmail.app/rules/steps/#delete) with **Delete for good instead of moving to Trash** | 30 days by default | The originals of forwards are also kept, so a forward that has not gone out yet can be put back. They are not listed here and follow the same retention. The retention is set under **Settings → Rules → Limits and storage → Keep removed mail for … days** (1 to 3,650 days; hint: "Copies of redirected mail and mail deleted for good. Captured mail stays until you delete it."). It counts from the moment the rule's action finished. The Hub removes expired copies once an hour, but never a copy that is still needed: - the action has not finished yet (for example a redirect waiting in the sending queue), - the rule mail bounced and waits for you, - the rule mail was sent less than 14 days ago, the period in which the Hub watches for bounces, - the message is being put back right now. > [!IMPORTANT] > Captured mail exists only on your Hub. It is not in your mailbox, not in your apps and not at > your provider. Back up the Hub's data directory and its master key, or you lose it with the > Hub. See [Backups](https://docs.posternmail.app/admin/backups/). ## How copies are stored Before a rule deletes a message at the provider, the Hub: 1. downloads the complete original message (headers, text, attachments), 2. encrypts it with AES-256-GCM using your account's data key, which is itself protected by the Hub's master key, 3. writes it to a file under the Hub's data directory (`blobs/custody/`), flushes it to disk, 4. reads the file back, decrypts it and compares its SHA-256 checksum with the original, 5. only then records it as saved, and only after that deletes the message at the provider. If any of this fails, the message stays in the mailbox and the action is retried. An encrypted copy cannot be read without the master key, so copying the data directory alone does not expose your mail. See [Encryption](https://docs.posternmail.app/security/encryption/). ## The list Each entry shows the subject, the kind (**Redirected** or **Deleted for good**; captured mail has no label), **Put back** if it was restored, the sender, the mailbox, the rule, how long it is kept and when it was taken. Use **All**, **Captured**, **Redirected** and **Deleted for good** to filter. The page shows 50 entries at a time; **Show older** loads more. Choose an entry to open it. The reader shows From, To, Cc, **Received**, **Mailbox**, the attachment names and the plain text of the message. A message without a plain-text part shows "This message has no plain text. Download the .eml file to see all of it." ## Restore to mailbox **Restore to mailbox** imports the message back into the mailbox it came from: - into its original folder, or the Inbox if that folder no longer exists, - with its read, star and answered state, - with its original received date, so it sorts where it was. The button then says **Already put back**, and the entry gets the **Put back** label. If a sending queue item belongs to the message, it is closed so the message is not sent any more. | Message | Meaning | What to do | |---|---|---| | This message is being put back right now. Try again in a moment. | A restore of this message is already running (for example a double click). | Wait a moment and reload. | | The mailbox no longer exists. Download the message instead. | You removed the mailbox from Postern. | Use **Download .eml** and import the file in another mail program. | | The mailbox did not take the message back: ... | The provider refused the import. | Read the reason. Check that the mailbox is signed in and not full, then try again. | | It wasn't put back. ... | Another error. | Try again. | **Undo** in the [activity log](https://docs.posternmail.app/rules/activity/) and **Restore to mailbox** in the [sending queue](https://docs.posternmail.app/rules/sending-queue/) do the same for a single rule action. ## Download .eml **Download .eml** saves the original message as a file. Any mail program can open it, and most can import it into a mailbox. This works for every entry, also after it was put back. ## Delete **Delete** removes the Hub's copy. The confirmation reads "Delete this message for good? Your Hub's copy is removed. This can't be undone." A copy that a queued rule mail still needs cannot be deleted: "A queued rule mail still needs this copy. Restore it or let it send first." ## Disk space Captured mail takes space in the Hub's data directory, about the size of the original messages. It is kept until you delete it, so a busy **Capture** rule grows without limit. Check the size of the data volume from time to time and delete what you no longer need. Redirected and deleted mail shrinks back after the retention period. --- # Limits and guards > The daily limits and burst pause for rule mail, the loop guards that stop mail from going around in circles, bounce handling, and every setting under Limits and storage. Source: https://docs.posternmail.app/rules/limits/ Rules that send mail can go wrong at scale: a too broad rule, two mailboxes forwarding to each other, an auto-responder answering another one. This page describes the limits and checks that stop this, and the settings that control them. ## Limits and storage settings Open **Settings → Rules** and scroll to **Limits and storage**. The section says "Rules that send mail stop at these limits. The mail waits in the sending queue, and you get an alert." The settings are per user and apply to all your rules. | Setting | Default | Allowed | What it does | |---|---|---|---| | **Per rule, each day** | 100 messages | 1 to 10,000 | Most mails one rule may send in 24 hours | | **Per mailbox, each day** | 200 messages | 1 to 10,000 | Most rule mails one mailbox may send in 24 hours, all rules together | | **Pause sending after** … **a minute** | 20 | 1 to 1,000 | More than this many rule mails from one mailbox in one minute pauses that mailbox's rule mail | | **Pause for** … **minutes** | 15 | 1 to 1,440 | How long the pause lasts | | **Keep removed mail for** … **days** | 30 | 1 to 3,650 | How long the Hub keeps redirected mail and mail deleted for good. See [Captured mail](https://docs.posternmail.app/rules/captured-mail/). | | **Keep the activity log for** … **days** | 90 | 1 to 3,650 | See [Activity and undo](https://docs.posternmail.app/rules/activity/) | | **Time zone for “Time received”** | **Your Hub's time zone** | Any time zone | Used by the [Time received](https://docs.posternmail.app/rules/conditions/#time-received) condition | Change a value and choose **Save**. A value that is not a whole number of 1 or more is refused with "Use whole numbers of 1 or more." A value above the maximum is refused by the Hub, for example "limits.perRulePerDay must be between 1 and 10000". What counts as rule mail: everything sent by **Redirect**, **Forward** and **Reply automatically**. Webhooks, notifications, copies and captures do not count. ## Daily limits Both daily limits count over a rolling 24 hours, not per calendar day: a mail sent at 14:05 counts until 14:05 the next day. When a limit is reached, the next rule mail is not sent. It waits in the [sending queue](https://docs.posternmail.app/rules/sending-queue/) as **Paused** with "A daily limit was reached." and one of these details: - "The rule reached its limit of 100 mails a day" - "The mailbox reached its limit of 200 rule mails a day" You get an alert ("Rule mail is paused") the first time an item is held this way. The item goes out by itself as soon as the oldest send of the last 24 hours drops out of the window. Nothing is lost, and nothing needs you, unless you want to raise the limit. > [!TIP] > If a rule reaches its limit on an ordinary day, check it in **Rule activity** before you raise > the limit. A rule that suddenly sends many mails usually matches more than you meant. ## Burst pause If a mailbox sends more rule mails in one minute than **Pause sending after** allows, the Hub pauses all rule mail from that mailbox for **Pause for** minutes. Items wait as **Paused** with "Sending is paused because many messages went out in a short time." and the detail "Sending from this mailbox is paused until 2026-12-05T14:20:00Z (too many rule mails in a minute)". You get the alert "More than 20 rule mails in a minute: sending from this mailbox is paused for 15 minutes". After the pause, sending continues by itself. The burst pause is a brake for loops that the loop guards below do not catch, for example two systems that rewrite each other's headers. ## Loop guards Before every redirect and forward, the Hub checks the message's headers. It checks once with the headers it has stored and again with the full message just before sending. If a guard applies, the step is **Skipped** in the activity log with one of these details. The message stays where it is, and the rules after this one still run. | Detail | When | |---|---| | Loop guard: this message was sent by a rule of this Hub | The message carries this Hub's own `X-Postern-Id` header: a rule of yours sent it, and it came back. | | Loop guard: this message was already sent on by 3 other Postern rules | The message passed through three or more other Postern Hubs' rules already. | | Loop guard: automatic mail (Auto-Submitted: auto-replied) is not sent on | The message has an `Auto-Submitted` header other than `no`: an out-of-office reply, a notification from a program, another redirect. | | Loop guard: delivery reports are not sent on | A bounce: the sender is `mailer-daemon` or `postmaster`, the message is a delivery report (`multipart/report`), or it has an empty `Return-Path`. | **Reply automatically** has its own checks: no replies to automated mail, mailing lists, no-reply addresses, your own mailbox, delivery reports, and at most one reply a day per sender and mailbox. See [Steps](https://docs.posternmail.app/rules/steps/#reply-automatically). ### Your own addresses A redirect or forward to an address of the mailbox the message is in would deliver the message back to the same mailbox, where the rule would match again. The rule editor refuses to save such a step. If an address became the mailbox's own later (for example a new alias), the step fails at run time with "Loop guard: you@example.com is an address of the mailbox this message is in". The comparison ignores case and `+tag` parts. For Gmail addresses it also ignores dots in the local part and treats `googlemail.com` as `gmail.com`. So `You.Name+news@gmail.com` counts as `youname@gmail.com`. ### How rule mail is marked Every message a rule sends carries these headers, so that this Hub and others can recognise it: | Header | Value | |---|---| | `X-Postern-Id` | `/`. The hub tag is a random 12-character value created once per Hub. | | `X-Postern-Rule` | The rule's ID | | `Auto-Submitted` | `auto-forwarded` for redirects and forwards, `auto-replied` for automatic replies | | `X-Auto-Response-Suppress` | `All`, on automatic replies, so Microsoft Exchange auto-responders do not answer | Mail programs and servers that follow RFC 3834 do not send automatic replies to mail with `Auto-Submitted`, which breaks most loops on the other side as well. ## Bounces For 14 days after a rule sends mail, the Hub watches the sending mailbox for bounces. A bounce that belongs to a rule mail puts the queue item to **Needs you**, raises the alert "A rule mail bounced: ..." and moves the bounce message to Trash. See [Sending queue](https://docs.posternmail.app/rules/sending-queue/#bounces). ## What you see when a guard acts | Where | What | |---|---| | [Rule activity](https://docs.posternmail.app/rules/activity/) | Skipped entries with a "Loop guard: ..." detail | | [Sending queue](https://docs.posternmail.app/rules/sending-queue/) | **Paused** items with the limit or pause reason; **Needs you** for bounces | | **Settings → Rules** under **Needs your attention** | The alert, also sent to your [alert channels](https://docs.posternmail.app/rules/alerts/) | --- # Alerts > What raises a rule alert, where you see it, and how to send alerts to ntfy, Discord or Gotify, including servers in your own network. Source: https://docs.posternmail.app/rules/alerts/ The Hub raises an alert when rule mail needs you: sending was paused, a message could not be sent or bounced, a mailbox needs you to sign in, or a rule action failed for good. This page lists the alerts, where they show up, and how to have them sent to ntfy, Discord or Gotify. ## What raises an alert | Title | Raised when | Message, for example | |---|---|---| | Rule mail is paused | A daily limit was reached, or the burst pause started | The rule reached its limit of 100 mails a day | | | | More than 20 rule mails in a minute: sending from this mailbox is paused for 15 minutes | | Rule mail needs your attention | A queue item stopped after its retries or was refused | A rule mail needs your attention: 550 5.1.1 user unknown | | | The Hub cannot tell whether an interrupted send went out | We could not confirm whether a rule mail was sent; it waits for you. | | | A rule mail bounced | A rule mail bounced: 550 5.1.1 user unknown | | A mailbox needs you to sign in | Rule mail waits because the provider no longer accepts the sign-in | The mailbox needs to be signed in again; rule mail is waiting. | | A rule action failed | A **Call a web address** step failed after all retries | A rule's webhook could not be delivered to hooks.example.com: HTTP 500 | See [Limits and guards](https://docs.posternmail.app/rules/limits/) and [Sending queue](https://docs.posternmail.app/rules/sending-queue/) for the causes. ## Where you see alerts - **In the app**: open alerts are listed at the top of **Settings → Rules** under **Needs your attention**, with a link to the place to fix it (**Open the sending queue** or **Open mailboxes**) and **Dismiss**. - **On your devices**: each new alert sends one notification to your signed-in devices, with the alert's title and message. - **In your alert channels**: ntfy, Discord or Gotify, if you set them up below. The same problem does not raise a new alert again and again. While an alert is open, a repeat of the same condition (same kind, same mailbox, same rule; for sign-in and the burst pause, same mailbox) only counts up: the message ends in "(3 times)". Your devices and channels are told once, when the alert is created. After you **Dismiss** it, the next occurrence raises a new alert. Dismissed alerts are kept for 30 days. The list shows at most 200 alerts. ## Alert channels Set channels up under **Settings → Notifications → Alerts about rules**. The section says "Get a message elsewhere when rule mail needs you: sending was paused, a message couldn't be sent, or a mailbox needs you to sign in." You can turn on one, two or all three. The same channels also receive **Send a notification** steps that have **Also send it to your alert channels** ticked (see [Steps](https://docs.posternmail.app/rules/steps/#send-a-notification)). Tokens and webhook addresses are stored encrypted on the Hub and never shown again. A field with a saved secret says "Saved. Type to replace it."; type a new value to replace it, or choose **Remove it** and **Save** to delete it. ### ntfy [ntfy](https://ntfy.sh) delivers push messages to its phone and desktop apps. You can use the public server `ntfy.sh` or your own. 1. In the ntfy app, subscribe to a topic with a name that is hard to guess, for example `postern-alerts-7f3k9q`. On `ntfy.sh`, anyone who knows the topic name can read it. 2. In Postern, open **Settings → Notifications** and turn on **Send alerts to ntfy** under **Alerts about rules**. 3. **Server**: leave it empty for `https://ntfy.sh`, or type your own server, for example `https://ntfy.example.com`. 4. **Topic**: the topic from step 1. Up to 64 letters, digits, `-` and `_`. 5. **Access token (optional)**: only if your server needs one (an ntfy access token, `tk_...`). 6. Choose **Save**, then **Send test**. > **Check:** the ntfy app shows "Postern test" with "This channel works. Alerts about your rules > will arrive here." Postern says "Test sent to ntfy. Check that it arrived." > **If it did not work:** the message "The test didn't arrive." gives the reason. "Use up to 64 > letters, digits, - and _" means the topic has other characters. An HTTP 401 or 403 means the > server needs a token or the token has no write access to the topic. For a server in your own > network, see [Servers in your own network](https://docs.posternmail.app/rules/alerts/#servers-in-your-own-network). Alerts arrive with high priority and a warning tag; notifications from **Send a notification** steps with default priority. ### Discord 1. In Discord, open the channel's settings → **Integrations** → **Webhooks** → **New Webhook**, then **Copy Webhook URL**. 2. In Postern, turn on **Send alerts to Discord** under **Alerts about rules**. 3. Paste the address into **Webhook address**. It looks like `https://discord.com/api/webhooks/123456789012345678/abc...`. 4. Choose **Save**, then **Send test**. > **Check:** a message from "Postern" with the title "Postern test" appears in the channel. > **If it did not work:** "Paste the webhook address from Discord" means the address is not a > Discord webhook address (it must start with `https://discord.com/api/webhooks/`; the > `discordapp.com`, `ptb.` and `canary.` variants work too). "Add the webhook address first." > means the field is empty. An HTTP 404 means the webhook was deleted in Discord: create a new > one. Alerts appear as an embed in orange, notifications in blue. ### Gotify [Gotify](https://gotify.net) is a push server you run yourself. 1. In Gotify, go to **Apps** → **Create application**, name it `Postern` and copy its token. 2. In Postern, turn on **Send alerts to Gotify** under **Alerts about rules**. 3. **Server**: your Gotify address, for example `https://gotify.example.com`. 4. **App token**: the token from step 1. 5. Choose **Save**, then **Send test**. > **Check:** the Gotify app shows "Postern test". > **If it did not work:** "Add the server and an app token first." means a field is empty. An > HTTP 401 means the token is wrong. "This Hub doesn't send to addresses in a local network (the > admin can allow it)" means your Gotify server has a private address: see the next section. Alerts are sent with priority 7, notifications with priority 4. ### What a channel receives | | ntfy | Discord | Gotify | |---|---|---|---| | Request | `POST /`, the message as plain text | `POST` to the webhook, JSON | `POST /message`, JSON | | Title | `Title` header | Embed title | `title` | | Message | Body | Embed description (up to 4,000 characters) | `message` | | Sign-in | `Authorization: Bearer ` if set | Part of the webhook address | `X-Gotify-Key` header | The title is the alert's title ("Rule mail is paused"); for **Send a notification** steps it is "Postern". A delivery that fails is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours, then dropped and written to the Hub's log. **Send test** works even when the channel is turned off, so you can check it before you turn it on. ## Servers in your own network By default the Hub only sends alerts (and [webhooks](https://docs.posternmail.app/rules/webhooks/)) to public internet addresses. A server with a private address, such as `http://192.168.1.20:8080` for Gotify on your LAN, is refused with "This Hub doesn't send to addresses in a local network (the admin can allow it)". This protects your network from a rule or user that points the Hub at internal services. To allow private networks (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10` for Tailscale, and `fc00::/7`), set `POSTERN_RULES_ALLOW_LAN=1` for the Hub. Loopback (`127.0.0.1`, `localhost`) and link-local addresses stay blocked in any case. The setting applies to all users of the Hub. **Docker Compose:** `compose.yaml` does not pass this variable through, so add it in `~/postern/compose.override.yaml` (create the file if it does not exist): ```yaml services: hub: environment: POSTERN_RULES_ALLOW_LAN: "1" ``` Then apply it: ```sh cd ~/postern && docker compose up -d ``` > **Check:** `docker compose exec hub env` lists `POSTERN_RULES_ALLOW_LAN=1`, and **Send test** > on the channel reaches your server. > **If it did not work:** run `docker compose config` and look for the variable under `hub`. If > it is missing, the override file is not next to `compose.yaml` or its indentation is wrong. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add the line to `/etc/postern/hub.env`: ```sh echo 'POSTERN_RULES_ALLOW_LAN=1' | sudo tee -a /etc/postern/hub.env ``` Then restart the Hub: ```sh sudo systemctl restart postern-hub ``` > **Check:** **Send test** on the channel reaches your server. > **If it did not work:** check the file with `sudo cat /etc/postern/hub.env` (one variable per > line, no spaces around `=`), and the log with `sudo journalctl -u postern-hub -n 50`. **Desktop app (built-in Hub):** The built-in Hub inherits the environment of the desktop app. To allow private networks, quit the app and start it from a terminal with the variable set. On macOS: ```sh POSTERN_RULES_ALLOW_LAN=1 /Applications/Postern.app/Contents/MacOS/Postern ``` On Linux and Windows, set the variable the same way before you start the app. The setting lasts until the app is quit. > **Check:** **Send test** on the channel reaches your server. > **If it did not work:** quit the app completely (on macOS with **Postern → Quit**, not only > by closing the window) and start it again from the terminal. > [!NOTE] > Without the setting, the Hub also refuses host names ending in `.local`, `.internal`, `.lan` > and `.home.arpa`, and names without a dot. With it, such names are allowed, and the address > they resolve to is checked like any other. `localhost` and names ending in `.localhost` are > always refused. --- # Webhooks > The Call a web address rule step, the exact HTTP request and JSON payload it sends, retries and delivery guarantees, address restrictions, and how to receive it safely. Source: https://docs.posternmail.app/rules/webhooks/ The **Call a web address** step tells another service that a matching message arrived, for example a home automation system, a ticket tool or your own script. This page describes the request the Hub sends, the payload, retries, and how to build a receiver. ## Set it up 1. Open the rule in **Settings → Rules** and choose **Add a step** → **Call a web address**. 2. In **Web address**, type the URL of your receiver, for example `https://hooks.example.com/postern`. It must start with `http://` or `https://` and be at most 2,000 characters. 3. Save the rule. Rules with a webhook do not start in Test mode by themselves; pick **Test** first if you want to see what would be sent. > **Check:** when the next matching message arrives, **Settings → Rule activity** shows "Call > webhook hooks.example.com" with **Done** and the detail "Delivered (HTTP 200)" (or the status > your receiver returned). > **If it did not work:** the entry shows **Failed** with "Webhook failed: ..." and the reason, > and you get the alert "A rule's webhook could not be delivered to hooks.example.com: ...". > While the Hub is still retrying, the entry shows **Done** with "Queued (rjb_...)": the call is > handed to the background worker and not finished yet. You can add the step several times to call several addresses. Webhooks run only on the Hub. ## The request ```http POST /postern HTTP/1.1 Host: hooks.example.com Content-Type: application/json User-Agent: Postern/dev X-Postern-Event: rule.matched X-Postern-Delivery: rjb_7q2m4xk6d3h5p5a2c6v7b2n4zt {"event":"rule.matched", ...} ``` | Header | Value | |---|---| | `Content-Type` | `application/json` | | `User-Agent` | `Postern/`. A Hub built from source says `Postern/dev`. | | `X-Postern-Event` | Always `rule.matched` | | `X-Postern-Delivery` | The delivery ID, the same as `deliveryId` in the body | There is no signature header. The Hub does not sign webhook requests. See [Receive webhooks safely](https://docs.posternmail.app/rules/webhooks/#receive-webhooks-safely). ## Payload reference | Field | Type | Always there | Meaning | |---|---|---|---| | `event` | string | yes | Always `"rule.matched"` | | `deliveryId` | string | yes | `rjb_` followed by 26 lowercase letters and digits. The same for every retry of this delivery, and for this rule, message and step. Use it to drop duplicates. | | `ruleId` | string | yes | The rule's ID, `rul_...` | | `rule` | string | yes | The rule's name at the time of the match | | `mailboxId` | string | yes | The mailbox's ID, `mbx_...` | | `mailbox` | string | yes | The mailbox's email address | | `sender` | string | yes | The sender's email address (From) | | `senderName` | string | no | The sender's display name, if the message has one | | `subject` | string | yes | The subject, empty string if there is none | | `messageIdHeader` | string | no | The message's `Message-ID` header, without `<` and `>` | | `receivedAt` | string | no | When the message arrived, UTC, in the form `2026-12-05T09:14:03.000Z`. Falls back to the message's `Date` if the provider gave no receive time. | The message text, attachments and the other recipients are never sent. The editor says so under the field: "Gets the rule name, mailbox, sender and subject. Never the message text." ### Full example ```json { "event": "rule.matched", "deliveryId": "rjb_7q2m4xk6d3h5p5a2c6v7b2n4zt", "ruleId": "rul_01jf8k2m3n4p5q6r7s8t9v0w1x", "rule": "Invoices from Acme", "mailboxId": "mbx_01jf7a2b3c4d5e6f7g8h9j0k1m", "mailbox": "you@example.com", "sender": "billing@acme.com", "senderName": "Acme Billing", "subject": "Invoice 1042 for December", "messageIdHeader": "20261205091403.4f2a@mail.acme.com", "receivedAt": "2026-12-05T09:14:03.000Z" } ``` The ID values above are made up for the example. ## Responses, timeouts and retries | Your receiver answers | The Hub | |---|---| | Any `2xx` status | Records **Done** with "Delivered (HTTP 200)" (with your status) | | `408` or `429` | Retries | | Any other `4xx` | Gives up at once: **Failed** and an alert | | `5xx`, no answer, connection refused, timeout | Retries | - Each request may take up to 10 seconds, then it counts as a timeout. Answer quickly and do slow work after you have responded. - Retries come after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. After the last one, the activity entry becomes **Failed** with "Webhook failed: ..." and the alert "A rule's webhook could not be delivered to ..." is raised. - The response body is ignored. - Up to 3 redirects are followed, each one checked like the original address. Note that a `301`, `302` or `303` redirect turns the `POST` into a `GET` without a body, so point the step at the final address. - The Hub does not use an HTTP proxy for webhooks. **Delivery is at least once.** The Hub records the delivery before it sends it, and resends it after a restart if it does not know the result. Your receiver may therefore see the same `deliveryId` twice. It will not see a delivery zero times unless all retries fail, in which case you get an alert. Calls are made one message at a time, in the background. A slow receiver does not hold up your mail or other rules. ## Which addresses are allowed To protect your network, the Hub only calls public internet addresses. It checks the address after it has looked up the host name, on every connection, so a name that later points elsewhere is caught too. Always refused: - `localhost`, names ending in `.localhost`, loopback (`127.0.0.0/8`, `::1`), - link-local addresses (`169.254.0.0/16`, `fe80::/10`), which include cloud metadata services, - addresses with a user name or password in them (`https://user:pass@...`), - other reserved and documentation ranges (`0.0.0.0/8`, `192.0.2.0/24`, `198.18.0.0/15`, multicast and others). Refused unless your admin set `POSTERN_RULES_ALLOW_LAN=1`: - private networks: `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10` (Tailscale and carrier NAT), `fc00::/7`, - names ending in `.local`, `.internal`, `.lan` and `.home.arpa`, and names without a dot (such as `homeassistant`). How to set the variable for each install method is described under [Servers in your own network](https://docs.posternmail.app/rules/alerts/#servers-in-your-own-network) on the Alerts page. > [!NOTE] > A Home Assistant or Node-RED on your LAN, such as `http://192.168.1.20:8123/api/webhook/...`, > needs `POSTERN_RULES_ALLOW_LAN=1`. ## Receive webhooks safely Because requests are not signed, anyone who knows your receiver's address can send it a fake `rule.matched` request. Protect it like this: - **Put a secret in the address.** Use a long random path or query parameter, for example `https://hooks.example.com/postern/3f9c1a7e5b2d4c8f`, and reject everything else. Use `https` so the secret is not readable on the way. - **Treat the payload as untrusted.** `sender`, `senderName` and `subject` come from whoever sent the mail. Never run them as commands or insert them into HTML or SQL unescaped. - **Drop duplicates** by `deliveryId`. - **Answer fast** with `200` or `204`, then do the work. ### Example receiver A small receiver in Python (3.9 or later, standard library only) that checks the secret path, drops duplicates and logs the message: ```python import json from http.server import BaseHTTPRequestHandler, HTTPServer SECRET_PATH = "/postern/3f9c1a7e5b2d4c8f" seen = set() # use a database in real use; this is lost on restart class Hook(BaseHTTPRequestHandler): def do_POST(self): if self.path != SECRET_PATH: self.send_response(404) self.end_headers() return length = int(self.headers.get("Content-Length", 0)) body = json.loads(self.rfile.read(length) or b"{}") delivery = self.headers.get("X-Postern-Delivery") or body.get("deliveryId") self.send_response(204) self.end_headers() if body.get("event") != "rule.matched" or delivery in seen: return seen.add(delivery) print(f"{body['rule']}: {body.get('senderName') or body['sender']} wrote {body['subject']!r}") HTTPServer(("0.0.0.0", 8000), Hook).serve_forever() ``` Run it behind a reverse proxy with HTTPS, and set the step's **Web address** to `https://hooks.example.com/postern/3f9c1a7e5b2d4c8f`. ### Test your receiver by hand Send the example payload yourself: ```sh curl -i -X POST https://hooks.example.com/postern/3f9c1a7e5b2d4c8f \ -H 'Content-Type: application/json' \ -H 'X-Postern-Event: rule.matched' \ -H 'X-Postern-Delivery: rjb_test0000000000000000000000' \ -d '{"event":"rule.matched","deliveryId":"rjb_test0000000000000000000000","ruleId":"rul_test","rule":"Test","mailboxId":"mbx_test","mailbox":"you@example.com","sender":"billing@acme.com","subject":"Hello"}' ``` A `204` or `200` in the first line of the output means your receiver accepted it. --- # Import from MailManager > Import your MailManager rules into Postern with postern-hub import-mailmanager, for Docker, systemd and the desktop app's built-in Hub, and what is and is not carried over. Source: https://docs.posternmail.app/rules/mailmanager/ If you used MailManager, the Hub can take over its rules. This page explains what the import does, how to run it for your install method, how to read its report, and how to switch over without sending anything twice. ## What the import does `postern-hub import-mailmanager` reads MailManager's database file and creates Postern rules from its rules. MailManager's database is opened read-only and never changed. - **Mailboxes are matched by address.** Each MailManager mailbox is matched to the Postern mailbox with the same email address, for the Postern user you import for. Add your mailboxes to Postern before you import. Rules of mailboxes that Postern does not have are skipped. - **Every imported rule is in Test mode**, also rules that were live in MailManager. Those get the note "Live in MailManager; imported in Test mode". Whether a rule is turned on or off is kept. - **Running it again is safe.** Each imported rule gets an ID derived from the MailManager rule, so a second run reports the rules it imported before as "Already imported earlier (left as they are)" and does not touch them, even if you changed them in Postern. Only new rules are added. - Conditions, exceptions and the match setting carry over. Rules are imported in MailManager's order. A rule without conditions gets "Header From exists", which matches every message, with a note in the report. - A MailManager rule for all accounts that moves or copies to a folder becomes one Postern rule per mailbox, because a folder belongs to one mailbox. Mailboxes without that folder are noted as "Not for ...". ### How actions are mapped | MailManager action | Postern step | |---|---| | Redirect, Forward, Reply | **Redirect**, **Forward**, **Reply automatically** | | Capture, Delete | **Capture**, **Delete** | | Mark as read, Mark as unread | **Mark as read**, **Mark as unread** | | Flag, Unflag | **Star**, **Remove star** | | Notify | **Send a notification** with **Also send it to your alert channels** ticked | | Webhook | **Call a web address** | | Move | **Move to folder** | | Copy | **Copy to folder** | The folder of a move or copy is looked up in the Postern mailbox by its ID at the provider, its path, the path with `.` read as `/` (ignoring case), or its bare name. ### What is skipped | Reason in the report | What to do | |---|---| | it runs a script; Postern does not run scripts (use a webhook instead) | Rebuild it with **Call a web address** and a small receiver. See [Webhooks](https://docs.posternmail.app/rules/webhooks/). | | no Postern mailbox with this address | Add the mailbox in Postern and run the import again. | | folder "Clients/Acme" is not in the mailbox | Create the folder at your provider, wait for Postern to sync it, and run the import again. | | Postern can't use it as it is: ... | Usually a pattern that Postern's pattern syntax does not support, such as a look-ahead. Recreate the rule by hand. See [Patterns](https://docs.posternmail.app/rules/conditions/#patterns). | | an unknown action, a deleted account, or a definition that cannot be read | Recreate the rule by hand. | ### What is not imported The report ends with this list: - **Captured mail.** MailManager encrypts it with its own key. Download what you need in MailManager first. - **Alert channels.** Set them up again in **Settings → Notifications**. See [Alerts](https://docs.posternmail.app/rules/alerts/). - **The activity log** and **MailManager's users**. ## Before you start - Postern has the user you import for, and that user has added all mailboxes whose rules you want. - Stop MailManager, or at least its rule processing, so its database file is complete and unchanged while you copy it. Copy the database file (here called `mailmanager.db`) to the machine that runs the Hub. - The Hub must be stopped during the import. A running Hub holds its data directory, and the import refuses with "the data directory is in use by a running Hub: stop the Hub, run the import, then start the Hub again". - If the Hub has several users, you need `--user you@example.com`. With one user it is chosen automatically. The command: ```text postern-hub import-mailmanager [--user ] [--dry-run] ``` `--dry-run` only reports what would be imported and changes nothing. Always run it first. ## Run the import **Docker Compose:** The container cannot see files on the host, so copy the database into the data volume, run the import in a one-off container while the Hub is stopped, then remove the copy. 1. Stop the Hub and copy the file into the volume. `docker compose cp` makes the copy owned by root, so make it readable first: ```sh cd ~/postern docker compose stop hub chmod 644 mailmanager.db docker compose cp mailmanager.db hub:/data/mailmanager.db ``` 2. Run a dry run and read the report: ```sh docker compose run --rm hub import-mailmanager /data/mailmanager.db --dry-run ``` Add `--user you@example.com` if the Hub has several users. 3. Run the import: ```sh docker compose run --rm hub import-mailmanager /data/mailmanager.db ``` 4. Remove the copy and start the Hub: ```sh docker compose run --rm --entrypoint rm hub /data/mailmanager.db docker compose start hub ``` > **Check:** the report ends with a line like "12 imported, 0 already there, 2 skipped.", and > **Settings → Rules** lists the imported rules with the **Test** label. > **If it did not work:** "does not look like a MailManager database (no rules and accounts > tables)" means the file is not MailManager's database, or the copy is incomplete. "the data > directory is in use by a running Hub" means the Hub still runs: check with > `docker compose ps`. If `docker compose cp` fails because the container does not exist, start > the Hub once with `docker compose up -d`, then begin again at step 1. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** The Hub runs as the `postern` user, which must be able to read the file. 1. Stop the Hub and put the file where the `postern` user can read it: ```sh sudo systemctl stop postern-hub sudo install -o postern -g postern -m 0600 mailmanager.db /var/lib/postern/mailmanager.db ``` 2. Run a dry run and read the report: ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub import-mailmanager /var/lib/postern/mailmanager.db --dry-run' ``` Add `--user you@example.com` before the closing quote if the Hub has several users. 3. Run the import: ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub import-mailmanager /var/lib/postern/mailmanager.db' ``` 4. Remove the copy and start the Hub: ```sh sudo rm /var/lib/postern/mailmanager.db sudo systemctl start postern-hub ``` > **Check:** the report ends with a line like "12 imported, 0 already there, 2 skipped.", and > **Settings → Rules** lists the imported rules with the **Test** label. > **If it did not work:** "does not look like a MailManager database (no rules and accounts > tables)" means the file is not MailManager's database. "the data directory is in use by a > running Hub" means the Hub still runs: check with `systemctl status postern-hub`. A > "permission denied" means the `postern` user cannot read the file: repeat step 1. **Desktop app (built-in Hub):** The desktop app has no menu item for the import, but you can run the built-in Hub's program from a terminal while the app is closed. This only works if your build of the app contains the built-in Hub. 1. Quit the app completely. Quitting stops the built-in Hub. 2. On macOS, run a dry run (the paths below are the default install and data locations): ```sh "/Applications/Postern.app/Contents/Resources/hub/hub" import-mailmanager \ --data-dir "$HOME/Library/Application Support/Postern/hub-data" \ --key-file "$HOME/Library/Application Support/Postern/hub-key/hub.key" \ ~/mailmanager.db --dry-run ``` 3. Run the same command without `--dry-run`. 4. Start the app again. On Windows and Linux the program is `hub.exe` or `hub` in the `resources/hub` folder of the installed app. Use the data folder `%APPDATA%\Postern` or `~/.config/Postern` in place of the macOS one, with `hub-data` and `hub-key/hub.key` inside it. > **Check:** the report ends with a line like "12 imported, 0 already there, 2 skipped.", and > **Settings → Rules** in the app lists the imported rules with the **Test** label. > **If it did not work:** "the data directory is in use by a running Hub" means the app is still > running: quit it fully. If the program file does not exist, your build has no built-in Hub; > run the import on a Hub installed with one of the other methods. ## Read the report A dry run prints something like this: ```text Importing MailManager rules from /data/mailmanager.db for you@example.com Dry run: nothing was changed. Mailboxes: you@example.com → Postern mailbox mbx_01jf7a2b3c4d5e6f7g8h9j0k1m old@example.org → no Postern mailbox with this address (its rules are skipped) Would be imported (in Test mode): + "Invoices to accounting" [you@example.com] → rul_01jf8k2m3n4p5q6r7s8t9v0w1x Live in MailManager; imported in Test mode + "Newsletters" [you@example.com] → rul_01jf8k2m3n4p5q6r7s8t9v0w2y Skipped: - "Run backup script" [you@example.com]: it runs a script; Postern does not run scripts (use a webhook instead) Not imported: captured mail (MailManager encrypts it with its own key; download it there first if you need it), alert channels (set them up in Settings → Notifications), the activity log and MailManager users. 2 would be imported, 0 already there, 1 skipped. The rules are in Test mode: they only record what they would do (Settings → Rules → Activity). Compare with MailManager for a few days, then switch them to Live and stop MailManager's rules. Never let both enforce the same redirect. ``` `+` lines are rules that are (or would be) created, with notes below them. `-` lines are skipped rules with the reason. The activity log the report mentions is under **Settings → Rule activity**. | Error | Meaning | |---|---| | no Postern user you@example.com | `--user` names an address that has no Postern account on this Hub. | | this Hub has no users yet | Create your account first. | | this Hub has several users (...): choose one with --user | Add `--user` with one of the listed addresses. | | --user needs an email address | `--user` was the last argument. | ## Switch over 1. Leave MailManager running and the imported rules in Test mode for a few days. 2. Compare **Settings → Rule activity** in Postern with MailManager's log. Every message MailManager acted on should have a **Simulated** entry in Postern with the same steps. 3. When they agree, for each rule: switch it to **Live** in Postern and turn it off in MailManager at the same time. > [!WARNING] > Never let a rule be live in both MailManager and Postern. Both would redirect, forward or > reply, and the recipient would get every message twice. A redirect in both could also delete > the message before the other one has kept its copy. See [Test mode](https://docs.posternmail.app/rules/test-mode/) for what to check before switching a rule to Live. --- # How push works > How new-mail notifications reach phones, why Postern needs a push relay for that, and how to point your Hub at one. Source: https://docs.posternmail.app/relay/ This page explains how a new message on your Hub becomes a notification on your phone, what the push relay is for, and what you set on the Hub to use one. To run a relay yourself, see [Run your own relay](https://docs.posternmail.app/relay/run-your-own/). For exactly what passes through it, see [What the relay sees](https://docs.posternmail.app/relay/what-it-sees/). > [!IMPORTANT] > The official relay is **`https://relay.posternmail.app`**. It reaches the Postern > app from the App Store and TestFlight on iPhone, iPad and Apple Watch: set > `POSTERN_RELAY_URL=https://relay.posternmail.app` on your Hub > ([how](https://docs.posternmail.app/relay/#set-the-relay-url-on-your-hub)). It does not reach an app you built yourself, and > it does not reach Android yet (no Firebase project exists for it). For those, you run > [your own relay](https://docs.posternmail.app/relay/run-your-own/) with credentials that match your build. ## Why a relay exists Phones only show push notifications that come through their platform's push service: - **iOS** accepts pushes only from the Apple Push Notification service (APNs). - **Android** accepts pushes only from Firebase Cloud Messaging (FCM). Apple and Google only accept a push for an app if it is signed with that **app developer's** credentials: an APNs key from the Apple developer team that owns the app's bundle ID, and a Firebase service account of the Firebase project the app was built with. Those credentials cannot be handed out to every Hub. The relay is the one place that holds them. Your Hub sends it a short message ("this device has new mail"), and the relay signs it and passes it on to Apple or Google. The relay is a separate small program (`postern-relay`, in the repository's `relay/` folder; the official one runs the same API as a Cloudflare Worker, `deploy/cloudflare-relay/`). It has no access to your mailboxes, keeps no list of devices and stores no messages. Browsers and the desktop app do not need the relay (see [Other ways notifications arrive](https://docs.posternmail.app/relay/#other-ways-notifications-arrive)). ## From new mail to the phone ```text Mail provider ──new mail──▶ Hub ──"device X: new mail"──▶ Push relay ──▶ APNs / FCM ──▶ phone ▲ │ └──────────────── the app opens and fetches mail ◀─────────┘ ``` 1. **The Hub notices new mail.** It watches your mailboxes even when your apps connect to the providers directly. 2. **The Hub decides whether to notify.** Your notification settings apply first: **Notify me about** (all mail, VIPs only, nothing), quiet hours, and per-mailbox choices. See [Notifications](https://docs.posternmail.app/using/notifications/). 3. **The Hub picks the devices.** Every signed-in device that has notifications turned on gets one. A phone that registered for push gets a push message even while its app is connected, because the system may have suspended the app without closing its connection. An open browser tab or desktop app gets the notification over its live connection instead. 4. **The Hub builds the payload.** With previews on, it contains the sender, the subject and the first words of the message. With previews off, it contains only a generic title such as "New mail". See [Previews on or off](https://docs.posternmail.app/relay/#previews-on-or-off). 5. **The Hub sends it to the relay** (`POST /v1/push`), authenticated with the secret it got when it registered. Up to 100 messages go in one request. 6. **The relay forwards each message** to APNs (iOS) or FCM (Android) and reports back per device whether it was delivered. If Apple or Google say a device token is no longer valid, the Hub deletes that device's push registration. 7. **The phone shows the notification.** Tapping it opens the conversation; the app fetches the message itself, from your Hub or straight from your provider. A device registers for push when you turn on notifications in the app (**Settings → Notifications**). The app asks the system for permission, gets a device token from Apple or Google, and sends that token to your Hub. The token is stored on the Hub, not on the relay. ## Set the relay URL on your Hub `POSTERN_RELAY_URL` is the base address of the relay, for example `https://relay.example.com`. It does three things: - It turns on mobile push. Without it, the Hub refuses push registrations from the apps, and turning on notifications in the app shows "Your Hub isn't set up to send notifications yet. Whoever runs it can turn that on in the Hub's settings." - It tells the Hub where to register. On the first push, the Hub calls `POST /v1/register` on the relay, receives a Hub ID and a secret, and stores the secret encrypted with the master key. It registers again by itself if you change the URL, or if the relay no longer accepts its secret. - It is checked for health. The Hub calls `GET /healthz` on the relay for the status page and for `postern-hub doctor`. Leave it empty (the default) to turn mobile push off. **Docker Compose:** Add the line to `~/postern/.env` (compose.yaml passes it through), then apply it: ```ini POSTERN_RELAY_URL=https://relay.example.com ``` ```sh cd ~/postern && docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add the line to `/etc/postern/hub.env`, then restart the Hub: ```ini POSTERN_RELAY_URL=https://relay.example.com ``` ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** Not available. The desktop app's built-in Hub is only reachable from that computer, so phones cannot sign in to it and there is nothing to push to. Run the Hub with Docker or as a systemd service if you want phone notifications. To check it, run the doctor: **Docker Compose:** ```sh cd ~/postern && docker compose exec hub postern-hub doctor ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub doctor' ``` **Desktop app (built-in Hub):** Not available for the built-in Hub. > **Check:** The doctor prints a line like `push relay https://relay.example.com is > healthy`. In the web app, **Settings → Admin → Status → Phone notifications** says > **Working**. > **If it did not work:** **Status** shows **Can't be reached** and the doctor prints > `push relay ... is unreachable` when `GET /healthz` on the relay does not answer with > HTTP 200 within 5 seconds. Open `https://relay.example.com/healthz` from the Hub's machine > (for example with `curl`) and check DNS, the reverse proxy in front of the relay and its > certificate. **Not set up** means the Hub does not see `POSTERN_RELAY_URL`: check the > spelling and that you restarted the Hub. ### What the status values mean | Where | Value | Meaning | |---|---|---| | **Settings → Admin → Status → Phone notifications** | **Not set up** | `POSTERN_RELAY_URL` is empty. | | | **Working** | The relay's `/healthz` answered with HTTP 200 (checked at most every 5 minutes). | | | **Can't be reached** | The relay did not answer. The status page also warns: "The push relay is unreachable: mobile notifications are delayed." | | `postern-hub doctor` | `Push relay disabled (POSTERN_RELAY_URL not set)` | Push is off. | | | `push relay is healthy` | `/healthz` answered with HTTP 200. | | | `push relay is unreachable` | Anything else. | A healthy relay only proves the relay is up. Whether a push actually reaches a phone also depends on the relay's Apple or Google credentials matching your app build. See [Run your own relay](https://docs.posternmail.app/relay/run-your-own/#apple-and-google-credentials). ## Previews on or off Each user decides how much a phone notification shows. The setting applies to all their phones: - Web app: **Settings → Notifications → Show sender and subject on phones** - Mobile app: **Settings → Notifications → Show previews on phones** It is **on** by default. | | Previews on (default) | Previews off | |---|---|---| | Notification title | Sender name (or address) | "New mail" | | Second line | Subject, or "(no subject)" | none | | Text | The first words of the message (up to 240 characters) | none | | Sender's address | Sent, so iOS can show the sender's picture | Not sent | With previews off, other kinds of notification also get a generic title: "Follow-up reminder", "A snoozed conversation is back", "A message could not be sent" or "Your mail needs attention". With previews on, the sender, subject and first words pass through the relay and through Apple's or Google's push service. With previews off, none of that text leaves your Hub in a push. [What the relay sees](https://docs.posternmail.app/relay/what-it-sees/) lists every field. ## Other ways notifications arrive ### Web Push (browsers) Browsers get notifications through Web Push, without the relay. The Hub creates its own Web Push key pair (VAPID) on first start and keeps the private key encrypted with the master key. In the web app, turn it on under **Settings → Notifications** in the **This device** section. Web Push needs the Hub to be opened over HTTPS. The message is encrypted end to end to your browser, so the browser vendor's push service carries it but cannot read it. It contains the sender, the subject and the first words of the message; the "previews on phones" setting does not apply to it. The push service does see your Hub's public address as the sender contact (or, when the Hub has no HTTPS public URL, the email address of the first admin). ### Desktop app The desktop app shows notifications itself while it is running, including when its window is closed to the tray. It needs no relay and no Web Push. ### UnifiedPush The Hub can deliver to a [UnifiedPush](https://unifiedpush.org/) endpoint (for example a self-hosted ntfy server) without the relay. The payload is the same as for the relay, and the previews setting applies. The endpoint must be an `https://` address; it may be on your LAN or tailnet, but not on loopback or link-local addresses. The Postern Android app does not register a UnifiedPush endpoint yet, so today this only works for custom clients that call the Hub's API (`POST /api/v1/devices/current/push` with `"kind": "unifiedpush"`). ### Without any push Without a relay, phones get no push notifications. The app shows new mail when you open it. ## Common problems | What you see | Cause | What to do | |---|---|---| | "Your Hub isn't set up to send notifications yet. Whoever runs it can turn that on in the Hub's settings." | `POSTERN_RELAY_URL` is not set on the Hub. | [Set the relay URL](https://docs.posternmail.app/relay/#set-the-relay-url-on-your-hub). | | "Notifications are turned off for Postern in the Settings app." | The system permission was denied. | Allow notifications for Postern in the phone's Settings app, then turn them on in Postern again. | | "Notifications need the installed Postern app; they don't work in Expo Go on Android." | You are running a development build in Expo Go. | Install a real build of the app. | | **Phone notifications: Working**, but nothing arrives | The relay's credentials do not match your app build, or previews and mode settings filter it out. | See [Run your own relay](https://docs.posternmail.app/relay/run-your-own/#troubleshooting). | --- # Run your own relay > Build, configure and run your own Postern push relay with your own Apple and Google credentials, and point your Hub at it. Source: https://docs.posternmail.app/relay/run-your-own/ This page sets up `postern-relay`, the program that forwards your Hub's notifications to Apple and Google. Read [How push works](https://docs.posternmail.app/relay/) first if you have not. With the Postern app from the App Store or TestFlight you don't need one: use the official relay, `https://relay.posternmail.app`. Run your own for an app you build yourself, or for Android. What you need: - A machine that can make outgoing HTTPS connections to `api.push.apple.com` (or `api.sandbox.push.apple.com`) and `fcm.googleapis.com`, and that your Hub can reach. It can be the Hub's own machine. - Go 1.27 or newer, or Docker, to build the relay from source. - An HTTPS address for it, for example `https://relay.example.com`, through a reverse proxy. - Apple and/or Google credentials that match **the app build on your phones**. This is the part that decides whether anything arrives, so read the next section before you start. ## Apple and Google credentials A device token belongs to one app. Apple and Google only deliver a push to it when the push is signed with credentials of that app's owner: - **iOS:** the push must be signed with an APNs key of the Apple developer team that owns the app's **bundle ID**, and must name that bundle ID as its topic (`APNS_TOPIC`). A key of another team is rejected. - **Android:** the push must be sent with a service account of the **Firebase project** the app was built with (its `google-services.json`). So your relay can only reach apps that you build yourself, with a bundle ID in your own Apple developer team and a Firebase project of your own. It cannot reach an app built and signed by someone else: the App Store and TestFlight builds of Postern are reachable only through the official relay, which holds the project's own APNs key. The Postern app's identifiers are in `apps/mobile/app.json`: `ios.bundleIdentifier` and `android.package` are both `app.postern`. That bundle ID belongs to the project's Apple team, so for a self-built iOS app you change `ios.bundleIdentifier` to one in your team (for example `com.example.postern`) and use that same value as `APNS_TOPIC`. How to build the apps is described on [iOS app](https://docs.posternmail.app/apps/ios/) and [Android app](https://docs.posternmail.app/apps/android/). You can configure only one platform. Pushes for the other one fail with `platform_not_configured`. ### APNs key (iOS) 1. In the Apple Developer portal, open **Certificates, Identifiers & Profiles → Keys** and create a key with **Apple Push Notifications service (APNs)** enabled. 2. Download the `.p8` file. Apple lets you download it only once: keep a copy somewhere safe. 3. Note the **Key ID** (10 characters, shown with the key) and your **Team ID** (10 characters, shown in your membership details). 4. Decide on the APNs environment. Builds installed from Xcode with a development profile get tokens for the **sandbox** servers (`APNS_SANDBOX=true`). TestFlight and App Store builds use **production** (the default). One relay talks to one environment. The key must be a P-256 key in PEM format, which is what Apple's `.p8` files are. The relay signs a provider token with it (ES256) and renews it every 40 minutes. ### Firebase service account (Android) 1. In the [Firebase console](https://console.firebase.google.com/), use the project that your Android build's `google-services.json` comes from. The app and the relay must use the same project. 2. Open **Project settings → Service accounts** and choose **Generate new private key**. This downloads a JSON file. 3. Make sure the **Firebase Cloud Messaging API (V1)** is enabled for the project. The relay reads `client_email`, `private_key`, `private_key_id`, `project_id` and `token_uri` from that file. The file's `type` must be `service_account`. > [!WARNING] > The `.p8` key and the service-account JSON let anyone send notifications to your app's > users. Keep them readable only by the relay, never commit them, and back them up apart from > the relay's data. ## Build the relay Both ways build from the repository's `relay/` folder, which is its own Go module. There are no release archives or images yet (the planned image name is `ghcr.io/theoriuhd/postern-relay`). Get the source if you do not have it yet: ```sh git clone https://github.com/TheOriUHD/postern.git ~/postern ``` ### With Go ```sh cd ~/postern/relay GOWORK=off CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$(git describe --tags --always)" -o postern-relay ./cmd/relay sudo install -m 0755 postern-relay /usr/local/bin/postern-relay ``` The result is one static binary. `postern-relay version` prints the version you set with `-X main.version` (without it, `dev`). ### With Docker Run this from the repository root, not from `relay/`: ```sh cd ~/postern docker build -f relay/Dockerfile -t postern-relay:local --build-arg VERSION=$(git describe --tags --always) . ``` The image runs as user 10001, keeps its data in `/data` (a volume), listens on port 8090, and has a health check that calls `/healthz`. Its default command is `serve`. ## Configuration The relay reads only environment variables. Values are trimmed; an empty value counts as not set. Invalid values stop it at start with an error naming the variable. | Variable | Default | Meaning | |---|---|---| | `RELAY_LISTEN` | `:8090` | Address and port to listen on. Use `127.0.0.1:8090` when a reverse proxy runs on the same machine. | | `RELAY_DATA_DIR` | `./relay-data` (image: `/data`) | Folder for `relay.db`, the SQLite file with the Hub registrations. Created with mode 0700, the database file is set to 0600. | | `RELAY_REGISTRATION` | `open` | `open`: any Hub that can reach the relay may register. `closed`: no new registrations (HTTP 403 "Registration is closed on this relay"). | | `RELAY_MAX_PUSH_PER_MINUTE` | `120` | Push messages per Hub per minute. Each message in a batch counts. Must be a positive integer. | | `RELAY_MAX_REGISTER_PER_HOUR` | `10` | Registrations per client IP per hour. Must be a positive integer. | | `RELAY_TRUST_PROXY` | `false` | `true`: take the client IP for the registration limit from the right-most `X-Forwarded-For` entry. Only behind your own reverse proxy. Accepts `1/true/yes/on` and `0/false/no/off`. | | `RELAY_CLIENT_IP_HEADER` | empty | With `RELAY_TRUST_PROXY=true`: a header your proxy sets to the client IP, which then wins over `X-Forwarded-For`. Behind Cloudflare (a proxied DNS record or `cloudflared`): `CF-Connecting-IP`. | | `RELAY_LOG_LEVEL` | `info` | `debug`, `info`, `warn` (or `warning`), `error`. | | `RELAY_LOG_FORMAT` | `json` | `json` or `text`. Logs go to standard error. | | `APNS_KEY_FILE` | | Path to the APNs `.p8` key. Setting it turns on iOS. | | `APNS_KEY_ID` | | Key ID of that key. Required with `APNS_KEY_FILE`. | | `APNS_TEAM_ID` | | Your Apple developer Team ID. Required with `APNS_KEY_FILE`. | | `APNS_TOPIC` | | The iOS app's bundle ID. Required with `APNS_KEY_FILE`. | | `APNS_SANDBOX` | `false` | `true` sends to `api.sandbox.push.apple.com` instead of `api.push.apple.com`. | | `FCM_CREDENTIALS_FILE` | | Path to the Firebase service-account JSON. Setting it turns on Android. | | `FCM_PROJECT_ID` | `project_id` from the credentials file | Firebase project ID, if you need to override it. | Start-up errors you may see: | Message | Fix | |---|---| | `APNS_KEY_FILE is set but APNS_KEY_ID, APNS_TEAM_ID missing` (or similar) | Set all four APNs variables together. | | `APNS_KEY_ID/APNS_TEAM_ID/APNS_TOPIC are set but APNS_KEY_FILE is not` | Set the key file, or remove the other APNs variables. | | `FCM_PROJECT_ID is set but FCM_CREDENTIALS_FILE is not` | Set the credentials file, or remove `FCM_PROJECT_ID`. | | `apns: read key file: ...`, `apns: key file is not PEM`, `apns: key must be P-256` | The path is wrong, not readable by the relay's user, or not an APNs `.p8` key. | | `fcm: credentials type is "...", want service_account`, `fcm: credentials need client_email and private_key` | Use a service-account key from **Project settings → Service accounts**, not `google-services.json`. | | `fcm: project id missing (set FCM_PROJECT_ID)` | The JSON has no `project_id`: set `FCM_PROJECT_ID`. | | `RELAY_REGISTRATION must be open or closed, got "..."` | Use `open` or `closed`. | With neither APNs nor FCM configured the relay still starts, but logs the warning "neither APNs nor FCM is configured: every push will fail with platform_not_configured". ## Run it Pick one of the two examples below. Both are examples, not files shipped in the repository: adjust paths, names and the bundle ID to your setup. ### With systemd (example) Create a user, a configuration folder and the environment file: ```sh sudo useradd --system --home-dir /var/lib/postern-relay --shell /usr/sbin/nologin postern-relay sudo install -d -m 0750 -o root -g postern-relay /etc/postern-relay ``` Copy your `.p8` key and service-account JSON into `/etc/postern-relay/`, then make them readable only by the relay: ```sh sudo chown root:postern-relay /etc/postern-relay/AuthKey_ABC123DEFG.p8 /etc/postern-relay/firebase-service-account.json sudo chmod 0640 /etc/postern-relay/AuthKey_ABC123DEFG.p8 /etc/postern-relay/firebase-service-account.json ``` Write `/etc/postern-relay/relay.env` (mode 0640, owner `root:postern-relay`): ```ini RELAY_LISTEN=127.0.0.1:8090 RELAY_DATA_DIR=/var/lib/postern-relay RELAY_REGISTRATION=open RELAY_TRUST_PROXY=true APNS_KEY_FILE=/etc/postern-relay/AuthKey_ABC123DEFG.p8 APNS_KEY_ID=ABC123DEFG APNS_TEAM_ID=TEAM123456 APNS_TOPIC=com.example.postern FCM_CREDENTIALS_FILE=/etc/postern-relay/firebase-service-account.json ``` Write `/etc/systemd/system/postern-relay.service`: ```ini [Unit] Description=Postern push relay Wants=network-online.target After=network-online.target [Service] Type=simple User=postern-relay Group=postern-relay EnvironmentFile=/etc/postern-relay/relay.env ExecStart=/usr/local/bin/postern-relay serve Restart=on-failure RestartSec=5s StateDirectory=postern-relay StateDirectoryMode=0700 UMask=0077 NoNewPrivileges=yes CapabilityBoundingSet= ProtectSystem=strict ProtectHome=yes PrivateTmp=yes PrivateDevices=yes ProtectKernelTunables=yes ProtectKernelModules=yes ProtectControlGroups=yes RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 RestrictNamespaces=yes LockPersonality=yes MemoryDenyWriteExecute=yes SystemCallArchitectures=native SystemCallFilter=@system-service [Install] WantedBy=multi-user.target ``` Check the credentials, then start it: ```sh sudo -u postern-relay sh -c 'set -a; . /etc/postern-relay/relay.env; exec postern-relay check' sudo systemctl daemon-reload sudo systemctl enable --now postern-relay ``` > **Check:** `postern-relay check` prints `configuration: ok`, then a line for APNs > (`apns: key loaded, host https://api.push.apple.com, topic com.example.postern`) and FCM > (`fcm: access token obtained for project ...`), and finally > `store: /var/lib/postern-relay/relay.db, 0 hubs registered`. > `sudo systemctl status postern-relay` shows `active (running)`. > **If it did not work:** `postern-relay check` stops at the first problem and prints it > after `error:`. For FCM it really asks Google for an access token, so a wrong key or a > blocked outgoing connection shows up here. See the start-up errors in > [Configuration](https://docs.posternmail.app/relay/run-your-own/#configuration), and `sudo journalctl -u postern-relay -e` for the service. ### With Docker Compose (example) Make a folder with the credentials and a `compose.yaml`: ```sh mkdir -p ~/postern-relay/secrets ``` Copy the `.p8` key and the service-account JSON into `~/postern-relay/secrets/`. The container runs as user 10001, so give that user read access: ```sh sudo chown 10001:10001 ~/postern-relay/secrets/* sudo chmod 0400 ~/postern-relay/secrets/* ``` `~/postern-relay/compose.yaml`: ```yaml services: relay: image: postern-relay:local restart: unless-stopped ports: - "127.0.0.1:8090:8090" environment: RELAY_REGISTRATION: open RELAY_TRUST_PROXY: "true" APNS_KEY_FILE: /secrets/AuthKey_ABC123DEFG.p8 APNS_KEY_ID: ABC123DEFG APNS_TEAM_ID: TEAM123456 APNS_TOPIC: com.example.postern FCM_CREDENTIALS_FILE: /secrets/firebase-service-account.json volumes: - relay-data:/data - ./secrets:/secrets:ro read_only: true tmpfs: - /tmp security_opt: - no-new-privileges:true cap_drop: - ALL volumes: relay-data: ``` Check the credentials, then start it: ```sh cd ~/postern-relay docker compose run --rm relay check docker compose up -d ``` > **Check:** `docker compose run --rm relay check` prints `configuration: ok` and a line > each for APNs and FCM. `docker compose ps` shows the relay as `healthy` after about half a > minute. > **If it did not work:** A `permission denied` on a file in `/secrets` means user 10001 > cannot read it: repeat the `chown`/`chmod` above. Other errors are listed under > [Configuration](https://docs.posternmail.app/relay/run-your-own/#configuration). Logs: `docker compose logs -f relay`. ## Put it behind HTTPS The relay speaks plain HTTP. The Hub sends its secret in every push request, so put the relay behind a reverse proxy with TLS and keep `RELAY_LISTEN` (or the published port) on `127.0.0.1`. Caddy (gets a certificate automatically; ports 80 and 443 must reach the machine): ```text relay.example.com { reverse_proxy 127.0.0.1:8090 } ``` nginx (with a certificate you already have): ```nginx server { listen 443 ssl; server_name relay.example.com; ssl_certificate /etc/ssl/relay.example.com/fullchain.pem; ssl_certificate_key /etc/ssl/relay.example.com/privkey.pem; location / { proxy_pass http://127.0.0.1:8090; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; } } ``` Behind a proxy, set `RELAY_TRUST_PROXY=true` so the registration limit counts real client addresses instead of the proxy's. The relay then uses the right-most `X-Forwarded-For` entry, which is the one your proxy adds. Behind Cloudflare, also set `RELAY_CLIENT_IP_HEADER=CF-Connecting-IP`: a Cloudflare Tunnel does not add the caller to `X-Forwarded-For` the way a reverse proxy does. Leave both off when nothing sits in front of the relay, or anyone could pick their own address. If the Hub and the relay run on the same machine or in the same private network, the Hub can also use a plain `http://` address such as `http://127.0.0.1:8090`. Use HTTPS for any connection that leaves the machine or network. ## Connect your Hub Set `POSTERN_RELAY_URL` on the Hub to the relay's address, as described in [Set the relay URL on your Hub](https://docs.posternmail.app/relay/#set-the-relay-url-on-your-hub). How the Hub authenticates: 1. On its first push, the Hub calls `POST /v1/register` with its name (from **Settings → Admin → Your Hub**) and version. The relay answers with a random Hub ID (`hub_...`) and a random 32-byte secret. 2. The relay stores only a SHA-256 hash of the secret. The Hub stores the secret encrypted with its master key, together with the Hub ID and the relay URL. 3. Every push request carries `Authorization: Bearer ` and the Hub ID. A wrong or unknown secret gets HTTP 401. 4. If the relay rejects the secret (for example because you deleted the Hub on the relay, or lost `relay.db`), the Hub registers again once by itself. That only works while registration is open. Once all your Hubs have registered, close registration so nobody else can use your relay: ```ini RELAY_REGISTRATION=closed ``` Restart the relay after the change. Registered Hubs keep working. > [!NOTE] > With registration closed, a Hub that has to register again (new relay URL, deleted > registration, lost `relay.db`) cannot. Open registration for a moment, send yourself a > test mail so the Hub registers, then close it again. ## Check that it works The health endpoint needs no authentication: ```sh curl -s https://relay.example.com/healthz ``` ```text {"apns":true,"fcm":true,"ok":true,"version":"dev"} ``` `apns` and `fcm` say which platforms are configured. If the database cannot be reached, the endpoint answers HTTP 503 with `{"ok":false}`. Then test the whole path: 1. On the Hub, **Settings → Admin → Status → Phone notifications** says **Working**. 2. On the phone, open Postern, **Settings → Notifications**, and turn on **Notifications**. 3. Put the app in the background and send yourself a message from another account. 4. List the registered Hubs on the relay: **PUSHES** goes up and **LAST PUSH** is set (counters are written to the database once a minute). With the systemd example: ```sh sudo -u postern-relay sh -c 'set -a; . /etc/postern-relay/relay.env; exec postern-relay hubs list' ``` With the Docker example: ```sh cd ~/postern-relay && docker compose exec relay postern-relay hubs list ``` ```text ID NAME VERSION CREATED LAST PUSH PUSHES STATUS hub_k3x7q2m4w5n6p7r8s9t2v3w4x5 Postern 0.1.0 2026-12-01T10:00:00Z 2026-12-05T08:12:44Z 37 active ``` ## Operating the relay | Command | What it does | |---|---| | `postern-relay` or `postern-relay serve` | Runs the relay. | | `postern-relay check` | Validates the configuration, loads the APNs key, fetches an FCM access token and opens the database, then exits. | | `postern-relay hubs list` | Lists registered Hubs: ID, name, version, created, last push, push count, status. | | `postern-relay hubs disable ID` | Rejects pushes from that Hub (HTTP 403 "This hub is disabled on the relay"). | | `postern-relay hubs enable ID` | Accepts its pushes again. | | `postern-relay hubs delete ID` | Forgets the Hub. It registers again on its next push if registration is open. | | `postern-relay version` | Prints the version. | | `postern-relay help` | Prints the usage. | The `hubs` and `check` commands read the same environment variables as the server, in particular `RELAY_DATA_DIR`. They can run while the relay is running. ### Backups Back up `relay.db` in `RELAY_DATA_DIR` (with Docker, the `relay-data` volume). It holds only the Hub registrations. If you lose it, every Hub has to register again, which happens automatically while registration is open. Back up the `.p8` key and the service-account JSON separately: Apple will not let you download the key again. ### Logs Logs go to standard error: `sudo journalctl -u postern-relay -f` with systemd, `docker compose logs -f relay` with Docker. At the default `info` level you see one line when the relay starts, one per registration (`hub registered`, with Hub ID and version) and one per push request (`push`, with Hub ID, number of messages, how many were delivered, unregistered or failed, and the time taken). Request lines (method, path, status) are logged at `debug`, or at `warn` for server errors. The relay never logs payloads, secrets, full device tokens or client IP addresses. See [What the relay sees](https://docs.posternmail.app/relay/what-it-sees/#logs). ### Limits | Limit | Value | |---|---| | Messages per push request | 100 | | Payload size per message | 4 KB (after shortening title and body) | | Title | 256 characters, longer ones are shortened | | Body | 1024 characters, longer ones are shortened | | Collapse key | 64 bytes | | Thread ID | 128 bytes | | Push rate per Hub | `RELAY_MAX_PUSH_PER_MINUTE` (default 120), refilled continuously | | Registrations per IP | `RELAY_MAX_REGISTER_PER_HOUR` (default 10) | When a Hub is over its push rate, the extra messages get the error `rate_limited`. When it has nothing left at all, the whole request gets HTTP 429 with a `Retry-After` header. ## Troubleshooting The relay answers each message with `ok`, or an `error` and whether the token is dead (`unregistered`). The Hub deletes registrations reported as dead and logs other errors at debug level (`relay push rejected`). Set `RELAY_LOG_LEVEL=debug` on the relay to see each failure with an 8-character fingerprint of the token, the provider's HTTP status and reason. | Error | Meaning | What to do | |---|---|---| | `platform_not_configured` | No APNs (iOS) or FCM (Android) credentials on this relay. | Add the missing credentials. | | `BadDeviceToken` (iOS) | The token is malformed or belongs to the other APNs environment. The Hub deletes it. | If it happens for every device, `APNS_SANDBOX` does not match your build: development builds need `true`, TestFlight and App Store builds `false`. | | `DeviceTokenNotForTopic` (iOS) | `APNS_TOPIC` is not the bundle ID of the app on the phone. | Set `APNS_TOPIC` to your build's `ios.bundleIdentifier`. | | `InvalidProviderToken` (iOS) | Apple does not accept the key, Key ID or Team ID. | Check all three; the key must belong to the team that owns the bundle ID. | | `Unregistered`, `ExpiredToken` (iOS), `UNREGISTERED` (Android) | The app was removed or the token changed. The Hub deletes it. | Nothing; the app registers a new token the next time it starts. | | `provider_auth_failed` | Google rejected the relay's service account, or Apple refused the request. | Check the service-account JSON and that the FCM API (V1) is enabled; run `postern-relay check`. | | `SENDER_ID_MISMATCH` (Android) | The app was built with another Firebase project. | Use the service account of the project in the app's `google-services.json`. | | `rate_limited` | Over the per-Hub limit, or Apple/Google throttled the request. | Raise `RELAY_MAX_PUSH_PER_MINUTE` if one Hub has many devices. | | `provider_unavailable` | Apple or Google could not be reached or answered with a server error (retried once). | Check the relay's outgoing network. | | `invalid_message`, `invalid_token`, `payload_too_large` | The Hub sent something the relay refuses. | Make sure Hub and relay come from the same version of the repository. | HTTP-level answers to the Hub: | Status | Meaning | |---|---| | 401 "Missing bearer secret", "Unknown hub or wrong secret" | The Hub registers again by itself, if registration is open. | | 403 "This hub is disabled on the relay" | Someone ran `postern-relay hubs disable`. | | 403 "Registration is closed on this relay" | `RELAY_REGISTRATION=closed` and the Hub tried to register. | | 429 "Too many registrations, try again later" | More than `RELAY_MAX_REGISTER_PER_HOUR` registrations from one IP. Behind a proxy without `RELAY_TRUST_PROXY=true`, all clients share the proxy's address. | | 429 "Push rate limit exceeded" | See [Limits](https://docs.posternmail.app/relay/run-your-own/#limits). | --- # What the relay sees > Every field the push relay receives, stores and forwards to Apple and Google, with previews on and off, and what its logs contain. Source: https://docs.posternmail.app/relay/what-it-sees/ This page lists exactly what passes through the push relay, what it keeps, and what Apple and Google receive from it. It describes the code in `hub/internal/platform/push.go` (what the Hub sends) and `relay/` (what the relay does with it). For the overall flow, see [How push works](https://docs.posternmail.app/relay/). The short version: - The relay never sees your mail, your mailbox addresses or credentials, or your Hub login. - With previews **off**, a push says only that something happened ("New mail") and carries IDs that let the app find the message. - With previews **on** (the default), a push also carries the sender's name and address, the subject and the first words of the message. That text passes through the relay and through Apple's or Google's push service. - The relay stores one row per registered Hub and nothing about devices or messages. ## What the Hub sends ### When it registers Once per Hub and relay URL, `POST /v1/register`: | Field | Content | |---|---| | `hubName` | Your Hub's name from **Settings → Admin → Your Hub** (default "Postern"). Control characters are removed and it is cut to 100 characters. | | `version` | The Hub's version. Cut to 64 characters. | The request has no user data. The relay answers with a random Hub ID and secret. ### With every push `POST /v1/push` carries `Authorization: Bearer `, a `User-Agent` of `Postern-Hub/`, the Hub ID, and up to 100 messages, one per device: | Field | Content | |---|---| | `platform` | `ios` or `android`. | | `token` | The device's push token from Apple or Google. Needed to deliver anything. | | `collapseKey` | The Hub's thread ID, so a newer notification for the same conversation replaces the older one. For notifications without a thread, the kind (for example `mail`). | | `priority` | Always `high`. | | `payload` | See the next table. | The payload, field by field: | Payload field | Previews off | Previews on (default) | |---|---|---| | `type` | `mail` | `mail` | | `title` | A generic title: "New mail", "Follow-up reminder", "A snoozed conversation is back", "A message could not be sent" or "Your mail needs attention" | The sender's name, or their address if there is no name | | `subtitle` | not sent | The subject (up to 200 characters), or "(no subject)" | | `body` | not sent | The first words of the message, whitespace collapsed (up to 240 characters) | | `senderEmail` | not sent | The sender's address, lower case | | `threadId` | The Hub's ID of the conversation (a random ID such as `thr_...`) | same | | `messageIdHeader` | The message's `Message-ID` header | same | | `badge` | not sent | not sent | Never sent, with either setting: the full message, attachments, recipients, other headers, your mailbox addresses, mailbox credentials, your Hub's address, your account name or email, and anything about other users. > [!NOTE] > `messageIdHeader` is sent even with previews off, so that apps that connect to your > provider directly can find the message in their own copy. A `Message-ID` usually looks like > ``, so it often reveals the domain of the system that sent the > mail. A device only gets a push when the user's notification settings allow it (mode, quiet hours, mailbox choices) and notifications are turned on for that device. ## What the relay does with it 1. It checks the Hub ID and secret against its database, and that the Hub is not disabled. 2. It checks each message: the platform, the token format (APNs tokens must be hex), the `type`, the sizes. Titles over 256 and bodies over 1024 characters are shortened. 3. It counts the messages against the Hub's rate limit. 4. It builds the Apple or Google request (below), sends it, and returns for each message whether it was delivered and whether the token is dead. 5. It adds the number of accepted messages to the Hub's counter and sets the time of the last push. These are written to the database once a minute. Nothing about the message or the device is written anywhere. The payload exists only in memory for the time of the request. ## What the relay stores `relay.db` (SQLite, in `RELAY_DATA_DIR`) has one table, `hubs`, with one row per registered Hub: | Column | Content | |---|---| | `id` | The random Hub ID (`hub_...`). | | `secret_hash` | SHA-256 hash of the Hub's secret. The secret itself is never stored. | | `name` | The name the Hub sent. | | `version` | The version the Hub sent. | | `created_at` | When it registered. | | `last_push_at` | When it last pushed. | | `pushes` | How many messages it has pushed in total. | | `disabled` | Whether an operator disabled it. | There is no table of devices, tokens, users or messages. In memory only, the relay keeps rate-limit counters: one per Hub ID, and one per client IP address for registrations. They are dropped once they have refilled and are lost when the relay restarts. ### Retention | Data | How long | |---|---| | Payloads and device tokens | Only while the request is being handled. | | Hub rows in `relay.db` | Until the operator runs `postern-relay hubs delete ID`. There is no automatic expiry. | | Rate-limit counters | In memory, until refilled or until a restart. | | Logs | Whatever your log system keeps (journald or Docker). The relay itself writes no log files. | | Undelivered pushes at Apple and Google | The relay asks both to drop a push after 24 hours if the phone could not be reached. | ## Logs The relay logs to standard error. What it writes, by level: | Level | Line | Fields | |---|---|---| | `info` | `starting` | Version, listen address, registration mode, APNs host, FCM project ID, push limit. | | `info` | `hub registered` | Hub ID, the Hub's version. | | `info` | `push` | Hub ID, number of messages, delivered, unregistered, failed, milliseconds. | | `warn` | `push rate limited` | Hub ID, number of messages. | | `warn` | `request` | For server errors (5xx): method, path, status, milliseconds. | | `debug` | `request` | Every request: method, path, status, milliseconds. | | `debug` | `push failed` | Hub ID, platform, an 8-character fingerprint of the token (from its SHA-256 hash), the provider's HTTP status and reason. | The relay never logs payloads, secrets, full device tokens, query strings or client IP addresses. A reverse proxy in front of it may log client addresses (your Hub's IP) by itself; configure that in the proxy. The Hub logs `registered with push relay` (relay URL and Hub ID) and, at debug level, `relay push rejected` with the error code. It never logs the payload either. ## What Apple and Google see They receive what the relay forwards, plus what any push service sees: the relay's IP address, the time, and the device token, which they can tie to a device and an app. ### Apple (iOS) The relay sends an HTTP/2 request to `api.push.apple.com` (or the sandbox host) for the device token, signed with your APNs key: | Header | Value | |---|---| | `apns-topic` | The app's bundle ID (`APNS_TOPIC`). | | `apns-push-type` | `alert`. | | `apns-priority` | `10`. | | `apns-expiration` | 24 hours from now. | | `apns-collapse-id` | The collapse key (thread ID). | The body: | Key | Previews off | Previews on | |---|---|---| | `aps.alert.title` | Generic title ("New mail", ...) | Sender name | | `aps.alert.subtitle` | none | Subject | | `aps.alert.body` | none | First words | | `aps.sound` | `default` | `default` | | `aps.thread-id` | Thread ID | Thread ID | | `aps.category` | `mail` (the notification's Archive and Mark as Read buttons) | `mail` | | `aps.mutable-content` | `1` | `1` | | `type`, `hubId`, `threadId`, `messageIdHeader` | sent | sent | | `senderEmail` | none | Sender's address | `mutable-content` lets the app's notification extension change the notification before it is shown. With previews on, it uses `senderEmail` to show the sender's picture: a photo from the phone's contacts if there is one, otherwise the icon of the sender's domain, which it loads from DuckDuckGo's icon service (`icons.duckduckgo.com`). Only the domain name leaves the phone for that, and not for addresses on public mail services such as gmail.com. With previews off, there is no sender address and no lookup. ### Google (Android) The relay sends a Firebase Cloud Messaging v1 request for your Firebase project: | Field | Previews off | Previews on | |---|---|---| | `notification.title` | Generic title | Sender name | | `notification.body` | none | First words | | `data.type`, `data.hubId`, `data.threadId` | sent | sent | | `data.title`, `data.body` | `data.title` only | both | | `android.priority` | `HIGH` | `HIGH` | | `android.collapse_key`, `android.notification.tag` | Collapse key | Collapse key | | `android.ttl` | `86400s` (24 hours) | `86400s` | The subject, `senderEmail` and `messageIdHeader` are not passed to Google. On Android a notification with previews shows the sender and the first words, but not the subject. ### How to send them less - Turn off previews: web app **Settings → Notifications → Show sender and subject on phones**, or mobile app **Settings → Notifications → Show previews on phones**. The setting applies to all your phones. - Turn off notifications for a device: **Settings → Notifications → Notifications** in the mobile app. The device's token is then removed from the Hub. - Do not set `POSTERN_RELAY_URL` at all. Then nothing goes to a relay, Apple or Google, and phones show new mail only when you open the app. ## What the Hub stores for push For completeness: the device tokens live on your Hub, in the `push_registrations` table of `hub.db` (device, user, kind, token, platform). They are not encrypted at the application level; see [Encryption at rest](https://docs.posternmail.app/security/encryption/). The relay's secret is stored encrypted with the Hub's master key. --- # Users and invites > Add people to your Hub with invites or from the command line, manage roles, reset passwords and two-step verification, and delete accounts. Source: https://docs.posternmail.app/admin/users/ One Hub can hold several people. Each person has their own account with their own mailboxes, settings, devices and encryption key. This page explains how people get an account, what admins can do for them, and what happens when an account is deleted. The first account is created by the setup wizard (see [Set up your Hub](https://docs.posternmail.app/setup/)). Everything after that happens in the admin panel of the web app (**Settings → Admin**) or with `postern-hub admin` on the server. ## Roles There are two roles: | Role | Can do | |---|---| | **Member** | Use the Hub: add their own mailboxes, read and send mail, manage their own devices, passkeys and two-step verification. | | **Admin** | Everything a member can, plus the admin panel: Hub name, who may join, invites, other people's passwords, disabling accounts, the Google and Microsoft sign-in clients, and the list of every mailbox on the Hub with its sync status. | Admins can see the address, owner and sync status of every mailbox on the Hub, but not anyone else's mail. There is no "super user" view of another person's inbox. Rules that protect the Hub from losing its last admin: - The person who completes the setup wizard is an admin. - The first account created with `admin create-user` is always an admin, even without `--admin`. - The last active admin cannot be disabled, demoted or deleted while other people have an account. The Hub answers "This is the only administrator. Make another user an administrator first." - In the admin panel you cannot disable or reset yourself: the buttons only appear next to other people. > [!NOTE] > Changing the role of an existing account is not available in the admin panel or the CLI yet. > The Hub's API accepts it (`PATCH /api/v1/admin/users/{id}` with `{"role": "admin"}`, see the > [API reference](https://docs.posternmail.app/reference/api/)), but there is no button for it. To make someone an > admin today, invite them with the **Admin** role or create them with `--admin`. ## Who can join: registration The **New accounts** setting in **Settings → Admin → Your Hub** decides whether invite links work. It has two values: | Value | Shown as | What it means | |---|---|---| | `invite` | **By invite** | Default. Admins create invite links; each link creates one account. Nobody can sign up without one. | | `closed` | **Closed** | Nobody can join. Existing invite links stop working ("This invite can't be used") until you switch back. | There is no open sign-up: a Hub never lets strangers create accounts on their own. Two ways around the setting exist, both under your control as the admin: - `postern-hub admin create-user` on the server works in either mode. - Single sign-on with `POSTERN_OIDC_AUTO_REGISTER=true` creates accounts for new people from your identity provider in either mode. See [Sign-in methods](https://docs.posternmail.app/admin/sign-in/#single-sign-on-oidc). ## Invite someone ### In the admin panel 1. Open **Settings → Admin** and, under **People**, click **Invite someone**. 2. Optionally fill in **Their email (optional)**. With an address, only that person can use the link: the account must be created with exactly that email. Leave it empty for a link anyone can use. 3. Choose the **Role**: **Member** or **Admin**. 4. Click **Create invite link**. The dialog shows the link ("Send this link. It works once and expires in 7 days."). Click **Copy link** and send it to the person yourself. The Hub does not send email. The link looks like `https://mail.example.com/invite/7RTk4K-6ekKi_orMcTed`. The person opens it, sees **Join** followed by your Hub's name, and enters their name, email and a password of at least 10 characters. They are signed in right away and land in the web app, where they can add their first mailbox. **Open invites** lists every unused invite with its address (or "Anyone with the link"), its role and when it expires. **Copy link** copies it again; the bin icon revokes it ("The link stops working."). Used invites disappear from the list. > [!IMPORTANT] > The link is built from `POSTERN_PUBLIC_URL`. If that is not set, the Hub uses the address your > browser used to open the admin panel. Make sure the person can reach that address: a link > that starts with `http://localhost:8080` only works on the Hub's own machine. ### From the command line `postern-hub admin invite` creates the same kind of invite. | Flag | Default | Meaning | |---|---|---| | `--email E` | none | Only this address can use the invite. | | `--role member\|admin` | `member` | The role of the new account. | **Docker Compose:** ```sh cd ~/postern docker compose exec hub postern-hub admin invite --email alex@example.com --role member ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub admin invite --email alex@example.com --role member' ``` **Desktop app (built-in Hub):** The desktop app's built-in Hub has no command line. Use **Settings → Admin → Invite someone** in the app. Keep in mind that the built-in Hub only listens on `127.0.0.1`, so other people cannot reach it from their devices: move to a server first (see [Backups and restore](https://docs.posternmail.app/admin/backups/#move-from-the-desktop-app-to-a-server)). The output: ```text ✓ Invite created (member, valid until 2026-12-12T15:33Z) https://mail.example.com/invite/7RTk4K-6ekKi_orMcTed ``` Without `POSTERN_PUBLIC_URL` it prints `Open /invite/` and a reminder to set the variable. Unlike the admin panel, the CLI does not refuse an address that already has an account; such an invite simply cannot be used. ### Invite rules | Rule | Value | |---|---| | Lifetime | 7 days from creation. Unused expired invites are deleted automatically. | | Uses | One. The second person to open the link gets "This invite is invalid, expired or already used". | | Email lock | With an email, any other address gets "This invite is for a different email address". | | Registration closed | The link shows "This invite can't be used". | | Account type | Email and password. Two-step verification and passkeys are added afterwards in **Settings → Security**. | ## Create an account on the command line `postern-hub admin create-user` creates an account directly, without an invite and without the setup wizard. It works when registration is closed and before the Hub has ever been opened in a browser. | Flag | Required | Meaning | |---|---|---| | `--email E` | yes | The sign-in email. Stored in lower case. It does not have to be a mailbox you connect. | | `--name N` | yes | Display name, up to 100 characters. | | `--password P` | no | At least 10 characters. Without it the Hub generates one (four groups of five letters and digits) and prints it. | | `--admin` | no | Make the account an admin. The first account on a Hub is always an admin. | **Docker Compose:** ```sh cd ~/postern docker compose exec hub postern-hub admin create-user --email alex@example.com --name "Alex Smith" ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub admin create-user --email alex@example.com --name "Alex Smith"' ``` **Desktop app (built-in Hub):** Not available: the built-in Hub has no command line. Create the first account in the app's setup screen and invite everyone else from **Settings → Admin**. ```text ✓ Created member alex@example.com (usr_01m93debcyh0ddt55f539tfqzt) Password: gEhdF-jKgmT-msm8w-dX5u5 Ask the user to change it after signing in. ``` Pass the password on privately. The person changes it in **Settings → Account → Password**. > [!TIP] > Avoid `--password` on shared machines: the value ends up in your shell history and is visible > in the process list while the command runs. Let the Hub generate one instead. Possible errors: | Message | Cause | |---|---| | `--email: enter a valid email address` | The address is empty or malformed. | | `--name is required` | `--name` is missing or blank. | | `--password must be at least 10 characters` | The password is too short. | | `An account with this email address already exists` | Each email can have one account. | ## List accounts **Docker Compose:** ```sh cd ~/postern docker compose exec hub postern-hub admin list-users ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub admin list-users' ``` **Desktop app (built-in Hub):** Not available on the command line. **Settings → Admin → People** lists everyone. ```text EMAIL NAME ROLE 2FA STATUS CREATED ID you@example.com Sam Smith admin totp active 2026-11-02 usr_01m8... alex@example.com Alex Smith member - disabled 2026-12-05 usr_01m9... ``` | Column | Values | |---|---| | `2FA` | `totp` when two-step verification is on, otherwise `-`. Passkeys are not shown here. | | `STATUS` | `active`, `disabled` (an admin disabled the account) or `deleting` (scheduled for deletion by `delete-user`, see below). | **Settings → Admin → People** shows the same people with their number of mailboxes, whether two-step verification is on and when one of their devices was last seen. ## Reset a password Use this when someone forgot their password. The old password stops working immediately and **every device of that person is signed out**. **In the admin panel:** **Settings → Admin → People**, then **Reset password…** next to the person. After you confirm, a dialog shows a temporary password once ("Pass it on privately. It isn't shown again"). The person signs in with it and sets a new one in **Settings → Account**. **On the command line:** | Flag | Required | Meaning | |---|---|---| | `--email E` | yes | The account. | | `--password P` | no | The new password (at least 10 characters). Without it a temporary one is generated and printed. | **Docker Compose:** ```sh cd ~/postern docker compose exec hub postern-hub admin reset-password --email alex@example.com ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub admin reset-password --email alex@example.com' ``` **Desktop app (built-in Hub):** Not available on the command line. Another admin can use **Reset password…** in **Settings → Admin**. If you are the only person on the built-in Hub and forgot your password, there is no reset: see the [desktop app page](https://docs.posternmail.app/apps/desktop/). ```text ✓ Password reset for alex@example.com; all of their devices were signed out. Temporary password: Pq7xK-mnRt3-ZbW9c-4hJkd ``` The CLI is the way back in when **you** are the admin who forgot the password: it needs access to the server, not an account. The reset appears in the person's security log as "Password changed". ## Turn off two-step verification for someone If someone lost their authenticator app and their recovery codes, an admin can turn two-step verification off for them. This is only possible on the command line, there is no button in the admin panel. **Docker Compose:** ```sh cd ~/postern docker compose exec hub postern-hub admin disable-2fa --email alex@example.com ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub admin disable-2fa --email alex@example.com' ``` **Desktop app (built-in Hub):** Not available: the built-in Hub has no command line. ```text ✓ Two-factor authentication disabled for alex@example.com ``` It removes the authenticator secret and all recovery codes. The person's devices stay signed in and their passkeys keep working. They can sign in with their password alone and set up two-step verification again in **Settings → Security**. Confirm who is asking before you do this: it removes the second factor that protects the account. ## Disable an account **Settings → Admin → People → Disable…** blocks an account without deleting anything. The person is signed out everywhere and cannot sign in ("This account has been disabled.") until you click **Enable**. Their mailboxes, mail and settings are kept. Disabling only blocks sign-in: the Hub keeps syncing their mailboxes in the background. There is no CLI command for this. ## Delete an account Deleting an account removes the person and everything they have on the Hub. There are two ways: - The person deletes their own account in **Settings → Account → Delete account…**. They have to enter their password. - An admin runs `postern-hub admin delete-user`. The admin panel has no delete button. | Flag | Meaning | |---|---| | `--email E` | The account to delete (required). | | `--yes` | Do not ask. Without it the command asks "Delete … and ALL of their mailboxes, mail and settings? This cannot be undone. [y/N]", and without a terminal it stops with "aborted (pass --yes to confirm non-interactively)". | **Docker Compose:** ```sh cd ~/postern docker compose exec hub postern-hub admin delete-user --email alex@example.com ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** ```sh sudo -u postern sh -c 'set -a; . /etc/postern/hub.env; exec postern-hub admin delete-user --email alex@example.com' ``` **Desktop app (built-in Hub):** Not available on the command line. A person can delete their own account in **Settings → Account → Delete account…**. ```text ✓ alex@example.com is signed out everywhere and scheduled for deletion. The running Hub deletes the account and its data within a minute. ``` The command signs the person out at once and marks the account for deletion. The running Hub finishes the job within a minute; if the Hub is stopped, it does so on its next start. `list-users` shows the account as `deleting` until then. ### What is deleted From the Hub: - the account, its devices and sessions, passkeys, two-step verification secret and recovery codes, security log and settings; - every mailbox of the account with its saved sign-in (password or OAuth token); - the Hub's copy of their mail: messages, threads, folders, the search index, attachments and the encrypted files in `blobs/`; - their tags, Spaces, splits, templates, identities, sender lists, rules and rule history, drafts and queued sends; - the person's own encryption key. Not deleted: - **Mail at the providers.** Postern never deletes anyone's Gmail, Outlook or IMAP mail when an account goes away. Tags that Postern stored as IMAP keywords (`$MC_...`) stay on the mail server. - **Copies on devices.** Desktop and mobile apps remove their local copy the next time they connect and find the session gone. - **Backups.** See below. > [!WARNING] > **Deleted accounts stay in backups.** Scheduled backups and the `pre-migrate-*.db` copies the Hub > makes before upgrades still contain the account, its mail and its encryption key. Anyone with > those backups and the Hub's master key can restore them. If you promise someone deletion (for > example under the GDPR), delete or wait out the backups too. See > [Backups and restore](https://docs.posternmail.app/admin/backups/#deleted-accounts-and-the-gdpr). ## Each person's data and key Every account gets its own random data key when it is created. That key encrypts the person's saved mailbox sign-ins, their two-step verification secret, their passkeys and the files in `blobs/` (message bodies, attachments, uploads). The data key itself is stored in the database, encrypted with the Hub's master key (`hub.key`). What that means in practice: - One person's data cannot be decrypted with another person's key. - Deleting an account deletes its key, so any leftover encrypted file of that person is unreadable from then on. - Everyone depends on the one master key file. Lose it and nobody's data can be read. Back it up (see [Backups and restore](https://docs.posternmail.app/admin/backups/)). - People's own exports: **Settings → Account → Your data → Download** gives each person a JSON file with their profile, devices, passkey names, security log, settings, mailboxes (without their passwords or tokens), tags, Spaces, rules, templates and drafts. It does not contain the mail itself. More about the encryption: [Encryption](https://docs.posternmail.app/security/encryption/). --- # Sign-in methods > How people sign in to a Postern Hub - passwords, two-step verification, passkeys and single sign-on with Authelia, Authentik or Keycloak - plus sessions, re-authentication and rate limits. Source: https://docs.posternmail.app/admin/sign-in/ This page covers every way to sign in to a Hub, the rules behind each one, and how to connect your own identity provider for single sign-on. It also explains how long sessions last, when the Hub asks people to confirm it's them again, and how it slows down password guessing. | Method | Where | Needs | |---|---|---| | Email and password | Every Hub | Nothing. Always available. | | Two-step verification (authenticator app) | Added to password sign-in | Each person turns it on in **Settings → Security**. | | Passkey | Sign-in page, **Sign in with a passkey** | HTTPS with a domain name, or `localhost`. | | Single sign-on (OIDC) | Sign-in page, **Continue with** followed by your provider's name | `POSTERN_OIDC_*` variables. | | Code from another device | Sign-in page, **Sign in with a code from another device** | A device that is already signed in. See [Pairing](https://docs.posternmail.app/apps/pairing/). | ## Passwords | Rule | Value | |---|---| | Minimum length | 10 characters (counted as characters, so accents and emoji count once) | | Maximum length | 1024 bytes | | Other rules | None. No required digits or symbols, no forced expiry. A long passphrase is the best choice. | | Storage | Argon2id hash (64 MiB memory, 3 passes, 2 threads, random salt). The password itself is never stored. | | Email | Not case-sensitive. `Alex@Example.com` and `alex@example.com` are the same account. | A wrong email and a wrong password give the same answer, "Incorrect email or password", and take the same time, so the sign-in page does not reveal which accounts exist. People change their password in **Settings → Account → Password** (current password, then new password, then **Change password**). Their other devices are signed out ("Password changed. Your other devices were signed out."). Forgotten passwords are reset by an admin: see [Reset a password](https://docs.posternmail.app/admin/users/#reset-a-password). ## Two-step verification Two-step verification adds a 6-digit code from an authenticator app (1Password, Authy, Google Authenticator, Aegis and similar) to every **password** sign-in. ### Turn it on 1. Open **Settings → Security** and click **Set up** next to **Two-step verification**. 2. Scan the QR code with your authenticator app, or type the key shown under **Or enter this key**. The entry is named after your Hub and your sign-in email. 3. Enter the 6-digit code under **Code from the app** and click **Turn on**. 4. **Save your recovery codes.** The Hub shows 10 codes such as `k7qfm-2x9hc`. Each works once if you lose your phone, and they are not shown again. Click **Copy**, store them in a password manager or on paper, then click **I saved them**. > **Check:** sign out and sign in again. After the password, the page asks for "the 6-digit code > from your authenticator app". > **If it did not work:** "That code is not correct" during setup almost always means the clock of > the phone or the Hub is off. Codes change every 30 seconds and the Hub accepts the code before > and after the current one. Turn on automatic time on the phone and NTP on the server > (`timedatectl` on Linux shows "System clock synchronized: yes"). ### How codes work | Detail | Value | |---|---| | Code format | 6 digits, new every 30 seconds (TOTP, SHA-1) | | Clock tolerance | One step either way (about 30 seconds) | | Reuse | Each code works once. A code already used is refused even within its 30 seconds. | | Recovery codes | 10, each usable once. Turning two-step verification off and on again creates a new set. | | Storage | The secret is encrypted with the person's own data key. Recovery codes are stored as hashes. | ### Sign in with a recovery code On the two-step page click **Use a recovery code instead** and enter one of the codes (dashes and capitals do not matter). The code is then used up. When the last codes run low, turn two-step verification off and on again to get a new set. ### Turn it off **Settings → Security → Turn off…** asks for the password ("Your password alone will be enough to sign in. Enter it to confirm."). Accounts without a password (created by single sign-on) confirm with a current code instead. If someone lost both the phone and the recovery codes, an admin turns it off on the server with `postern-hub admin disable-2fa`. See [Users and invites](https://docs.posternmail.app/admin/users/#turn-off-two-step-verification-for-someone). > [!NOTE] > Two-step verification only applies to password sign-in. Passkeys already combine something > you have with your device's lock, and with single sign-on your identity provider is in charge > of the second factor. Neither asks for the code. ## Passkeys A passkey signs you in with Face ID, Touch ID, Windows Hello, your phone or a security key, without typing the email or password. ### Requirements Passkeys (WebAuthn) only work in what browsers call a secure context, and they are tied to one domain name. The Hub offers them only when its address meets both: | Hub address | Passkeys | |---|---| | `https://mail.example.com` | Yes | | `https://hub.tailnet-1234.ts.net` | Yes | | `http://localhost:8080`, `http://postern.localhost:8080` | Yes (on that computer only) | | `http://192.168.1.20:8080` | No: plain HTTP | | `https://192.168.1.20` | No: an IP address cannot own a passkey | | `http://127.0.0.1:8080` | No: an IP address, use `http://localhost:8080` instead | The address is `POSTERN_PUBLIC_URL`, or the address in the browser when the variable is not set. When passkeys are unavailable, **Settings → Security** says "Passkeys only work when your Hub is opened over a secure (https) address." and the sign-in page has no passkey button. See [HTTPS](https://docs.posternmail.app/reach/https/) for ways to get a certificate. ### Add and use a passkey 1. Sign in to the web app at your Hub's HTTPS address. 2. Open **Settings → Security** and click **Add a passkey**. Follow your browser's prompt. 3. The passkey appears in the list, named after the device you added it on, with **Added** and **last used** dates. **Remove** deletes it. To sign in, click **Sign in with a passkey** on the sign-in page. You do not need to enter your email: the browser offers the passkeys it has for this Hub. The desktop and mobile apps that get mail directly from your providers do not manage passkeys themselves. Their **Settings → Security** shows "Manage passkeys in the web app at" followed by your Hub's address, with an **Open web app** button. > [!WARNING] > A passkey belongs to the exact domain it was created on. If you move the Hub to another > address (a new domain, from Tailscale to your own domain, from the desktop app to a server), > existing passkeys stop working. Sign in with your password at the new address and add new > passkeys there. ## Single sign-on (OIDC) If you run an identity provider such as Authelia, Authentik or Keycloak, people can sign in to the Hub with it. The sign-in page then shows **Continue with** followed by the name you choose. ### Settings Set these on the Hub, then restart it. | Variable | Default | Meaning | |---|---|---| | `POSTERN_OIDC_ISSUER` | empty | The issuer URL of your provider, exactly as its discovery document states it (see below). Empty turns single sign-on off. | | `POSTERN_OIDC_CLIENT_ID` | empty | The client ID you registered. Required together with the issuer. | | `POSTERN_OIDC_CLIENT_SECRET` | empty | The client secret. | | `POSTERN_OIDC_NAME` | `Single sign-on` | The button label: `Continue with Authentik`. | | `POSTERN_OIDC_AUTO_REGISTER` | off | Create an account for anyone your provider signs in who has no account yet. They become a **member**, without a password. This works even when **New accounts** is set to **Closed**: your provider decides who gets in. | | `POSTERN_OIDC_LINK_BY_EMAIL` | off | On someone's first single sign-on, attach it to the existing Hub account with the same email. See [Linking existing accounts](https://docs.posternmail.app/admin/sign-in/#linking-existing-accounts). | What to register with your provider: | Setting | Value | |---|---| | Redirect URI | `{POSTERN_PUBLIC_URL}/api/v1/auth/oidc/callback`, for example `https://mail.example.com/api/v1/auth/oidc/callback` | | Client type | Confidential (with a client secret) | | Grant type | Authorization code. The Hub always uses PKCE (S256) and a nonce. | | Scopes the Hub requests | `openid email profile` | | Claims the Hub reads from the ID token | `sub`, `email`, `email_verified`, `name`, `preferred_username` | | Token endpoint authentication | `client_secret_basic` (the Hub falls back to `client_secret_post`) | > [!IMPORTANT] > Set `POSTERN_PUBLIC_URL`. Without it the Hub builds the redirect URI from the address each > browser used, and your provider rejects any address you did not register. > [!IMPORTANT] > The Hub needs `email` and `email_verified: true` **in the ID token**. Without a verified email > nobody can be linked or registered, and the sign-in page shows "Your sign-in provider did not > confirm a verified email address for this account." Some providers leave these claims out of > the ID token by default; the examples below show how to include them. The issuer must match character for character, including a trailing slash if your provider uses one. To see the right value, open `/.well-known/openid-configuration` in a browser and copy the `issuer` field. Where to put the variables: **Docker Compose:** `compose.yaml` does not pass the `POSTERN_OIDC_*` variables through `.env`. Add them to `~/postern/compose.override.yaml`: ```yaml services: hub: environment: POSTERN_OIDC_ISSUER: https://auth.example.com POSTERN_OIDC_CLIENT_ID: postern POSTERN_OIDC_CLIENT_SECRET: paste-the-secret-here POSTERN_OIDC_NAME: Authelia ``` Then apply it: ```sh cd ~/postern docker compose up -d ``` **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add the lines to `/etc/postern/hub.env` (one `KEY=value` per line, no inline comments): ```ini POSTERN_OIDC_ISSUER=https://auth.example.com POSTERN_OIDC_CLIENT_ID=postern POSTERN_OIDC_CLIENT_SECRET=paste-the-secret-here POSTERN_OIDC_NAME=Authelia ``` Then restart: ```sh sudo systemctl restart postern-hub ``` **Desktop app (built-in Hub):** The desktop app's built-in Hub cannot be configured with environment variables, and it is only reachable as `http://localhost` on that computer. Single sign-on needs a Hub on a server. > **Check:** run `postern-hub doctor` (see [Doctor](https://docs.posternmail.app/admin/doctor/)). Under **Sign-in & providers** it > shows `✓ OIDC issuer https://auth.example.com reachable ("Authelia")`. Then open the sign-in page > in a private window: the **Continue with Authelia** button is there. > **If it did not work:** `✗ OIDC issuer ... is not reachable` means the Hub cannot fetch the > discovery document: check DNS and the firewall from the Hub's machine. `OIDC is partially > configured` means the issuer or the client ID is missing. A redirect error at your provider > means the redirect URI does not match. A message on the Hub's sign-in page is explained in > the table below. ### Example: Authelia Authelia's issuer is its own address, for example `https://auth.example.com`. Generate a client secret and its hash with Authelia's tool: ```sh authelia crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986 ``` The `Random Password` goes into `POSTERN_OIDC_CLIENT_SECRET`, the `Digest` into Authelia's configuration: ```yaml identity_providers: oidc: claims_policies: postern: id_token: ['email', 'email_verified', 'name', 'preferred_username'] clients: - client_id: 'postern' client_name: 'Postern' client_secret: '$pbkdf2-sha512$310000$...' public: false authorization_policy: 'two_factor' claims_policy: 'postern' require_pkce: true pkce_challenge_method: 'S256' redirect_uris: - 'https://mail.example.com/api/v1/auth/oidc/callback' scopes: ['openid', 'email', 'profile'] response_types: ['code'] grant_types: ['authorization_code'] token_endpoint_auth_method: 'client_secret_basic' ``` The `claims_policies` block puts the email and name into the ID token, which recent Authelia versions no longer do by default. Authelia marks an email as verified when it comes from its user database or LDAP. Hub settings: ```ini POSTERN_OIDC_ISSUER=https://auth.example.com POSTERN_OIDC_CLIENT_ID=postern POSTERN_OIDC_CLIENT_SECRET=the-random-password POSTERN_OIDC_NAME=Authelia ``` ### Example: Authentik 1. In the Authentik admin interface, open **Applications → Providers → Create**, choose **OAuth2/OpenID Provider**. 2. Name it `Postern`, pick an authorization flow, set **Client type** to **Confidential**, and add the redirect URI `https://mail.example.com/api/v1/auth/oidc/callback` (mode strict). 3. Under advanced settings keep the scopes `openid`, `email` and `profile`, and leave **Include claims in id_token** on. 4. Create an application (**Applications → Create**) with the slug `postern` and select the provider. Copy the **Client ID** and **Client Secret** from the provider. Authentik's issuer contains the application slug and ends with a slash: ```ini POSTERN_OIDC_ISSUER=https://auth.example.com/application/o/postern/ POSTERN_OIDC_CLIENT_ID=the-client-id POSTERN_OIDC_CLIENT_SECRET=the-client-secret POSTERN_OIDC_NAME=Authentik ``` Check the `email_verified` value Authentik sends for your users (the provider's **Preview** tab shows the ID token). If it is `false`, add a scope mapping for the `email` scope that returns `email_verified: True` for the users whose addresses you manage, and select it in the provider instead of the default one. ### Example: Keycloak 1. In your realm, open **Clients → Create client**. Client type **OpenID Connect**, client ID `postern`. 2. Turn **Client authentication** on and keep **Standard flow** checked. 3. Set **Valid redirect URIs** to `https://mail.example.com/api/v1/auth/oidc/callback` and **Web origins** to `https://mail.example.com`. 4. Optionally set **Advanced → Proof Key for Code Exchange Code Challenge Method** to `S256`. 5. Copy the secret from the **Credentials** tab. Keycloak 17 and later use `/realms/` (older versions `/auth/realms/`): ```ini POSTERN_OIDC_ISSUER=https://auth.example.com/realms/home POSTERN_OIDC_CLIENT_ID=postern POSTERN_OIDC_CLIENT_SECRET=the-client-secret POSTERN_OIDC_NAME=Keycloak ``` Keycloak sends `email_verified` from each user's **Email verified** switch. Turn it on for the people who should be able to use the Hub. ### How the Hub finds the account On every single sign-on the Hub looks for the account in this order: 1. **An account already linked to this identity.** The link is the issuer plus the provider's user ID (`sub`). Changing `POSTERN_OIDC_ISSUER` later breaks existing links. 2. **An account with the same verified email**, only if `POSTERN_OIDC_LINK_BY_EMAIL` is on. The identity is then linked for good. 3. **A new member account**, only if `POSTERN_OIDC_AUTO_REGISTER` is on. Its name comes from `name`, then `preferred_username`, then the part of the email before the `@`. It has no password, so it signs in with single sign-on (or a passkey added later). Accounts created with an invite or `create-user` can be linked by step 2. The first account of a Hub cannot be created by single sign-on: run the setup wizard first. ### Linking existing accounts With `POSTERN_OIDC_LINK_BY_EMAIL` off (the default), people who already have a password account cannot use single sign-on for it. Turn it on only if your provider verifies email addresses and nobody else can register one of your users' addresses there: whoever controls that address at the provider gets into the Hub account. One extra guard applies even when it is on: if an account's sign-in email was changed in the last 7 days, it is not linked. This stops someone who just changed an account's email to their own address from taking it over through the provider. ### Messages on the sign-in page | Message | What to do | |---|---| | "Your sign-in provider did not confirm a verified email address for this account." | Send `email` and `email_verified: true` in the ID token (see the examples). | | "An account for ... already exists on this Hub but is not linked to single sign-on. ..." | Sign in with the password, or turn on `POSTERN_OIDC_LINK_BY_EMAIL`. | | "The sign-in email of this account was changed recently, so it can't be linked to single sign-on yet. ..." | Wait until 7 days after the change, or sign in with the password. | | "This account is linked to a different single sign-on identity." | The account is already linked to another user at the provider. | | "There is no account for ... on this Hub. Ask the administrator for an invite." | Invite the person, or turn on `POSTERN_OIDC_AUTO_REGISTER`. | | "This account has been disabled." | An admin disabled the account. | | "This sign-in link is not valid in this browser. Please try again." | The sign-in was started in another browser, or cookies are blocked. | | "This sign-in attempt has expired. Please try again." | More than 10 minutes passed at the provider. | | "Sign-in failed: the identity token could not be verified." | Wrong client ID, an issuer that does not match, or a clock that is off. The Hub log has the reason (`oidc id token rejected`). | | "The sign-in provider is unreachable." | The Hub cannot reach the issuer. Run `doctor`. | | "Sign-in was cancelled: ..." | The provider returned an error; its text follows. | ## Sessions and signing out devices Each sign-in creates a device with its own session. **Settings → Devices** lists them ("Everywhere you're signed in."), with **This device** marked. | Client | Session lifetime | |---|---| | Web app and desktop app | 30 days, extended every time the device is used | | iOS and Android | 90 days, extended every time the device is used | A device you keep using stays signed in. A device unused for longer than its lifetime is signed out and removed from the list. Ways a session ends: | Action | Effect | |---|---| | **Settings → Devices → Sign out…** on a device | That device is signed out now. Its saved mail is removed the next time it connects. | | **Sign out** in **Settings → Account** | This device only. | | Changing your password | Every other device is signed out. | | An admin resets your password, disables or deletes the account | Every device is signed out. | Lost a phone or a laptop? Sign it out under **Settings → Devices** from any other device, then change your password if it was not locked. The web app and the desktop app keep the session in an HttpOnly cookie named `mc_session`; the mobile apps use a bearer token. ## Confirming it's you again Some actions need proof that the person at the keyboard is the account owner, not just someone with a signed-in browser. The Hub counts a password, a two-step code, a passkey or a single sign-on on this device within the **last 10 minutes** as proof. | Action | What the Hub asks for | |---|---| | Change the password | The current password, always | | Turn off two-step verification | The password, always | | Delete the account | The password, always | | Change the sign-in email | The password, unless you signed in on this device within 10 minutes | | Allow a desktop or mobile app to sign in through the browser ("Sign in on ...?") | The password, unless you signed in within 10 minutes | | Approve a desktop or mobile app from **Connect a device** in the web app | The password, unless you signed in within 10 minutes | Accounts without a password (created by single sign-on) confirm with a two-step code if they have one. Otherwise they have to sign out and sign in again: the Hub says "For your security, please confirm it's you: sign out, sign in again and retry within 10 minutes." A wrong password during a confirmation counts as a failed sign-in for the lockout below. Desktop and mobile apps that fetch your mailbox sign-ins to get mail directly need a session that was created with a password, passkey or single sign-on (or confirmed that way when it was approved). Otherwise the app shows "Sign in on this device with your password, passkey or single sign-on to use your mailbox credentials here." ## Rate limits The Hub slows down guessing with limits kept in memory (a restart resets them). When a limit is hit, the request fails with "Too many attempts. Please wait a moment and try again." and a `Retry-After` header. | What | Per | Allowed | |---|---|---| | Sign-in attempts (password and passkey) | IP address | 20 at once, then 1 every 15 seconds | | Failed passwords and codes | Account (email) | 5, then 1 per minute; a successful sign-in resets it | | Setup wizard and invite registrations | IP address | 5 at once, then 1 per minute | | Pairing codes entered | IP address | 10 at once, then 1 every 30 seconds | | Other public sign-in requests (invite lookups, starting a passkey or single sign-on) | IP address | 30 at once, then 1 every 5 seconds | | Turning on two-step verification | Account | 5 tries, then 1 per minute | The account limit applies to addresses that do not exist too, so it does not reveal which accounts are real. Behind a reverse proxy the IP is only right if `POSTERN_TRUST_PROXY` and `POSTERN_TRUSTED_PROXIES` are set correctly (see [Configuration](https://docs.posternmail.app/configuration/)); otherwise every visitor shares the proxy's address and its limit. Failed sign-ins are not written to the Hub's log. Each person sees them in **Settings → Security → Recent security activity** as "Failed sign-in attempt", with the device name and IP address. --- # The admin panel > A tour of the admin panel in the web app - Hub status and warnings, Hub name, registration, people, invites, the Google and Microsoft sign-in clients and the mailbox overview - with every default. Source: https://docs.posternmail.app/admin/admin-panel/ The admin panel is where admins manage the Hub from the web app. This page walks through every section, what each value means and what it defaults to. Everything here can also be done or seen from the server in another way; those pages are linked where relevant. Open it with **Settings → Admin** (under **Hub** in the settings list), or go to `/settings/admin` on your Hub. Only admins see it; members who open the address get "Only admins of your Hub can see this page." The desktop app shows the same panel for the Hub it is connected to. If the Hub cannot be reached, the panel shows one notice ("These settings, the people and the invites are managed on your Hub") with a retry button instead of the sections. ## Status The top of the page shows how the Hub is doing. | Field | What it shows | |---|---| | **Version** | The Hub's version string. A Hub built from source without a version shows a placeholder such as `0.0.0-docker` or the output of `git describe`. | | **Running for** | Time since the Hub process started. | | **People** | Number of accounts. | | **Database** | Size of `hub.db` plus its write-ahead log. | | **Mail storage** | Size of `blobs/`: encrypted message bodies, attachments and uploads (recounted at most every 5 minutes). | | **Free disk space** | Free space on the disk that holds the data directory. | | **Web address** | `POSTERN_PUBLIC_URL`, or **Not set**. | | **Secure connection (https)** | **Yes** when the public URL starts with `https://` or the Hub terminates TLS itself. | | **Phone notifications** | The push relay: **Working**, **Can't be reached** or **Not set up** (no `POSTERN_RELAY_URL`). Checked at most every 5 minutes. | | **Last backup** | Time of the newest scheduled or manual backup in the backup directory, or **Never**. | ### Warnings Above the numbers, yellow banners point out problems. Each one goes away by itself once the cause is fixed. | Warning | Meaning and fix | |---|---| | "No public URL configured (POSTERN_PUBLIC_URL): links in invites and pairing codes use the address you opened the Hub with, and passkeys work only on localhost." | Set `POSTERN_PUBLIC_URL` to the address people use. See [Configuration](https://docs.posternmail.app/configuration/). | | "No HTTPS public URL: passkeys and Google sign-in unavailable." | The public URL uses `http://` and is not `localhost`. Put HTTPS in front: [HTTPS](https://docs.posternmail.app/reach/https/). | | "Less than 1 GB of free disk space left in the data directory." | Free up space or move the data directory to a bigger disk. Sync and backups fail when the disk is full. | | "Scheduled backups are disabled (POSTERN_BACKUP_INTERVAL=0)." | Turn them back on, or make sure you back up another way. See [Backups and restore](https://docs.posternmail.app/admin/backups/). | | "The last backup is older than expected. Check the Hub logs and the backup directory." | The newest backup is older than twice the interval plus an hour. Look for `scheduled backup failed` in the [logs](https://docs.posternmail.app/admin/logs/). | | "The push relay is unreachable: mobile notifications are delayed." | Check `POSTERN_RELAY_URL` and that the relay runs. See [Push relay](https://docs.posternmail.app/relay/). | | "The master key file is readable by other users. Run: chmod 600 ..." | Run the command shown, as the user that owns the file. | | "Development mode is on (POSTERN_DEV): security checks are relaxed." | Remove `POSTERN_DEV` on any Hub other people use. | `postern-hub doctor` checks the same things and more from the server: see [Doctor](https://docs.posternmail.app/admin/doctor/). ## Your Hub | Setting | Default | Meaning | |---|---|---| | **Name** | `Postern` (or what you typed in the setup wizard) | Shown on the sign-in page, in notifications, as the name of entries in authenticator apps and as the passkey site name. 1 to 80 characters. Click **Save**. | | **New accounts** | **By invite** | **By invite**: admins add people with an invite link. **Closed**: nobody can join, and open invite links stop working. Saved as soon as you click. See [Users and invites](https://docs.posternmail.app/admin/users/#who-can-join-registration). | The name is stored in the Hub's database, not in a configuration file. Authenticator entries and passkeys created before a rename keep the old name in their label; they still work. ## People Every account, oldest first. Each row shows the name, an **Admin** chip for admins and a **Disabled** chip for disabled accounts, then the email, the number of mailboxes, "two-step verification on" when it is, and when one of their devices was last seen. Buttons next to everyone except yourself: | Button | What happens | |---|---| | **Reset password…** | After confirming ("Their current password stops working right away."), a dialog shows a temporary password once. All of the person's devices are signed out. | | **Disable…** | The person is signed out everywhere and cannot sign in until you click **Enable**. Mailboxes and settings are kept. The last admin cannot be disabled. | | **Enable** | Lets a disabled person sign in again. | **Invite someone** opens the invite dialog: an optional email (**Their email (optional)**: "With an address, only that person can use the link.") and the **Role** (**Member** or **Admin**). **Create invite link** shows the link to copy. See [Users and invites](https://docs.posternmail.app/admin/users/#invite-someone). Not in the panel (use the command line, see [Users and invites](https://docs.posternmail.app/admin/users/)): - deleting an account (`postern-hub admin delete-user`; people can also delete their own account); - turning off someone's two-step verification (`postern-hub admin disable-2fa`); - changing the role of an existing account (not available yet, except through the API). ## Open invites Unused invites that have not expired, newest first, with the address or "Anyone with the link", the role and when it expires. **Copy link** copies the link again. The bin icon revokes the invite after you confirm. Invites expire after 7 days and work once. ## Sign-in with Google and Microsoft These are the OAuth clients people need to add Gmail and Outlook mailboxes by signing in with Google or Microsoft ("Without this they can still use an app password."). They are not used to sign in to the Hub itself. Each provider has a status chip: | Chip | Meaning | |---|---| | **Not set up** | No client. The provider's sign-in button is not offered when adding a mailbox. | | **Set up** | A client was saved here, in the admin panel. | | **Set in the Hub's configuration** | The client comes from environment variables. The fields are greyed out; change the variables instead. Environment variables always win over values saved here. | ### Google (Gmail) The panel lists the steps and shows the exact redirect URI to register, with a copy button: `{public URL}/api/v1/oauth/callback/google`. Paste the **Client ID** and **Client secret** and click **Save**. To change only the ID later, leave the secret field empty (it shows dots when a secret is stored); the stored secret is kept. The secret is stored in the database, encrypted with the master key. Google only accepts an HTTPS redirect URI (or `localhost`), so Google sign-in is offered only when the Hub is reached over HTTPS. Full walkthrough: [Gmail](https://docs.posternmail.app/providers/gmail/). Equivalent variables: `POSTERN_GOOGLE_CLIENT_ID` and `POSTERN_GOOGLE_CLIENT_SECRET`, set together. ### Microsoft (Outlook, Microsoft 365) Paste the **Application (client) ID** and the tenant (default `common`; also `organizations`, `consumers`, or your tenant ID or domain), then **Save**. People sign in with a code on Microsoft's page, so there is no redirect URI and no secret. Full walkthrough: [Microsoft](https://docs.posternmail.app/providers/microsoft/). Equivalent variables: `POSTERN_MICROSOFT_CLIENT_ID` and `POSTERN_MICROSOFT_TENANT`. > [!NOTE] > The panel has no button to remove a saved client. You can replace it with another one, or > override it with the environment variables. ## Mailboxes on your Hub A table of every mailbox on the Hub, for spotting trouble before people notice: | Column | Meaning | |---|---| | **Mailbox** | The address, with the mailbox's color. | | **Owner** | The sign-in email of the person it belongs to. | | **Status** | "Up to date", "Downloading mail, N% done", "Connecting…", "Having trouble getting new mail. Trying again automatically.", "The sign-in no longer works. Reconnect to keep getting mail." or "Paused. No new mail is fetched." **Technical details** shows the provider's own error text. | | **Messages** | How many messages of that mailbox the Hub has stored. The Hub keeps a full copy only while its owner uses the web app, so this can be far below the real count. | | **Behind by** | Time since the mailbox last finished a sync. | Only the owner can fix a mailbox's sign-in: ask them to open **Settings → Mailboxes** and reconnect it. Admins cannot read or change other people's mailboxes. ## What the admin panel does not have So you do not look for them: - **No update notice.** The Hub does not check for new versions and the panel only shows the version that runs. See [Upgrades](https://docs.posternmail.app/admin/upgrades/#knowing-when-there-is-a-new-version). - **No backup or restore buttons.** Backups run on a schedule; restores happen on the server. See [Backups and restore](https://docs.posternmail.app/admin/backups/). - **No logs view.** See [Logs](https://docs.posternmail.app/admin/logs/). - **No single sign-on settings.** Single sign-on is configured with `POSTERN_OIDC_*` variables: [Sign-in methods](https://docs.posternmail.app/admin/sign-in/#single-sign-on-oidc). - **No server settings** such as the public URL, push relay, TLS or storage limits. Those are environment variables: [Configuration](https://docs.posternmail.app/configuration/). ## Defaults at a glance | Setting | Default | Where to change | |---|---|---| | Hub name | `Postern` | **Your Hub → Name**, or the setup wizard | | New accounts | By invite | **Your Hub → New accounts** | | Invite role | Member | Invite dialog | | Invite lifetime | 7 days | Fixed | | Google client | Not set up | This panel or `POSTERN_GOOGLE_*` | | Microsoft client | Not set up, tenant `common` | This panel or `POSTERN_MICROSOFT_*` | --- # Backups and restore > What to back up on a Postern Hub, how scheduled and manual backups work, how to restore (also onto a new machine or from the desktop app to a server), off-site copies and what backups mean for deleted accounts. Source: https://docs.posternmail.app/admin/backups/ A Hub keeps everything in two places: the **data directory** and the **master key file**. This page shows how to back up both, how the Hub's automatic backups work, and how to restore them, on the same machine or a new one. Your mail itself lives at your providers (Gmail, Outlook, your IMAP server). A Hub backup protects what only the Hub knows: accounts, mailbox sign-ins, settings, tags, Spaces, rules and their history, drafts, the send queue, and the Hub's copy of mail. A Hub restored without its mail copy downloads the mail again from the providers. ## What to back up | | Data directory | Master key | |---|---|---| | Docker Compose | volume `postern_postern-data`, `/data` in the container | volume `postern_postern-key`, `/key/hub.key` in the container | | Debian, Fedora, Raspberry Pi OS | `/var/lib/postern` | `/var/lib/postern-key/hub.key` | | Desktop app (built-in Hub) | `hub-data/` in the app's data folder | `hub-key/hub.key` in the app's data folder | The app's data folder is `~/Library/Application Support/Postern` on macOS, `%APPDATA%\Postern` on Windows and `~/.config/Postern` on Linux. > [!IMPORTANT] > **Back up both, and keep them apart.** Everything sensitive in the data directory is encrypted > with keys that the master key unlocks. A backup without the key cannot be read by a thief, and > it cannot be read by you either. The Hub's backups never include the key file: copy it once, > to a different place (a password manager works well), and again after every `rotate-key`. ## What a backup contains The Hub writes each backup as a folder named after the time it was made (UTC): ```text backups/ backup-20261205-033000/ hub.db consistent copy of the database blobs/ encrypted message bodies, attachments and uploads manifest.json format, Hub version, creation time, applied migrations, file counts pre-migrate-20261201-101500.db ``` The database copy is taken with SQLite's `VACUUM INTO` while the Hub runs, so it is consistent without stopping anything. Files in `blobs/` are hard-linked when the backup folder is on the same file system as the data directory: they take no extra space, and seven backups do not use seven times the disk. Blob files are never changed in place, so a hard link is a real copy of the content as it was. On another file system they are copied. ## Scheduled backups The Hub makes a backup on its own every 24 hours, and the first one 5 minutes after its first start. It keeps the newest 7 and deletes older `backup-*` folders. | Variable | Default | Meaning | |---|---|---| | `POSTERN_BACKUP_INTERVAL` | `24h` | Time between backups, in Go duration syntax (`12h`, `168h`). `0` turns scheduled backups off. | | `POSTERN_BACKUP_KEEP` | `7` | How many `backup-*` folders to keep. At least 1. | | `POSTERN_BACKUP_DIR` | `/backups` | Where backups and `pre-migrate-*.db` copies go. | After a restart the schedule continues from the newest backup in the folder. A failed backup is logged as `scheduled backup failed`, and the admin panel warns when the newest backup is older than twice the interval plus an hour. To change these: **Docker Compose:** Add the variables to `~/postern/compose.override.yaml`. To keep backups outside the volume, mount a host folder owned by the container's user (uid 10001): ```yaml services: hub: environment: POSTERN_BACKUP_INTERVAL: 12h POSTERN_BACKUP_KEEP: "14" POSTERN_BACKUP_DIR: /backups volumes: - /srv/postern-backups:/backups ``` ```sh sudo install -d -o 10001 -g 10001 -m 0700 /srv/postern-backups cd ~/postern docker compose up -d ``` Blobs are copied, not hard-linked, into a folder on another file system, so each backup then takes the full size of the mail store. **Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:** Add the variables to `/etc/postern/hub.env`: ```ini POSTERN_BACKUP_INTERVAL=12h POSTERN_BACKUP_KEEP=14 POSTERN_BACKUP_DIR=/srv/postern-backups ``` The service may only write to its own folders. For a backup folder elsewhere, create it and allow it in a drop-in (`sudo systemctl edit postern-hub`): ```sh sudo install -d -o postern -g postern -m 0700 /srv/postern-backups sudo systemctl edit postern-hub ``` ```ini [Service] ReadWritePaths=/srv/postern-backups ``` ```sh sudo systemctl restart postern-hub ``` Blobs are copied, not hard-linked, into a folder on another file system. **Desktop app (built-in Hub):** The built-in Hub uses the defaults: a backup every 24 hours in `hub-data/backups/`, the newest 7 kept. They are only made while the app is open. They cannot be changed from the app. Your computer's own backup (Time Machine, Windows File History) picks the folder up together with the rest of the app's data folder, including `hub-key/hub.key`: see the note about keeping them apart above. ## Copies before an upgrade Before the Hub changes its database schema (on the first start after an upgrade), it writes `pre-migrate-