Set Up Autocrypt#
Overview#
NeoMutt can be compiled with Autocrypt support by running configure with the --autocrypt flag.
Autocrypt provides easy to use, passive protection against data collection.
Keys are distributed via an Autocrypt: header added to emails.
It does not protect against active adversaries, and so should not be considered a substitute for normal encryption via your keyring, using key signing and the web of trust to verify identities.
With an understanding of these limitations, Autocrypt still provides an easy way to minimize cleartext emails sent between common correspondents, without having to explicitly exchange keys.
More information can be found at https://autocrypt.org/.
Prerequisites#
GnuPG 2.1 or greater — Autocrypt requires support for ECC cryptography, and NeoMutt by default will generate ECC keys.
GPGME 1.8.0 or later — NeoMutt’s Autocrypt implementation uses GPGME.
SQLite3 — Account and peer information is stored in a sqlite3 database. NeoMutt must be configured with
--with-sqlitewhen autocrypt is enabled.IDN2 support (recommended) — Configure NeoMutt with
--idn2(enabled by default) so that Autocrypt can properly deal with international domain names.While NeoMutt uses GPGME for Autocrypt, normal keyring operations can still be performed via classic mode (i.e. with
$crypt_use_gpgmeunset). However, to avoid unnecessary prompts, it is recommended gpg not be configured inloopback pinentrymode, and that$pgp_use_gpg_agentremain set (the default).
First Run#
Set
$autocryptin yourneomuttrc, and optionally change the value of$autocrypt_dir:set autocrypt # set autocrypt_dir = "~/.local/share/autocrypt"
The first time NeoMutt is run after that, you will be prompted to create
$autocrypt_dir. NeoMutt will then automatically create an sqlite3 database and GPG keyring in that directory. Since these files should be considered private, NeoMutt will create this directory with mode700. If you create the directory manually, you should do the same.NeoMutt recommends keeping the
$autocrypt_dirdirectory set differently from your GnuPG keyring directory (e.g.~/.gnupg). Keys are automatically imported into the keyring fromAutocrypt:headers. Compared to standard “web of trust” keys, Autocrypt keys are somewhat ephemeral, and the autocrypt database is used to track when keys change or fall out of use. Having these keys mixed in with your normal keyring will make it more difficult to use features such as$crypt_opportunistic_encryptand Autocrypt at the same time.The
$autocrypt_dirvariable is not designed to be changed while NeoMutt is running. The database is created (if necessary) and connected to during startup. Changing the variable can result in a situation where NeoMutt is looking in one place for the database and a different place for the GPG keyring, resulting in strange behavior.Once the directory, keyring, and database are created, NeoMutt will ask whether you would like to create an account. In order to use Autocrypt, each sending address needs an account. As a convenience you can create an account during the first run. If you would like to add additional accounts later, this can be done via the
<autocrypt-acct-menu>function in the index, by default bound to A.Account creation will first ask you for an email address. Next, it will ask whether you want to create a new key or select an existing key. (Note key selection takes place from the
$autocrypt_dirkeyring, which will normally be empty during first run). Finally, it will ask whether this address should prefer encryption or not. Autocrypt 1.1 allows automatically enabling encryption if both sender and receiver have set “prefer encryption”. Otherwise, you will need to manually enable autocrypt encryption in the compose menu.After optionally creating an account, NeoMutt will prompt you to scan mailboxes for Autocrypt headers. This step occurs because header cached messages are not re-scanned for Autocrypt headers. Scanning during this step will temporarily disable the header cache while opening each mailbox. If you wish to do this manually later, you can simulate the same thing by unsetting
$header_cacheand opening a mailbox.
Note
The first run process takes place between reading the neomuttrc and opening the initial mailbox.
Some neomuttrc files will :push macros to be run after opening the mailbox.
To prevent this from interfering with the first run prompts, NeoMutt disables all macros during the first run.
Account Management#
The Autocrypt Account Menu is available from the index via <autocrypt-acct-menu>, by default bound to A.
See the Autocrypt Account Menu for the list of functions and their default keybindings.
In this menu, you can:
Create new accounts
Delete accounts
Toggle an account active/inactive
Toggle the “prefer encryption” flag for an account
Deleting an account only removes the account from the database. The GPG key is kept, to ensure you still have the ability to read past encrypted emails.
📷 Screenshot Needed
Subject: Autocrypt Account Menu
Description: The NeoMutt Autocrypt Account Menu accessed via A from the index. The menu lists configured Autocrypt accounts with their email addresses, active/inactive status, and prefer-encryption flag.
Highlights: The account list with status indicators, and the available key bindings for creating, deleting, toggling active/inactive, and toggling the prefer-encryption flag.
Note
The Autocrypt 1.1 “Setup Message” feature is not available yet, but will be added in the future.
Alternative Key and Keyring Strategies#
NeoMutt by default partitions Autocrypt from normal keyring encryption/signing.
It does this by using a separate GPG keyring (in $autocrypt_dir) and creating a new ECC key in that keyring for accounts.
There are good reasons for doing this by default:
It keeps random keys found inside email headers out of your normal keyring.
ECC keys are compact and better suited for email headers.
Autocrypt key selection is completely different from “web of trust” key selection, based on last-seen rules as opposed to trust and validity.
It also allows NeoMutt to distinguish Autocrypt encrypted emails from regular encrypted emails, and set the mode appropriately when replying to each type.
Using an Existing Key from Your Normal Keyring#
Some users may want to use an existing key from their normal keyring for Autocrypt too. There are two ways this can be accomplished.
Recommended method: Set $autocrypt_dir to your normal keyring directory (e.g. ~/.gnupg).
During account creation, choosing “(s)elect existing GPG key” will then list and allow selecting your existing key for the new account.
Alternative method: Copy your key over to the Autocrypt keyring. However, there is a severe downside. NeoMutt first tries to decrypt messages using the Autocrypt keyring, and if that fails tries the normal keyring second. This means all encrypted emails to that key will be decrypted, and have signatures verified from, the Autocrypt keyring. Key signatures and web of trust from your normal keyring will no longer show up in signatures when decrypting.
For that reason, if you want to use an existing key from your normal keyring, it is recommended to just set $autocrypt_dir to ~/.gnupg.
This allows “web of trust” to show an appropriate signature message for verified messages.
Autocrypt header keys will be imported into your keyring, but if you don’t want them mixed you should strongly consider using a separate autocrypt key and keyring instead.
Caveats for Both Methods#
Replying to an Autocrypt decrypted message by default forces Autocrypt mode on. By sharing the same key, all replies will then start in Autocrypt mode, even if a message wasn’t sent by one of your Autocrypt peers.
$autocrypt_replycan be unset to allow manual control of the mode when replying.When NeoMutt creates an account from a GPG key, it exports the public key, base64 encodes it, and stores that value in the sqlite3 database. The value is then used in the Autocrypt header added to outgoing emails. The ECC keys NeoMutt creates don’t change, but if you use external keys that expire, when you resign to extend the expiration you will need to recreate the Autocrypt account using the account menu. Otherwise the Autocrypt header will contain the old expired exported keydata.