Skip to content

[mu bug] mu should return the encrypted flag for S/MIME enveloped-data #2745

@Cerebus

Description

@Cerebus

Describe the bug

mu does not recognize S/MIME enveloped messages (Content-Type: application/pkcs7-mime; smime-type=enveloped-data) and does not return the encrypted flag for these messages.

How to Reproduce

  1. Receive an encrypted S/MIME message as the whole message (i.e., not multipart/encrypted).
  2. Index the message.
  3. Retrieve the message flags from mu.

Best practice with S/MIME encryption is to envelope the signature (sign first, then encrypt), which is what message-mode and Outlook does. Basically, the message is sent as enveloped-data, which contains a multipart-signed MIME message (or a plain signed message, depending on the sending MUA configuration [e.g., "opaque signing" on Outlook]). To do otherwise implies a binding between the signing key and the encryption key which is not always true.

See attached sample raw message (all Received & associated stuff removed).

msg.txt

I don't expect mu to decrypt and index content with gpgsm (though it would be nice). Flagging as encrypted is necessary for mu4e-compose-crypto-policy to take effect. When the flag is manually set via mu4e--server-move with "+x", the compose policy works with S/MIME as expected. This is not a viable workaround b/c these flags do not persist when the message is moved between mailboxes, or between mu4e sessions.

Environment
macOS 14.6
Emacs 29.4
mu 1.12.6

Checklist

  • you are running either the latest 1.10.x/1.12.x release or master (otherwise, please upgrade).

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions