From 2c1bdd7e8ece30c710b77dbaf66fa2d7f10b9710 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 21 Mar 2012 11:51:43 -0400 Subject: [PATCH] Move send_pgp_mime post to pgp-mime, now that it's an official package. --- posts/Gentoo_overlay.mdwn | 2 ++ posts/pgp-mime.mdwn | 34 ++++++++++++++++++++++++++++++++++ posts/send_pgp_mime.mdwn | 39 --------------------------------------- 3 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 posts/pgp-mime.mdwn delete mode 100644 posts/send_pgp_mime.mdwn diff --git a/posts/Gentoo_overlay.mdwn b/posts/Gentoo_overlay.mdwn index 1e423b7..d3a27a2 100644 --- a/posts/Gentoo_overlay.mdwn +++ b/posts/Gentoo_overlay.mdwn @@ -43,6 +43,8 @@ personal `layman.xml`). The overlay is a fairly strange mix: ([geopy](http://www.geopy.org/)) - dev-python/h5config (my [[h5config]] package) +- dev-python/pgp-mime + (my [[pgp-mime]] package) - dev-python/pymodbus ([pymodbus](http://code.google.com/p/pymodbus/)) - deb-python/pypid diff --git a/posts/pgp-mime.mdwn b/posts/pgp-mime.mdwn new file mode 100644 index 0000000..83deb8b --- /dev/null +++ b/posts/pgp-mime.mdwn @@ -0,0 +1,34 @@ +[[!meta title="pgp-mime"]] +[[!template id=gitrepo repo=calibcant]] +[[!meta date="2009-02-04 11:39:37"]] + +I've been scripting up a few things recently and my inability to send +nicely formatted [[OpenPGP|PGP]] messages was starting to really bug +me. I had been encrypting my logwatch output with `gpg` and just +emailing the raw `gpg` output to myself, but it's annoying to have to +ESC-P every time I want to decrypt a log. The tipping point came +while I was writing up a script to automatically email grades out to +my students (not that any of the student's care about PGP, but it's +the principle of the thing ;), since there's no way I'm going to send +them raw gpg output (they would die) and there's also no way I'm going +to hold Mutt's hand while it signs the emails. I dunno why Mutt +doesn't have some `--batch` mode options to support PGP, but there it +is. + +Pgp-mime is my home-grown solution. It' not very complicated really, +just implementing the [RFC 3156][] specs in [[Python]]. It's been +through a number of iterations over the years, and now (2012) I think +the interface has matured to the point of actually being useful to +other people as well ;). [[Email me|contact]] with (encrypted!) +feedback. + +The `README` is posted on the [PyPI page][pypi]. + +[RFC 3156]: http://www.ietf.org/rfc/rfc3156.txt +[pypi]: http://pypi.python.org/pypi/pgp-mime/ + +[[!tag tags/code]] +[[!tag tags/linux]] +[[!tag tags/programming]] +[[!tag tags/pypi]] +[[!tag tags/python]] diff --git a/posts/send_pgp_mime.mdwn b/posts/send_pgp_mime.mdwn deleted file mode 100644 index b6c59d2..0000000 --- a/posts/send_pgp_mime.mdwn +++ /dev/null @@ -1,39 +0,0 @@ -[[!meta title="Command line PGP/MIME"]] -[[!meta date="2009-02-04 11:39:37"]] - -I've been scripting up a few things recently and my inability to send -nicely formatted [[OpenPGP|PGP]] messages was starting to really bug -me. I had been encrypting my logwatch output with gpg and just -emailing the raw gpg out to myself, but it's annoying to have to ESC-P -every time I want to decrypt a log. The tipping point came while I -was writing up a script to automatically email grades out to my -students (not that any of the student's care about PGP, but it's the -principle of the thing ;), since there's no way I'm going to send them -raw gpg output (they would die) and there's also no way I'm going to -hold Mutt's hand while it signs the emails. I dunno why Mutt doesn't -have some `--batch` mode options to support PGP, but there it is. - -So I [wrote my own][send_pgp_mime.py]. Not very complicated really, -just implementing the [RFC 3156][] specs. There's obviously room for -improvement, but it works well enough to make me happy at the momemt. -[[Email me|contact]] with (encrypted!) feedback. - - echo 'use_agent' >> ~/.gnupg/gpg.conf - export GPG_TTY=$(tty) - eval $(gpg-agent --daemon) - FROM="From: me@example.edu" - for student in $(cat big_list); do - HEAD=$(echo -e "$FROM\nTo: $STUDENT@example.edu\nSubject: Grades") - BODY=$(echo -e "$STUDENT,\n\nGood job!") - send_pgp_mime -H <(echo "$HEAD") -B <(echo "$BODY") --mode sign - done - -Note that I'm brushing some [[gpg-agent]] details under the rug. `man -gpg-agent` does a reasonable job of clarifying. - -[send_pgp_mime.py]: http://git.tremily.us/?p=be.git;a=blob;f=interfaces/email/interactive/send_pgp_mime.py;hb=HEAD -[RFC 3156]: http://www.ietf.org/rfc/rfc3156.txt - -[[!tag tags/linux]] -[[!tag tags/programming]] -[[!tag tags/python]] -- 2.26.2