Skip to content
Saymail is currently in  closed beta — available by invitation only.
Belgelere göz at

Backup and restore

Where Saymail stores its database, how to back it up (built-in or manually), how to restore it on the same or a different machine, and how to reconnect Gmail, Outlook, and IMAP accounts afterwards.

Saymail keeps every email, folder, contact, profile, and setting in a single SQLite database on your computer. This page covers where that file lives, how to back it up — using either the built-in backup or a manual file copy — and how to restore it, including the reconnection steps each account type needs after a restore.

Where the database lives

Saymail stores its data under your user account, in the standard application-data folder for your OS:

  • Windows%APPDATA%\saymail\saymail.db (typically C:\Users\<you>\AppData\Roaming\saymail\saymail.db)
  • macOS~/Library/Application Support/saymail/saymail.db
  • Linux~/.local/share/saymail/saymail.db

While Saymail is running you may see two companion files next to saymail.db:

  • saymail.db-wal — write-ahead log
  • saymail.db-shm — shared-memory index

Both belong to SQLite’s WAL journaling mode. They are working files for the running process — not part of a backup. When Saymail shuts down cleanly, their contents are flushed into saymail.db and they can be safely ignored.

Saymail can produce backups for you. Open Settings → Backup and:

  1. Set a Backup location — pick a folder on a separate drive, a synced folder (OneDrive, Dropbox, iCloud, Google Drive), or a network share. Any folder Saymail can write to.
  2. Optionally enable Back up on startup — once a day, when you launch Saymail, it will write a fresh backup automatically.
  3. Click Back up now whenever you want an on-demand snapshot. The button is disabled until a location is set.

Each backup is a single self-contained .db file produced by SQLite’s VACUUM INTO — the running database is streamed into a clean, consolidated file, and any pending WAL changes are merged in along the way. There are no -wal or -shm files alongside an in-app backup, and you don’t need any.

Grandfather-father-son rotation

To keep history without consuming unlimited disk, Saymail uses a GFS rotation — every backup writes one or more of these slots, overwriting the previous occupant of each slot:

SlotFilenameWhen it’s written
Dailysaymail_mon.dbsaymail_sun.db (7 files)Every day
Weeklysaymail_week_1.dbsaymail_week_4.dbOn Mondays
Monthlysaymail_jan.dbsaymail_dec.db (12 files)On the 1st of each month
Yearlysaymail_<year>.dbOn 1 January

So at any time your backup folder typically holds: the last 7 daily backups, the last 4 weekly backups, the last 12 monthly backups, and one file per year you’ve used Saymail.

To restore from any of these, use the procedure under Restoring a backup — they’re all complete, self-contained databases. Pick whichever date you want to roll back to.

Backing up — manually (advanced)

If you’d rather take a backup yourself instead of using the built-in feature:

  1. Close Saymail completely. Quit from the tray menu — don’t just close the window. This flushes the WAL into saymail.db and releases all file locks.
  2. Open the data folder for your OS (see Where the database lives).
  3. Copy saymail.db to your backup destination.

That single file is the entire backup. The -wal and -shm files, if they’re still around, have already been merged into saymail.db by the clean shutdown — you can ignore them. (If for any reason you can’t close Saymail first, copy all three files together; on restore you’d need to put all three back.)

Restoring a backup

The procedure is the same whether the backup came from the built-in feature or a manual copy.

  1. Close Saymail completely before touching any files.
  2. Open the data folder for your OS (see Where the database lives).
  3. Rename the current saymail.db (and any saymail.db-wal / saymail.db-shm) to .old — that way you can roll back if needed.
  4. Copy your backup file into the folder and rename it to saymail.db. For example, if you’re restoring saymail_thu.db from your backup folder, copy it across and rename it to saymail.db.
  5. Start Saymail. The app will open the restored database and start syncing.

If the restore is on the same Windows user account on the same machine that created the backup, your accounts will usually reconnect automatically and sync will resume. Skip ahead to Verifying the restore.

If you restored on a different machine or a different Windows user, every account will show a Reconnect banner. That’s expected — see the next section for why, and how to fix it.

Why accounts need reconnecting after a cross-machine restore

The saymail.db file contains your mail, folders, settings, and the identity of each account (provider, email address, server settings) — but not the secret needed to log in:

  • Gmail and Outlook — the OAuth refresh token.
  • IMAP/SMTP — your mailbox password.

Those secrets are stored separately in your operating system’s secure credential store:

  • Windows — Credential Manager
  • macOS — Keychain
  • Linux — Secret Service (GNOME Keyring / KWallet)

These stores are scoped to a single user on a single machine. They do not travel with the saymail.db file. So whenever you restore a database onto a new machine or a new user account — or if Credential Manager has been cleared — the accounts are intact in the UI but their secrets are gone, and you’ll need to reconnect each one.

Reconnecting accounts after a restore

Open the Email Accounts panel from the command palette or panel menu. Each affected account will show a Reconnect banner. The exact steps depend on the account type.

Gmail

  1. Click Reconnect on the Gmail account.
  2. A browser window opens at Google’s sign-in page.
  3. Sign in with the same Google address that the account is configured for. Signing in with a different address will create a duplicate account instead of repairing the existing one.
  4. Grant Saymail the requested scopes (read, send, modify, contacts).
  5. The browser hands control back to Saymail and a new refresh token is stored in your credential store.

Sync resumes automatically; no data is re-downloaded from scratch — Saymail picks up where the local database left off.

Outlook / Microsoft 365

  1. Click Reconnect on the Outlook account.
  2. A browser window opens at Microsoft’s sign-in page.
  3. Sign in with the same Microsoft address that the account is configured for.
  4. Grant the requested scopes.
  5. Control returns to Saymail and the new refresh token is stored.

If your organisation requires admin consent for the requested scopes, your IT administrator may need to approve the grant before the reconnect can complete.

IMAP / SMTP

IMAP/SMTP accounts don’t use OAuth, so there’s no browser flow — just a missing password:

  1. Click Reconnect (or open the account) on the IMAP account.
  2. The account form opens with all server settings intact (IMAP host, SMTP host, ports, encryption, username).
  3. Enter your mailbox password in the password field.
  4. Click Save. Saymail stores the password encrypted in your credential store and resumes sync.

If your provider uses an app password (Gmail-via-IMAP, iCloud, Fastmail, Proton Bridge, etc.), use the same app password you used when the account was first added — or generate a new one on the provider side and paste it in.

Verifying the restore

After reconnecting all accounts:

  1. Each account’s Reconnect banner should disappear.
  2. Folder counts in the sidebar should match what you remember.
  3. Opening the inbox of each account should list messages immediately (they’re already in the local DB) and a fresh sync should start in the background to pick up anything new since the backup.

If a folder count looks wrong or a reconnect doesn’t take, close Saymail and reopen it — that re-runs the initial sync checks against the restored database.

Troubleshooting

  • Accounts show “no refresh token” or “password missing” on startup. Your credential store entries are gone or were never written. Use the reconnect steps above for each affected account.
  • Saymail won’t open the restored database. The file may have been copied while Saymail (or another process) had it locked. Close Saymail everywhere, replace the file again, and reopen.
  • You restored an old backup and lost recent mail. Stop sync from making the situation worse: close Saymail, rename the restored saymail.db back to saymail.db.old, and restore from a more recent backup (one of the daily / weekly / monthly slots). As long as the messages still exist on the provider, a fresh database (no backup at all) will also re-download everything from scratch — see Email accounts for how to add accounts to a clean install.