# Troubleshooting

> Find your symptom or error message, learn the cause and fix it, with commands for each install method, and collect doctor output and logs for a bug report.

Source: https://docs.posternmail.app/troubleshooting/

This page is ordered by symptom. Find the message you see (most entries quote it exactly), read
the cause and follow the fix. Pick your install method at the top: commands change with it.
If nothing here helps, [collect the details for a bug report](https://docs.posternmail.app/troubleshooting/#collect-details-for-a-bug-report).

## First steps

Two commands answer most questions. Run them before anything else.

**The log** shows what the Hub is doing and why it stopped:

**Docker Compose:**
```sh
cd ~/postern && docker compose logs -f hub
```
**Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:**
```sh
sudo journalctl -u postern-hub -f
```
**Desktop app (built-in Hub):**
The built-in Hub writes to `logs/hub.log` in the app's data folder:

| System | File |
|---|---|
| macOS | `~/Library/Application Support/Postern/logs/hub.log` |
| Windows | `%APPDATA%\Postern\logs\hub.log` |
| Linux | `~/.config/Postern/logs/hub.log` |

**Help → Open Log Folder** in the app opens that folder.

**doctor** checks the data directory, the database, the master key, the setup state, the
network (public URL, certificate, clock, push relay), the sign-in providers and the backups, and
says what to fix:

**Docker Compose:**
```sh
cd ~/postern && docker compose exec hub postern-hub doctor
```

The container must be running. If it is not, use
`docker compose run --rm hub doctor` instead.
**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):**
doctor cannot be run from the desktop app. Use the log file above.

Each line starts with `✓` (fine), `!` (warning) or `✗` (problem). The last line sums up:
"Everything looks good.", "No problems, N warning(s)." or "N problem(s), N warning(s)." More:
[Doctor](https://docs.posternmail.app/admin/doctor/) and [Logs](https://docs.posternmail.app/admin/logs/).

## Install and start

### The Hub does not start

The Hub prints one line starting with `error:` and exits. Find that line in the log (see
[First steps](https://docs.posternmail.app/troubleshooting/#first-steps)). Under systemd it restarts every 5 seconds, so the same error
repeats.

| Message | Cause and fix |
|---|---|
| `error: POSTERN_PUBLIC_URL must be an absolute http(s) URL, got "..."` | The URL lacks `https://` or `http://`, or has no host. Write it in full: `https://mail.example.com`. |
| `error: POSTERN_TLS_CERT and POSTERN_TLS_KEY must be set together` | Only one of the two is set. Set both, or neither. See [HTTPS and passkeys](https://docs.posternmail.app/reach/https/). |
| `error: POSTERN_ACCESS_CLIENT_ID and POSTERN_ACCESS_CLIENT_SECRET must be set together` | Same for the Cloudflare Access token. See [Cloudflare Tunnel](https://docs.posternmail.app/reach/cloudflare/). |
| `error: POSTERN_TRUSTED_PROXIES: invalid CIDR "..."` or `invalid IP address "..."` | A typo in the list. Use comma-separated addresses or ranges: `127.0.0.1,::1` or `172.16.0.0/12`. |
| `error: POSTERN_HUB_MAIL_COPY_DAYS must be at least 1, got 0` | Use 1 or more. |
| `error: POSTERN_BACKUP_KEEP: strconv.Atoi: ...` (or another variable name) | A number or duration setting has a value that is not a number (`24h` style for durations). |
| `error: http: listen tcp 127.0.0.1:8080: bind: address already in use` | Another program (often a second Hub) uses the port. `sudo ss -tlnp \| grep 8080` names it. Stop it, or change the port. |
| `error: http: listen tcp :443: bind: permission denied` | Built-in TLS without the right to open ports below 1024. See [HTTPS and passkeys](https://docs.posternmail.app/reach/https/#set-it-up). |
| `error: platform: the data directory is in use by a running Hub (.../hub.lock)` | Another Hub process uses the same data directory. Only one may. Stop the other one (`ps aux \| grep postern-hub`). A leftover `hub.lock` file never blocks a start by itself. |
| `error: read key file: open ...: permission denied` | The Hub's user cannot read the master key. See [Key file errors](https://docs.posternmail.app/troubleshooting/#key-file-errors). |
| `error: vault: key file is sealed; set POSTERN_KEY_PASSPHRASE` | The key file is protected with a passphrase. Provide `POSTERN_KEY_PASSPHRASE`. |
| `error: vault: wrong passphrase for sealed key file` | The passphrase does not match. |
| `error: create data dir: mkdir ...: permission denied` | The data directory's parent is not writable by the Hub's user. See [Docker: permission denied on /data](https://docs.posternmail.app/troubleshooting/#docker-permission-denied-on-data). |

**Docker Compose:**
To see the error of a container that keeps restarting:

```sh
cd ~/postern && docker compose ps
cd ~/postern && docker compose logs --tail 50 hub
```
**Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:**
To see why systemd gave up:

```sh
sudo systemctl status postern-hub
sudo journalctl -u postern-hub -n 50 --no-pager
```

`status=203/EXEC` means systemd cannot run the program at the path in `ExecStart`. The unit in
the repository uses `/usr/bin/postern-hub`; a Hub built from source is installed to
`/usr/local/bin/postern-hub`. Check with `systemctl cat postern-hub` and fix the path with
`sudo systemctl edit --full postern-hub`, then `sudo systemctl daemon-reload` and
`sudo systemctl restart postern-hub`.
**Desktop app (built-in Hub):**
When the built-in Hub stops several times in a row, the app shows "Your Hub on this computer
stopped" and does not start it again on its own. The reason is at the end of `logs/hub.log`.
"This copy of Postern can't run a Hub" means the app was built without the Hub binary: build it
with the Hub included ([Development](https://docs.posternmail.app/development/)), or run the Hub on a server.

### Docker: the image cannot be pulled

`docker compose up -d` fails with `pull access denied`, `manifest unknown` or `not found` for
`ghcr.io/theoriuhd/postern-hub`.

No images are published yet. `compose.yaml` uses the tag from `POSTERN_VERSION` and falls back
to `latest`, which does not exist. Build the image locally as described in
[Set up Postern](https://docs.posternmail.app/setup/), and set the tag in `~/postern/.env`:

```sh
POSTERN_VERSION=local
```

### Docker: permission denied on /data

The log shows `permission denied` for a path under `/data` or `/key`.

The container runs as uid 10001. Named volumes (the default in `compose.yaml`) get the right
owner by themselves. If you replaced them with folders on the host (bind mounts), give those
folders to uid 10001:

```sh
sudo chown -R 10001:10001 ./data ./key
```

### The setup wizard asks for a setup code

The wizard says "Enter the setup code from your Hub's log (or run 'postern-hub setup-code' on the
server)." or, after a wrong one, "That setup code isn't right. ..."

The first account on a Hub becomes its administrator, so the wizard asks for a code that only
someone with access to the server can read. A browser on the Hub machine itself, talking to the
Hub directly, does not need it; through Docker's port mapping or a proxy it does. The Hub
prints the code at every start until setup is done:

```text
This Hub is not set up yet. Open it in a browser and enter the setup code K7QF-2M9X-H4TC (also shown by 'postern-hub setup-code').
```

**Docker Compose:**
```sh
cd ~/postern && docker compose exec hub postern-hub setup-code
```
**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 setup-code'
```
**Desktop app (built-in Hub):**
The built-in Hub runs on `localhost` and does not ask for a code.

"This Hub is already set up: no setup code is needed." means an account exists. Sign in, or
create users with `postern-hub admin create-user` ([CLI](https://docs.posternmail.app/reference/cli/)).

## Reaching the Hub

### I cannot open the Hub from another device

The browser says the connection was refused, or it times out.

**Docker Compose:**
The Hub is published on `127.0.0.1:8080` only, on purpose. Choose how other devices should
reach it: [Reaching your Hub](https://docs.posternmail.app/reach/). For your home network only, set
`POSTERN_BIND=0.0.0.0:8080` in `~/postern/.env` ([LAN only](https://docs.posternmail.app/reach/lan/)).
**Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:**
The Hub listens on `127.0.0.1:8080` only, on purpose. Choose how other devices should reach it:
[Reaching your Hub](https://docs.posternmail.app/reach/). For your home network only, set `POSTERN_LISTEN=0.0.0.0:8080` in
`/etc/postern/hub.env` and open the firewall ([LAN only](https://docs.posternmail.app/reach/lan/)). On Fedora, firewalld
blocks port 8080 until you open it.
**Desktop app (built-in Hub):**
The built-in Hub only accepts connections from the same computer, and that cannot be changed.
To use Postern on other devices, run the Hub on a server: [Set up Postern](https://docs.posternmail.app/setup/).

### "Cross-origin request rejected"

Reading works, but saving anything (starring, sending, changing a setting) fails with
"Cross-origin request rejected", or the API answers `403` with the code `csrf`.

The Hub compares the browser's `Origin` with its own address: the host of `POSTERN_PUBLIC_URL`,
or the `Host` header (or `X-Forwarded-Host` with `POSTERN_TRUST_PROXY=true`). Fix:

- Set `POSTERN_PUBLIC_URL` to exactly the address in the browser's address bar, with the port if
  there is one (`http://192.168.1.20:8080`, not `http://192.168.1.20`).
- Open the Hub only at that address. Opening it by IP when `POSTERN_PUBLIC_URL` has a name (or
  the other way round) fails.
- Behind a proxy, pass the `Host` header, or `X-Forwarded-Host` together with
  `POSTERN_TRUST_PROXY=true`. See [Reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/#requirements-for-any-proxy).

"Missing X-MC-Client header" with the same code means a request came without the header the
Postern apps always send: a proxy that strips headers, or your own script. Pass the header
through, or send `X-MC-Client` in your script.

### The web app does not update by itself

New mail and changes from other devices only appear after a reload; the desktop app may show
"Can't reach your Hub. Changes are sent when it's back." although pages load.

The WebSocket at `/api/v1/ws` does not get through. Your proxy must forward the `Upgrade` and
`Connection` headers, speak HTTP/1.1 to the Hub and keep connections open for an hour or more.
Compare your configuration with [the ready-made ones](https://docs.posternmail.app/reach/reverse-proxy/). With nginx, the
`map` block and the two `proxy_set_header` lines for `Upgrade` and `Connection` are needed. A
`proxy_read_timeout` of 60 seconds (nginx's default) drops the connection over and over.

### 502 Bad Gateway

The proxy (Caddy, nginx, Traefik, Tailscale, Cloudflare) runs, but the Hub does not answer
behind it.

1. Check that the Hub runs and answers on the machine itself:

   ```sh
   curl -s http://127.0.0.1:8080/api/v1/info
   ```

2. If that prints JSON, the proxy points to the wrong address. Caddy and nginx on the host use
   `127.0.0.1:8080`; the Compose `caddy` profile uses `hub:8080`.
3. On Fedora with nginx, allow nginx to connect: `sudo setsebool -P httpd_can_network_connect 1`.

### Certificate errors

The browser warns about the certificate, or the desktop app says "Your Hub's certificate isn't
trusted".

- A self-signed certificate: the apps never accept it. See
  [Self-signed certificates](https://docs.posternmail.app/reach/https/#self-signed-certificates).
- The name does not match: you opened the Hub with a name the certificate is not for (for
  example the IP address). Use the name.
- Expired: doctor reports `TLS certificate for ... expired on ...`. Caddy, Traefik, Tailscale
  and the Hub's own Let's Encrypt support renew by themselves; look at their logs for errors.
  With certbot, `sudo certbot renew --dry-run` shows what fails. With your own certificate files,
  renew them and restart the Hub.
- doctor warns `the system clock differs from ... by ...: TOTP codes and TLS may fail (enable
  NTP)`: fix the clock (`timedatectl` shows whether NTP is active).

### doctor says the public URL is not reachable

`✗ https://mail.example.com is not reachable from this machine: ... (is the Hub running? DNS /
firewall / reverse proxy?)`

doctor fetches `POSTERN_PUBLIC_URL/api/v1/info` from the server itself. The rest of the line says
why it failed. Some setups cannot reach their own public address from inside (routers without
"NAT loopback", or a Tailscale name on a machine where MagicDNS is off). If browsers on other
devices work, you can ignore it.

`✗ ... answered, but not with a compatible Postern Hub (apiVersion N)` means another program
answers at that address, or the Hub and doctor have different versions.

### Cloudflare Access turns devices away

The desktop app says "Cloudflare Access turned this computer away", a phone says "the access
gateway in front of your Hub (Cloudflare Access) turned this device away; pair it again to get a
fresh access token", or doctor reports that Access rejected the service token.

The service token is missing, expired, revoked or not in the application's **Service Auth**
policy. See [Lock it with Cloudflare Access](https://docs.posternmail.app/reach/cloudflare/#lock-it-with-cloudflare-access).
After fixing the token, pair phones again with the QR code. Devices keep working with their own
mail meanwhile and are not signed out.

### The desktop app says the Hub "asks for a password first"

A web server in front of the Hub uses a password prompt (HTTP basic authentication). The apps
cannot pass it. Remove the prompt and protect the Hub with Tailscale, a VPN or Cloudflare Access
instead.

## Sign-in

### Passkeys are not offered

**Settings → Security** says "Passkeys only work when your Hub is opened over a secure (https)
address.", or a passkey action fails with "Passkeys need a secure connection: open the Hub over
HTTPS (set POSTERN_PUBLIC_URL) or via localhost."

Passkeys need HTTPS on a host name (or `localhost`). They are never offered over plain HTTP or
on an IP address. Set up HTTPS ([Reaching your Hub](https://docs.posternmail.app/reach/)) and set `POSTERN_PUBLIC_URL` to
the `https://` address.

### A passkey stopped working

"This passkey is not registered on this Hub" or "This passkey could not be verified. Remove it
and register it again."

Passkeys are tied to the host name of the Hub. After a change of `POSTERN_PUBLIC_URL` to another
name, old passkeys no longer fit. Sign in with password and TOTP and add a new passkey. See
[Changing the domain later](https://docs.posternmail.app/reach/https/#changing-the-domain-later).

### "Incorrect email or password"

Check the email address: it is your Hub login, which does not have to be one of your mailboxes.
An administrator can set a new password:

**Docker Compose:**
```sh
cd ~/postern && docker compose exec hub postern-hub admin reset-password
```
**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'
```
**Desktop app (built-in Hub):**
Not available from the app. See [Desktop app](https://docs.posternmail.app/apps/desktop/).

The command's options are on [CLI](https://docs.posternmail.app/reference/cli/). "This account has been disabled." means
an administrator disabled it ([Users](https://docs.posternmail.app/admin/users/)).

### TOTP codes are rejected

"Incorrect verification code" or "That code is not correct. Check your authenticator app and
try again."

The codes depend on the time. Check the clock on the Hub machine (`timedatectl`: "System clock
synchronized: yes") and on your phone (automatic time on). If the phone with the authenticator
is lost, an administrator can turn off two-step verification with `postern-hub admin disable-2fa`
([CLI](https://docs.posternmail.app/reference/cli/)).

### "Too many attempts. Please wait a moment and try again."

The Hub limits sign-in, setup and pairing attempts per IP address. Wait a minute. If everyone
behind your proxy hits the limit together, the Hub sees all requests coming from the proxy's
address: set `POSTERN_TRUST_PROXY=true` and the right `POSTERN_TRUSTED_PROXIES`
([Reverse proxy](https://docs.posternmail.app/reach/reverse-proxy/#postern_trusted_proxies)).

### "Your session has expired. Please sign in again."

The session ended: it was revoked under **Settings → Devices**, by an administrator, or it ran
out. Sign in again. If it happens right after every sign-in, the browser does not keep the
cookie: open the Hub only at the address in `POSTERN_PUBLIC_URL`.

### Google says redirect_uri_mismatch

The redirect address in your Google OAuth client must be exactly
`{POSTERN_PUBLIC_URL}/api/v1/oauth/callback/google`, for example
`https://mail.example.com/api/v1/oauth/callback/google`. Add it in the Google Cloud console.
See [Gmail](https://docs.posternmail.app/providers/gmail/).

If the Hub says "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.", your public URL is plain HTTP. For
Microsoft the matching message ends with "Use the sign-in with a code instead."

## Mailboxes

### "The sign-in no longer works. Reconnect to keep getting mail."

The mailbox list shows this, the sidebar shows **Reconnect**, and the details say "The mail
provider no longer accepts the sign-in for this mailbox. Reconnect it to keep receiving mail."

The provider rejected the stored sign-in: you changed the password, revoked the app password,
or the OAuth token expired. Open **Settings → Mailboxes**, choose **Reconnect** and sign in
again. With your own Gmail OAuth client, make sure its consent screen is published ("In
production"): tokens of a client in "Testing" expire after 7 days ([Gmail](https://docs.posternmail.app/providers/gmail/)).

### Adding a mailbox fails

| Message | Cause and fix |
|---|---|
| "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." | Use an app password from your provider. See your provider's page under [Providers](https://docs.posternmail.app/providers/). |
| "Couldn't connect to imap.example.com: the connection timed out. Check the server name, port and security setting." | Wrong host or port, or a firewall blocks outgoing connections from the Hub. Test from the Hub machine: `nc -vz imap.example.com 993`. |
| "This mailbox is already connected. Update its credentials instead." | It is there already. Use **Reconnect** in **Settings → Mailboxes**. |
| "Gmail sign-in needs a Google OAuth client configured by the Hub admin (and an HTTPS address). You can use an app password with IMAP instead." | See [Gmail](https://docs.posternmail.app/providers/gmail/). |
| "Google sign-in isn't set up on this Hub. An administrator can add a Google OAuth client in Settings → Providers." | The admin has not added a Google client. Same for Microsoft. |

### "Having trouble getting new mail. Trying again automatically."

The mailbox is **degraded**: syncing failed and the Hub keeps retrying. Open **Technical
details** in **Settings → Mailboxes** for the reason:

| Detail | Meaning |
|---|---|
| "Can't reach imap.example.com. Trying again." | Network or DNS problem between the Hub and the provider. |
| "Can't make a secure connection to imap.example.com. Check the server address and security setting of this mailbox." | TLS failed: wrong port and security combination, or the server's certificate is invalid. |
| "... is limiting how fast this mailbox can sync. Syncing continues by itself; nothing needs to be done." | The provider throttles. Wait. |
| "This mailbox is full at the provider. Free up space there and syncing continues." | Delete mail at the provider or buy more space. |
| "... is having trouble right now. Trying again." | The provider has an outage. |

## Sync and push

### Phones get no notifications

1. Check the relay: **Settings → Admin → Status** shows **Phone notifications**: "Working",
   "Can't be reached" or "Not set up". doctor says "Push relay disabled (POSTERN_RELAY_URL not
   set)" or "push relay ... is unreachable".
2. "Not set up": set `POSTERN_RELAY_URL`. Without a relay, iOS has no push; phones update when
   the app runs. See [Push relay](https://docs.posternmail.app/relay/).
3. Android builds made from the repository have no Firebase configuration and receive no push
   ([Android](https://docs.posternmail.app/apps/android/)).
4. On the phone, allow notifications for Postern, and check the notification settings in
   **Settings → Notifications** ([Notifications](https://docs.posternmail.app/using/notifications/)).

The Hub reaches the relay over an outbound connection: push works with Tailscale, LAN-only and
Cloudflare setups alike.

### Browser notifications cannot be turned on

Web Push needs HTTPS (or `localhost`). Over plain HTTP the browser does not offer it. See
[Reaching your Hub](https://docs.posternmail.app/reach/).

### The web app says "Can't reach your Hub."

"Check your connection. No mail is saved on this device yet, so there's nothing to show until
your Hub answers." The browser cannot reach the Hub at all. Check that the Hub runs (log, doctor)
and that you are connected to the right network (Tailscale on, at home for LAN only).

## Desktop app

### Connecting to the Hub fails

The connect window shows one of these:

| Title | Cause and fix |
|---|---|
| "Couldn't find mail.example.com" | DNS cannot resolve the name. Check the spelling; for a Tailscale name, connect Tailscale. |
| "Couldn't reach mail.example.com" | Nothing answers: Hub stopped, wrong port (the Hub uses 8080 unless set up otherwise), or this computer is on another network. |
| "mail.example.com didn't answer in time" | The Hub is starting, or the network is slow. Try again. |
| "Your Hub's certificate isn't trusted" | Self-signed, expired or for another name. See [Certificate errors](https://docs.posternmail.app/troubleshooting/#certificate-errors). |
| "The port of mail.example.com is blocked" | Like browsers, the app refuses some ports (such as 25, 110 or 6000). Use another port, for example 8080. |
| "mail.example.com isn't a Postern Hub" | Something else answers at that address. Check address and port. |
| "mail.example.com asks for a password first" | See [above](https://docs.posternmail.app/troubleshooting/#the-desktop-app-says-the-hub-asks-for-a-password-first). |
| "Your Hub is newer than this app" / "Your Hub is too old for this app" | Update the app, or the Hub. |
| "This connection isn't encrypted" | A warning, not an error: the Hub uses plain HTTP on a non-local address. **Connect anyway** continues. See [LAN only](https://docs.posternmail.app/reach/lan/#desktop-app). |
| "Couldn't finish signing in" | The sign-in window did not complete. The detail says why. Try again. |

**Details** under the message shows the technical error.

### The app works but says the Hub is unreachable

"Can't reach your Hub. Changes are sent when it's back." The desktop app keeps working with your
mail (it connects to your providers directly) and sends your changes to the Hub when it is back.
Nothing is lost. Fix the connection to the Hub as above. See [Offline and direct mode](https://docs.posternmail.app/apps/offline/).

### The built-in Hub

**Desktop app (built-in Hub):**
"Your Hub on this computer isn't answering": it usually comes back within a few seconds. If the
app shows "Your Hub on this computer stopped", the end of `logs/hub.log` in the app data folder
says why. Other devices cannot connect to this Hub; see [Reaching your Hub](https://docs.posternmail.app/reach/).
**Docker Compose, Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:**
This applies only to the desktop app's built-in Hub. Choose **Desktop app (built-in Hub)** at
the top of the page to see it.

## Mobile app

### Pairing fails

| Message | Cause and fix |
|---|---|
| "That QR code isn't from Postern. Scan the one shown under Connect a device." | Scan the code from **Settings → Devices → Connect a device**. |
| "This code is incomplete. Scan the QR code again." | The scan was cut off. Scan again. |
| "This pairing code is invalid or has expired" | Codes are short-lived. Create a new one. |
| "The request ran out of time before it was approved. Try again." | Approve on the other device sooner. |
| "The request was declined on your other device." | Someone pressed decline. Start again. |

Behind Cloudflare Access only scanning works, not typing the code. See [Pairing](https://docs.posternmail.app/apps/pairing/).

### The phone cannot reach the Hub at home

With a plain HTTP address: Android release builds refuse plain HTTP to IP addresses such as
`http://192.168.1.20:8080`, and iOS refuses it to names like `hub.lan`. See the table in
[LAN only](https://docs.posternmail.app/reach/lan/#phones). With Tailscale, check that the Tailscale app is connected.

"There's no Postern Hub at this address. Check the address and try again." means something
answers, but not a Hub: check the port.

### "This Hub isn't encrypted"

The app asks before it connects to a plain HTTP address outside your local network. Your
password and mail would cross the internet readable. Choose **Cancel** and set up HTTPS
([Reaching your Hub](https://docs.posternmail.app/reach/)) unless you know why the Hub has none.

## Rules

| Symptom | Cause and fix |
|---|---|
| A rule matches but nothing happens | It is in **Test** mode: it only records what it would have done. Switch it to **Live** ([Test mode](https://docs.posternmail.app/rules/test-mode/)). |
| Rule mail is not sent and an alert says sending is paused | A limit was reached (per rule, per mailbox, or more than 20 in a minute). The messages wait and go out by themselves ([Limits](https://docs.posternmail.app/rules/limits/)). |
| An item waits in **Settings → Rules → Sending queue** | Sending failed after all retries, the mailbox needs a new sign-in, or Postern could not confirm whether it was sent. Use **Retry**, **Change recipient**, **Restore** or **Download** ([Sending queue](https://docs.posternmail.app/rules/sending-queue/)). |
| A webhook or alert to an address in your LAN is refused | Private addresses are blocked unless the admin sets `POSTERN_RULES_ALLOW_LAN=true` ([Webhooks](https://docs.posternmail.app/rules/webhooks/)). |

Every action of every rule is in **Settings → Rules → Rule activity** ([Activity](https://docs.posternmail.app/rules/activity/)).

## Backups and keys

### Key file errors

| Message | Cause and fix |
|---|---|
| `read key file: open ...: permission denied` | The key file belongs to another user. It must be readable by the Hub's user only (`chmod 600`). Docker: uid 10001. systemd: `sudo chown postern:postern /var/lib/postern-key/hub.key`. |
| doctor: `key file ... is missing but a database exists: restore the key file from your backup` | The key is not where `POSTERN_KEY_FILE` points. Put your backup copy back **before** you start the Hub: a Hub that finds no key file creates a new one, which cannot open the existing data. |
| doctor: `... does not match this database (cannot decrypt ...): wrong key file?` | The key belongs to another Hub or another install. Restore the matching key. |
| `vault: malformed key file` or `vault: unrecognized key file format` | The file was damaged or edited. Restore it from your backup. |
| doctor: `... is readable by other users (mode ...); run: chmod 600 ...` | Fix the permissions as shown. |

If the key is truly lost, the encrypted data cannot be recovered. Your mail is still at your
providers: start with a fresh data directory and connect your mailboxes again. See
[Backups](https://docs.posternmail.app/admin/backups/) and [Encryption](https://docs.posternmail.app/security/encryption/).

### Backups are old or missing

doctor says `scheduled backups are disabled (POSTERN_BACKUP_INTERVAL=0)` or
`the newest backup is from ...`, and **Settings → Admin → Status** shows "The last backup is
older than expected. Check the Hub logs and the backup directory." Look for backup errors in
the log, check free disk space (doctor reports it) and that `POSTERN_BACKUP_DIR` is writable by
the Hub. A backup directory outside the data directory needs `ReadWritePaths=` in the systemd
unit. See [Backups](https://docs.posternmail.app/admin/backups/).

## Collect details for a bug report

Open an issue at <https://github.com/TheOriUHD/postern/issues> and include:

1. What you did, what you expected and what happened, with the exact message.
2. How you installed the Hub (the method chosen at the top of this page) and the version:

**Docker Compose:**
```sh
cd ~/postern && docker compose exec hub postern-hub version
```
**Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:**
```sh
postern-hub version
```
**Desktop app (built-in Hub):**
The version of the app, shown by the **About** item (in the **Postern** menu on macOS, at the
end of the **Help** menu on Windows and Linux).

3. The output of doctor (commands in [First steps](https://docs.posternmail.app/troubleshooting/#first-steps)).
4. The log lines around the problem, saved to a file:

**Docker Compose:**
```sh
cd ~/postern && docker compose logs --since 30m hub > hub-log.txt
```
**Debian and Ubuntu, Fedora and RHEL and Raspberry Pi OS:**
```sh
sudo journalctl -u postern-hub --since "30 min ago" --no-pager > hub-log.txt
```
**Desktop app (built-in Hub):**
Copy the last lines of `logs/hub.log` from the app data folder (paths in
[First steps](https://docs.posternmail.app/troubleshooting/#first-steps)).

For more detail, set `POSTERN_LOG_LEVEL=debug`, reproduce the problem, and set it back
afterwards ([Logs](https://docs.posternmail.app/admin/logs/)).

> [!IMPORTANT]
> doctor and the logs are designed not to print secrets, but they contain your domain, email
> addresses, mailbox names and IP addresses. Read them and remove anything you do not want to
> share before you post. Report security problems privately as described in
> [SECURITY.md](https://github.com/TheOriUHD/postern/blob/main/SECURITY.md), not in a public issue.
