summaryrefslogtreecommitdiffstats
path: root/crypt.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2024-04-13 13:22:11 +0800
committerKevin McCarthy <kevin@8t8.us>2024-04-13 18:29:40 +0800
commit0d75d71a6f1b6a8a24ccb7fe4e6a9889b4ff8b0b (patch)
tree659d7d0a86094b17dd5fec085a7c218993a29e4d /crypt.c
parent00d56288d33005b7412c5fd8b36ccc1d27d12c2f (diff)
Add $smime_pkcs7_default_smime_type config option.
This works around Outlook sending application/pkcs7-mime ".p7m" parts without a smime-type parameter. Mutt previously hardcoded an assumption that these were SignedData to work around an old Outlook book. However Outlook now appears to also send EnvelopedData in this form.
Diffstat (limited to 'crypt.c')
-rw-r--r--crypt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypt.c b/crypt.c
index a9f7089d..245a7d2a 100644
--- a/crypt.c
+++ b/crypt.c
@@ -610,9 +610,14 @@ int mutt_is_application_smime (BODY *m)
{
len++;
if (!ascii_strcasecmp ((t+len), "p7m"))
- /* Not sure if this is the correct thing to do, but
- it's required for compatibility with Outlook */
- return (SMIMESIGN|SMIMEOPAQUE);
+ {
+ if (!ascii_strcasecmp (SmimePkcs7DefaultSmimeType, "signed"))
+ return (SMIMESIGN|SMIMEOPAQUE);
+ else if (!ascii_strcasecmp (SmimePkcs7DefaultSmimeType, "enveloped"))
+ return SMIMEENCRYPT;
+ else
+ return 0;
+ }
else if (!ascii_strcasecmp ((t+len), "p7s"))
return (SMIMESIGN|SMIMEOPAQUE);
}