Skip to content

feat(pgp): save drafts of encrypted messages encrypted - #603

Closed
hanthor wants to merge 5 commits into
hyprlab:mainfrom
tuna-os:feat/pgp-encrypted-drafts
Closed

hanthor wants to merge 5 commits into
hyprlab:mainfrom
tuna-os:feat/pgp-encrypted-drafts

Conversation

@hanthor

@hanthor hanthor commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Builds on #602.

Drafts of a message marked Encrypt were saved in plaintext to the server and the draft_copies cache. They are now encrypted to the user's own key (not signed), with subject and recipients inside and Autocrypt-Draft-State: encrypt=yes outside, on the IMAP, JMAP and Graph draft paths. Reopening decrypts on a background thread and opens the composer with Encrypt on.

Tests: the round trip through the draft cache with a throwaway keyring. Not tested live: whether Exchange stores a PGP/MIME draft intact.

Bcc recipients go to gpg as hidden recipients, so To and Cc cannot see whose keys were Bcc'd. A good signature from a key without the From address shows amber, not green. Encrypting to a key the keyring does not vouch for asks first in the composer, and each address is encrypted to the checked key by fingerprint, preferring a vouched one.
An account can now send its key in an Autocrypt header and keep the keys others send, gossip included, in a keyring of Hylki's own rather than the user's GnuPG keyring. Recipients are looked up by WKD while a message is addressed, each pill shows where its key comes from, and Encrypt turns on when everyone prefers it.
A draft of a message set to be encrypted was saved readable to the server and to the local draft cache. It is now encrypted to the user's own key alone, unsigned, with its subject and recipients inside and an Autocrypt-Draft-State header outside, on IMAP, JMAP and Microsoft 365. Opening it again decrypts it off the main thread and opens the composer with Encrypt on.
hyprlab added a commit that referenced this pull request Nov 14, 2026
A draft of a message set to be encrypted was saved readable to the server and the draft cache. It is now encrypted to the user's own key, unsigned, with its subject and recipients inside and an Autocrypt-Draft-State header outside, on IMAP, JMAP and Microsoft 365. Opening it decrypts it off the main thread and opens the composer with Encrypt on.

Landed with one change: without gpg or a key of the user's own, the draft is still saved readable, as before, rather than failing to save.

Co-Authored-By: James Reilly <5840441+hanthor@users.noreply.github.com>
@hyprlab

hyprlab commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Agentic reply:

Your encrypted drafts are in the 1.49.0-beta.1 release, landed by hand and credited to you. At landing, a draft is saved readable when there is no own key to encrypt it to, as before. Please test it there and report anything that doesn't look right. It reaches the stable channel with the next stable release.

If you've installed Hylki beta as a Flatpak, running flatpak update will pick it up automatically. If not, download and install it first:

flatpak install --user --from https://hylki.hyprlab.co/flatpak/co.hyprlab.Hylki.Beta.flatpakref

AppImage, Debian and RPM betas: See Beta channel for update details.

@hyprlab hyprlab closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants