Skip to content

feat(compose): sign outgoing mail with S/MIME through gpgsm (#478) - #705

Closed
adriadam10 wants to merge 1 commit into
hyprlab:mainfrom
adriadam10:smime-sign
Closed

adriadam10 wants to merge 1 commit into
hyprlab:mainfrom
adriadam10:smime-sign

Conversation

@adriadam10

Copy link
Copy Markdown
Contributor

First slice of #478: signing outgoing mail with S/MIME, through gpgsm, the S/MIME half of the GnuPG that OpenPGP already uses. No new crates.

What it does

  • A per-account switch, Settings → Accounts → S/MIME → Sign every message (smime_sign = true in accounts.toml). With it on, every message the account sends is signed with the certificate gpgsm has for the From address, or for the account's address when an alias has none.
  • The message goes out as multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256 with an smime.p7s part. It reuses signed_multipart from the PGP/MIME code (now taking the protocol), so it keeps the PGP signature fails when using exchange mail server #666 layout that survives Exchange's rewrite.
  • A message signed or encrypted with OpenPGP is not also signed with S/MIME. Drafts are not signed, and sent_body_preview never calls gpgsm.
  • The key stays in gpg-agent, and pinentry asks for its passphrase, as with OpenPGP.

Not in this PR: reading or verifying incoming S/MIME, encryption, a per-message toggle in the composer, or certificate management in Settings. Each of these can come later if this shape suits you.

Tested

  • smime_mime::tests::signs_into_multipart_signed_that_verifies creates a throwaway keybox holding a self-signed certificate, signs from the account address and from an alias, and checks that gpgsm --verify reports GOODSIG over the exact bytes of the signed part. It skips when gpgsm is missing.
  • The existing PGP/MIME tests pass with the refactored signed_multipart.
  • I signed a message with a real CA-issued certificate (WISeKey) and verified it with openssl smime -verify against the system CA store, both as built and after sending it through a real SMTP server and fetching it back over IMAP.
  • Not checked: Flatpak. The ~/.gnupg and gpg-agent socket permissions are already there for OpenPGP; I have not checked whether the GNOME runtime's GnuPG includes gpgsm.

Docs: DOCUMENTATION.md (setup, including repacking a Thunderbird or Firefox .p12 that gpgsm 2.4 cannot parse), FEATURES.md and CHANGELOG.md.

)

A per-account switch, smime_sign, signs every message the account sends with the certificate gpgsm holds for the From address, or for the account's address when an alias has none.

The body goes out as multipart/signed with an smime.p7s part, reusing the PGP/MIME layout from hyprlab#666. Mail signed or encrypted with OpenPGP, and drafts, are left alone.

Co-Authored-By: Claude <noreply@anthropic.com>
@hyprlab

hyprlab commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Awesome work, thank you for this PR! It's been merged and will be in the next beta build for testing. Please proceed with the rest you mentioned that weren't in this PR so we can have a complete solution

@hyprlab

hyprlab commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Agentic reply:

1.50.0-beta.2 is in the repo now. 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 23, 2026
hyprlab added a commit that referenced this pull request Nov 24, 2026
lancelee25's translation, attached to #155, merged with the current template: every string but the #701 shared mailbox, #702 hover action and #705 S/MIME ones. Plural forms set to Chinese's single form (nplurals=1), keeping the plural text of each entry. Also the credits.

Co-Authored-By: lancelee25 <42861323+lancelee25@users.noreply.github.com>
hyprlab added a commit that referenced this pull request Nov 24, 2026
f4646's translation merged with the current template: every string but the #705 S/MIME and #708 Duck Address ones. Fixed at landing: Left worded like Right in the same dropdown (Solda), and the today words cut to bugün, since a single "bu" would have dated any message with "this" in it. Also the Turkish label for the GNOME Files entry and the credits.

Co-Authored-By: f4646 <245043423+f4646@users.noreply.github.com>
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