int rv = -1;
STATE s;
int sec_type;
+ ENVELOPE *protected_headers = NULL;
memset (&s, 0, sizeof (s));
mutt_free_body (&newhdr->content);
newhdr->content = b;
+ if (b->mime_headers)
+ {
+ protected_headers = b->mime_headers;
+ b->mime_headers = NULL;
+ }
+
mutt_clear_error ();
}
/* destroy the signature */
mutt_free_body (&newhdr->content->parts->next);
newhdr->content = mutt_remove_multipart (newhdr->content);
+
+ if (newhdr->content->mime_headers)
+ {
+ mutt_free_envelope (&protected_headers);
+ protected_headers = newhdr->content->mime_headers;
+ newhdr->content->mime_headers = NULL;
+ }
}
goto bail;
}
+ if (b == newhdr->content && !protected_headers)
+ {
+ protected_headers = b->mime_headers;
+ b->mime_headers = NULL;
+ }
+
newhdr->security |= sec_type;
b->type = TYPETEXT;
mutt_str_replace (&b->subtype, "plain");
if (b->hdr) b->hdr->content = NULL; /* avoid dangling pointer */
}
+ if (option (OPTCRYPTPROTHDRSREAD) &&
+ protected_headers &&
+ protected_headers->subject &&
+ mutt_strcmp (newhdr->env->subject, protected_headers->subject))
+ {
+ mutt_str_replace (&newhdr->env->subject, protected_headers->subject);
+ }
+ mutt_free_envelope (&protected_headers);
+
/* Fix encryption flags. */
/* No inline if multipart. */