I received an email in cleartext from someone with a signature.asc attached. Looking at the raw source for the email, it was sent with Apple Mail + GPGMail. Reading the message in Thunderbird + Enigmail successfully shows up as a GOOD signature in the Enigmail details when opening the message. The text is not ASCII armored.

However, attempting to verify the message with gpg results in BAD signature. Using the attached (detached) signature file, I tried the following input files with no success:

  • Full raw email with all headers (this of course should not work because the mail servers add headers after the sender has finished composing and signing the message)
  • Raw email file without email headers (email starts at the From: header)
  • munpacked mime parts individually (the ascii part and the html part as message inputs)

1 Answer 1


Stumbling upon this email made everything clear (as well as glancing at RFC3156).

The email is of type multipart/signed which

The multipart/signed body MUST consist of exactly two parts. The first part contains the signed data in MIME canonical format, including a set of appropriate content headers describing the data.

The second body MUST contain the OpenPGP digital signature. It MUST be labeled with a content type of "application/pgp-signature".

The signature signs the first part. The first part was actually a multipart of the text and html parts. Every email client I looked at didn't make this heirarchy clear and flattened it into three parts (text, html, signature).

Verifying the signature just using the raw MIME text of the first multipart successfully verified.

  • 1
    BTW: with mutt those hierachies are visible and you can save the parts seperately.
    – eckes
    Mar 29, 2016 at 19:05
  • 1
    Hmm... I was expecting a proper gpg command in the answer.
    – modular
    Feb 27, 2018 at 7:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .