Storage encryption
All emails, contacts and notes live in a local database on your machine. Storage encryption makes that file unreadable without its key. Whoever pulls the drive or copies the file holds nothing but noise.
It is enabled by default. The decision is made once, in the setup wizard, and cannot be switched later. Only two things change it afterwards: restoring a full backup takes over the backup’s mode and key, and Reset Local Data (see below) starts a new database with a new key. On Linux it needs a keyring such as GNOME Keyring or KWallet. Without one, the database stays unencrypted, and the settings page reports Encryption unavailable on this system. If the wizard tells you so, quit it before finishing, install a keyring and start YouniqMail again.
How it works
Section titled “How it works”The database is encrypted with a randomly generated 64-character key
(SQLCipher, AES-256). YouniqMail stores this key sealed in its
settings file config.json. The seal is held by the operating
system: the Keychain on macOS, the Windows data protection interface
(bound to your user account), the desktop environment’s keyring on
Linux.
Day to day you notice nothing: at launch, YouniqMail unseals the key with the help of your system login. No extra password, no extra step.
The same seal also protects the passwords of your email accounts and the sign-ins to connected services, that is tokens, CalDAV passwords and webhook addresses: the passwords and tokens of your mail accounts together, the secrets of the integrations each on its own. They stay sealed even when storage encryption is off. Only on Linux without a keyring do they stay unencrypted.
The recovery key
Section titled “The recovery key”The chain has two weak links: the keychain and the config.json
file. Reinstall the operating system, reset the user account or delete
config.json, and the sealed key can no longer be opened, and with it
the access to the database.
That is what the recovery key is for: the same 64 characters,
shown once during setup for safekeeping. If the key is missing at
launch, YouniqMail shows the Database Key Missing dialog. Via
Enter Key… you open the database again with the recovery key,
without downloading anything again. Quit closes YouniqMail, for
example to put back a config.json from your own backup first. You
also need the recovery key to restore a full backup on another
computer.
Not everything comes back with the recovery key, because the keychain sealed more than the database key. Sign in to all your accounts again, connect your integrations again, and import your own PGP keys and S/MIME certificates again from their files.
Never saved it? As long as the app runs normally, nothing is lost: under Settings → Security → Encrypt Storage, Show Recovery Key displays it again at any time; Copy puts it on the clipboard and Save as PDF stores it. On a Mac with Touch ID the button reads Show Recovery Key (Touch ID), and you confirm with your fingerprint; on other computers you answer a question from YouniqMail, which asks for no password. So lock your computer when you walk away from it.
Opening Local Folders without the app
Section titled “Opening Local Folders without the app”Emails in Local Folders exist only on your device, as one file per
email in the local_mail folder of your profile. They are protected
exactly like the database:
- Storage encryption off: they are ordinary
.emlfiles that any mail program opens with a double click. - Storage encryption on: the files end in
.ymrawand are encrypted with the database key. Without it they are as unreadable as the database itself.
Day to day you never need the files directly. File → Export… saves
Local Folders as mbox or as single .eml files, and the
full backup takes them along.
If YouniqMail no longer starts, the recovery key and a small emergency program get the emails back:
-
Install Node.js, version 18 or newer.
-
Download the emergency program: youniqmail-local-mail-decrypt.mjs.
-
Open a terminal (on Windows the Command Prompt) and run it with the
local_mailfolder and a target folder:node youniqmail-local-mail-decrypt.mjs <local_mail folder> <target folder> -
Enter the recovery key when asked. What you type stays hidden.
Every email then sits in the target folder as an .eml file, named
after its date and subject. The program reports a damaged file and
leaves it out, and a second run overwrites nothing. It needs no
internet connection and sends nothing anywhere. How the files are built
is described in plain text at the top of the program.
The local_mail folder is in your profile:
~/Library/Application Support/YouniqMail/local_mail/%APPDATA%\YouniqMail\local_mail\~/.config/YouniqMail/local_mail/If you want to reset local data, rescue Local Folders beforehand
with the emergency program: after the reset, YouniqMail cleans up the
files in local_mail that are no longer needed after three days.
What lives outside the database
Section titled “What lives outside the database”The files with email content and the contact photos that YouniqMail keeps next to the database are encrypted with the same key as the database:
- cached attachments (folder
attachment_cache, at most 500 MB): the attachments of the emails you expand, up to 10 MB per file and 25 MB per email, as well as embedded images and every attachment you open, save or preview, - attachments of drafts and of mail in the outbox (folders
draft_attachmentsandoutbox_attachments), - mail currently being sent, until its copy has arrived in the
Sent folder (folder
sent_pending), - photos you pick for your contacts (folder
profile_images).
Their file names give nothing away either. When the database is not encrypted, neither are these files. What an older version stored there unencrypted, YouniqMail encrypts or deletes at the next start. Only the system’s disk encryption makes traces of it left on the disk unreadable.
Not encrypted are:
- the log (folder
logs), in which YouniqMail masks passwords, tokens and other secrets, but not email addresses, - the settings in
config.json, including the master password hint.
All of them live in the same profile folder as local_mail. To
protect the computer against outside access to the disk, also switch
on the system’s disk encryption (FileVault, BitLocker, LUKS).
Files you open from YouniqMail, copy or view with Quick Look (macOS), attachments prepared for a forward, images you resize while writing, and contacts you import from Google, Microsoft or iCloud (Pro) go to a folder inside the system’s temporary folder that only you can open. Files from encrypted emails that you open, copy or view are removed again when YouniqMail locks and when it quits. Attachments of an encrypted email you forward stay until you send the email, close the window or quit YouniqMail. Locking leaves them in place, because the window still needs them after you unlock. When the database is encrypted, YouniqMail also removes the other attachments you opened, copied or forwarded and the resized images when it quits, so paste a copied attachment before you quit. Everything else goes at the latest the next time it starts, also after a crash.
What it protects and what it does not
Section titled “What it protects and what it does not”Storage encryption protects the file on disk: against a stolen machine, against copying the database, against curious eyes on a backup drive.
It does not protect against someone sitting at your unlocked computer. There, the database is readable by design. For that there is the master password. And it does not encrypt the transport to the other side. That is what PGP and S/MIME (Pro) are for.