The basic way to decode encrypted messages is to use premail
-decode
as a command line. You can either give a filename as an
argument, or premail will accept the encrypted message on its standard
input. In either case, the decoded message will be printed on the
standard output.
The message can be a standard e-mail message (RFC 822 format), or it can be an entire mailbox. In the latter case, premail will decode each of the messages individually. If you don't have premail directly integrated into your mailer, then here's a handy way to view your mail:
premail -decode $MAIL | more
If the message is actually encrypted, then premail will need to
access the secrets file. If you are logged out of premail, then
premail will try to open an xterm window for you to type the
passphrase for the secrets file. If that doesn't succeed, premail will
print an error message. At that point, you might choose to log in
(i.e. premail -login
) and then try the decoding again.
If, as in many mailers, you have easy access to the body of the
message but not the header, then you can use premail -decode
-body
on the body. This works well for plain PGP encrypted
messages, but unfortunately does not work for MIME-based message
formats, because important information is contained in the header.
The results of the decoding (including signature verification) are
given in an X-Premail-Auth:
header field. This header field
is protected against forgery; if the original message contains it, it
is changed to X-Attempted-Auth-Forgery
.