Some clients (or even mail servers) improperly encode the octetstream
part.
Thanks to Riccardo Schirone for the original merge request patch.
This commit also handles the attachment menu, and makes the decoding
conditional so it's not done if it isn't necessary.
first_part->warnsig = 0;
if (mutt_is_valid_multipart_pgp_encrypted (b))
+ {
b = b->parts->next;
+ /* Some clients improperly encode the octetstream part. */
+ if (b->encoding != ENC7BIT)
+ need_decode = 1;
+ }
else if (mutt_is_malformed_multipart_pgp_encrypted (b))
{
b = b->parts->next->next;
mutt_free_envelope (&b->mime_headers);
mutt_free_envelope (&octetstream->mime_headers);
- rc = crypt_pgp_encrypted_handler (octetstream, s);
+ /* Some clients improperly encode the octetstream part. */
+ if (octetstream->encoding != ENC7BIT)
+ rc = run_decode_and_handler (octetstream, s, crypt_pgp_encrypted_handler, 0);
+ else
+ rc = crypt_pgp_encrypted_handler (octetstream, s);
b->goodsig |= octetstream->goodsig;
/* Relocate protected headers onto the multipart/encrypted part */
int rv = 0;
if (mutt_is_valid_multipart_pgp_encrypted (b))
+ {
b = b->parts->next;
+ /* Some clients improperly encode the octetstream part. */
+ if (b->encoding != ENC7BIT)
+ need_decode = 1;
+ }
else if (mutt_is_malformed_multipart_pgp_encrypted (b))
{
b = b->parts->next->next;