summaryrefslogtreecommitdiffstats
path: root/crypt.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2018-12-23 16:32:52 -0800
committerKevin McCarthy <kevin@8t8.us>2018-12-25 13:52:03 -0800
commit66e0958411fb4477f51528921836f41a61075daf (patch)
tree6c8a9e0e7e9a1e91d89afd8d9751773a05e00a44 /crypt.c
parentf1431b15ce8762929cbbe7010d54fd48687b4c2a (diff)
Finish protected header write support.
Write out the protected headers when writing the mime header part. Hide protected subjects with $crypt_protected_headers_subject, for outgoing, postponed, and fcc'ed messages. Don't hide in postponed and fcc'ed if $crypt_protected_headers_read isn't set. Add a few missing cases where mime_headers needed to be cleaned up on error. Remove the protected headers for $fcc_clear.
Diffstat (limited to 'crypt.c')
-rw-r--r--crypt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypt.c b/crypt.c
index f68d4f55..e1ab409e 100644
--- a/crypt.c
+++ b/crypt.c
@@ -926,6 +926,17 @@ static void crypt_fetch_signatures (BODY ***signatures, BODY *a, int *n)
}
}
+int mutt_should_hide_protected_subject (HEADER *h)
+{
+ if (option (OPTCRYPTPROTHDRSWRITE) &&
+ (h->security & ENCRYPT) &&
+ !(h->security & INLINE) &&
+ ProtHdrSubject && *ProtHdrSubject)
+ return 1;
+
+ return 0;
+}
+
int mutt_protected_headers_handler (BODY *a, STATE *s)
{
if (option (OPTCRYPTPROTHDRSREAD) && a->mime_headers)