summaryrefslogtreecommitdiffstats
path: root/crypt.c
diff options
context:
space:
mode:
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>2019-12-17 03:02:19 +0100
committerKevin McCarthy <kevin@8t8.us>2019-12-21 09:58:33 -0800
commit162e60883c76071641dcc46ef09bd596f50068a3 (patch)
tree02f0a1af1215c905aa43364c1769f56dcb007b87 /crypt.c
parentb2c7aad851000edd108ea598bcb3e4ec70d91993 (diff)
Add protected-headers="v1" to Content-Type when protecting headers
This is optional part of the draft RFC, marked with "FIXME": * FIXME: Enigmail adds "protected-headers="v1"" parameter to "payload" here. Is this necessary? The answer is: for Enigmail yes. Otherwise it ignores protected headers and use the envelope headers. This results in all the emails listed with "..." subject, which isn't very helpful. Since the user can disable protected headers while in the compose menu (after potentially failed send), remove the attribute if protected headers are disabled.
Diffstat (limited to 'crypt.c')
-rw-r--r--crypt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypt.c b/crypt.c
index 3e9d0449..87cf2534 100644
--- a/crypt.c
+++ b/crypt.c
@@ -231,7 +231,11 @@ int mutt_protect (HEADER *msg, char *keylist, int postpone)
mutt_free_envelope (&msg->content->mime_headers);
msg->content->mime_headers = protected_headers;
+ /* Optional part of the draft RFC, but required by Enigmail */
+ mutt_set_parameter("protected-headers", "v1", &msg->content->parameter);
}
+ else
+ mutt_delete_parameter("protected-headers", &msg->content->parameter);
/* A note about msg->content->mime_headers. If postpone or send
* fails, the mime_headers is cleared out before returning to the