summaryrefslogtreecommitdiffstats
path: root/crypt.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2018-12-11 14:11:30 -0800
committerKevin McCarthy <kevin@8t8.us>2018-12-17 13:30:53 -0800
commitcac6705aa51f281f6eba22136f6ce51490c62dff (patch)
treefda22ce1f6b238407047a5304bfc3bd58dfe8133 /crypt.c
parent09dd4a5d7b69dc688c4a7f3c07b74b66bea7315f (diff)
Add protected header received email support.
Add $crypt_protected_headers_read config variable to enable reading and updating the index/header cache. Print protected Subject header in the pager as parts are rendered. Once opened, update the index, subject hash, and header cache.
Diffstat (limited to 'crypt.c')
-rw-r--r--crypt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/crypt.c b/crypt.c
index d5899075..203a6c94 100644
--- a/crypt.c
+++ b/crypt.c
@@ -908,6 +908,22 @@ static void crypt_fetch_signatures (BODY ***signatures, BODY *a, int *n)
}
}
+int mutt_protected_headers_handler (BODY *a, STATE *s)
+{
+ if (option (OPTCRYPTPROTHDRSREAD) && a->mime_headers)
+ {
+ if (a->mime_headers->subject)
+ {
+ mutt_write_one_header (s->fpout, "Subject", a->mime_headers->subject,
+ s->prefix,
+ mutt_window_wrap_cols (MuttIndexWindow, Wrap),
+ (s->flags & MUTT_DISPLAY) ? CH_DISPLAY : 0);
+ state_puts ("\n", s);
+ }
+ }
+
+ return 0;
+}
/*
* This routine verifies a "multipart/signed" body.
@@ -1022,6 +1038,7 @@ int mutt_signed_handler (BODY *a, STATE *s)
/* Now display the signed body */
state_attach_puts (_("[-- The following data is signed --]\n\n"), s);
+ mutt_protected_headers_handler (a, s);
FREE (&signatures);
}