PGP/MIME handler
Problem discussion
RFC2015 defines a proposed internet standard for sending PGP-encrypted mails. Although only very few MUAs currently support it (Mutt, for example), decrypting and verifying such mails is very uncomfortable. Usually, you will need to save the message in a file and verify / decrypt it manually. Moreover, unencrypted messages with a detached signature cannot (without a significant amount of work) be verified at all. This can be pretty annoying.
Although there is hope with the AEGYPTEN project, I think a smaller (less featured) and generically applicable solution would be fine as well. Moreover, I sometimes am an impatient person ;-)
Overview
This script takes a complete mail text on STDIN. It then tries to parse it using the great and famous MIME::Utils by ERYQ, determines the Content-Type and acts accordingly: Signed mails are verified and the result (output by gpg) is attached.
If we're dealing with an encrypted mail, the mail is decrypted. This handles attachments as well.
For decrypting the message, of course, the passphrase for gpg is required. You need a program that can ask you the phrase and outputs that (and nothing else) on STDOUT. Theoretically, you could use a program like echo "my secret passphrase", but it is obvious that this is not really secure. So I recommend the password-dialog-enriched version of kdialog available here for all the KDE users with versions prior to 3.1 out there. Kdialog has been integrated into KDE 3.1.
Features
Drawbacks
Known Problems
Requirements
The above mentioned Perl modules are all obtainable via CPAN.
Installation
cat mail.txt | pgp-mime-handler.pl > testmail.txt && less testmail.txt (or similar).
That's it. Adding a filter rule in KMail is quite trivial. Enjoy!-)
Notes
He also wrote some documentation on how to get pgp-mime-handler running with pine.
If you make any changes to the source code, I'd like to be notified, too. The license for this script is the LGPL.
Download
|
script |
15.0 K |
|
signature |
234 |