Decrypt Emails using PGP Command Line (.msg or .eml)
search cancel

Decrypt Emails using PGP Command Line (.msg or .eml)


Article ID: 243419


Updated On:


Endpoint Encryption Desktop Email Encryption Drive Encryption Encryption Management Server File Share Encryption Gateway Email Encryption PGP Command Line PGP Key Management Server PGP Key Mgmt Client Access and CLI API PGP SDK


Historically, PGP Command Line has always had the ability to decrypt files in an automated fashion by incorporating your own custom scripting with the PGP Binary.   If there were emails that were encrypted in Outlook, and you have a lot of those emails you would like to decrypt, the PGP Command Line can now do that starting with version 10.5.1.



To be able to decrypt, you would use the "--decrypt" option, coupled with the "--email" option. 

For example, The following email called "pgp mime + html + encrypt only.msg" has encrypted content.  Upon opening the file, you will see the indications when you see the "version.txt" and "message.pgp", indicating the email was encrypted using the PGP/MIME Encoding:

These .pgp files can be decrypted manually, but the result may not be in a format that is easy to read.  

In order to decrypt this email, run the following command:

pgp --decrypt --email "pgp mime + html + encrypt only.msg" --passphrase "password-here"


Upon entering this command, you'll see the result will output a .eml file:

Outlook will recognize this format:

Upon opening this file, the email can be viewed within Outlook and will appear like a regular email:

The message above looks like a normal message, but it does not have any indications that it was previously encrypted.  If you would like to also include a "Decrypted" annotation, then use the "--annotate" option in the command:


pgp --decrypt --email "pgp mime + html + encrypt only.msg" --passphrase "password-here --annotate"

As you can see, the above will show "Decrypted" so you will know that it was processed as an encrypted email.


Once PGP Command Line decrypts the message, the .eml file it creates can also be opened with a text viewer to see the content:

Additional Information

222967 - PGP Command Line cannot decrypt email files using keys from a remote Encryption Management Server