It would blindly overwrite any attachment with that type, as if it
were the version label part of a multipart/encrypted message.
However attachments with extenstion .gpg are labeled that type if
$mime_type_query_command is set to "xdg-mime query filetype". This
would cause the attachment to be overwritten too.
Add a check for a missing body->filename, which should only be the
case for the manually constructed part.
Co-authored-by: Richard Russon <rich@flatcap.org>
}
/* This is pretty gross, but it's the best solution for now... */
- if (((WithCrypto & APPLICATION_PGP) != 0) && (a->type == TYPE_APPLICATION) &&
- (mutt_str_strcmp(a->subtype, "pgp-encrypted") == 0))
+ if ((WithCrypto & APPLICATION_PGP) && (a->type == TYPE_APPLICATION) &&
+ (mutt_str_strcmp(a->subtype, "pgp-encrypted") == 0) && !a->filename)
{
fputs("Version: 1\n", fp);
return 0;