I have a script that does gpg-encryption of text and mails it out.
I use MacGPG / Apple Mail, which decrypts it fine, but doesn’t display the text afterwards and instead displays attachments.
These are the mails i construct, what is wrong with it?
...
Date: Wed, 25 Apr 2012 16:01:04 +0200
From: <deleted>
To: <deleted>
Message-ID: <deleted>
Subject: asdf
Mime-Version: 1.0
Content-Type: multipart/encrypted;
boundary=4b5784e4-fc05-45bb-9a72-e9070a11423c;
charset=UTF-8;
protocol="application/pgp-encrypted"
Content-Transfer-Encoding: 7bit
--4b5784e4-fc05-45bb-9a72-e9070a11423c
Date: Wed, 25 Apr 2012 16:01:04 +0200
Mime-Version: 1.0
Content-Type: application/pgp-encrypted;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <deleted>
Version: 1
--4b5784e4-fc05-45bb-9a72-e9070a11423c
Date: Wed, 25 Apr 2012 16:01:04 +0200
Mime-Version: 1.0
Content-Type: application/octet-stream;
charset=UTF-8;
name=msg.asc
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename=msg.asc
Content-ID: <deleted>
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.17 (GNU/Linux)
<PGPDATA>
-----END PGP MESSAGE-----
--4b5784e4-fc05-45bb-9a72-e9070a11423c--
I think your problem here is, that the encrypted data contains only plain text and is not a fully compliant RFC822 mail message.
As the PGP/MIME RFC 3156 states under section 4, OpenPGP encrypted data
Following is an example of an RFC822 compliant mail message, which should
be processed and displayed as expected.