{ "info": { "author": "W. Trevor King", "author_email": "wking@tremily.us", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Communications :: Email", "Topic :: Security :: Cryptography", "Topic :: Software Development" ], "description": "Python module and tools for constructing and sending PGP/MIME email.\n\nThe ``pgp_mime`` module makes it easy to construct and dispatch signed\nand/or encrypted email using PGP_ and :RFC:`3156`. It uses GnuPG_\n(via `gpgme-tool`_) to perform the cryptography.\n\nInstallation\n============\n\nPackages\n--------\n\nGentoo\n~~~~~~\n\nI've packaged ``pgp-mime`` for Gentoo_. You need layman_ and\nmy `wtk overlay`_. Install with::\n\n # emerge -av app-portage/layman\n # layman --add wtk\n # emerge -av dev-python/pgp-mime\n\nDependencies\n------------\n\n``pgp-mime`` is a simple package with no external dependencies outside\nthe Python 3 standard library. There are a number of GnuPG_ wrappers\nfor python `out there`__, but none of them seem mature/stable enough\nto be worth installing. Instead, we use the `pyassuan`_ module to\ntalk to `gpgme-tool`_ over pipes or sockets. If this isn't working\nfor you, you need only replace the ``pgp_mime.crypt`` module to handle\nthe cryptography.\n\n__ wrappers_\n\nInstalling by hand\n------------------\n\n``pgp-mime`` is available as a Git_ repository::\n\n $ git clone git://tremily.us/pgp-mime.git\n\nSee the homepage_ for details. To install the checkout, run the\nstandard::\n\n $ python setup.py install\n\nUsage\n=====\n\nPgp-mime has grown up as I've become more experienced with Python.\nThe current interface is much simpler, and there are lots of\ndocstrings showing you how to use each function.\n\nIf you're looking for a higher level example, pgp-mime includes a\ncommand line script ``send-pgp-mime.py`` that allows you to send\nsigned and/or encrypted email from the command line. I recommend you\nuse ``gpg2`` with my `wrappers and pinentry program`_ to allow easy\npinentry from the command line. Here's how you could mail signed\ngrades to your class::\n\n $ FROM=\"From: Rincewind \"\n $ head -n2 grades\n Twoflower |9\n Eric Thursley |10\n $ while read LINE; do\n STUDENT=$(echo \"$LINE\" | cut -d '|' -f 1)\n GRADE=$(echo \"$LINE\" | cut -d '|' -f 2)\n HEAD=$(echo -e \"$FROM\\nTo: $STUDENT\\nSubject: Grades\")\n BODY=$(echo -e \"$STUDENT,\\n\\nYou got a $GRADE.\\n\\nGood job.\")\n send-pgp-mime.py -H <(echo \"$HEAD\") -B <(echo \"$BODY\") --mode sign\n done < grades\n\nIf you can convince your students to get PGP keys, you could also\nencrypt their grades by changing ``--mode sign`` to ``--mode\nsign-encrypt``.\n\nOf course, if you're interested in working with students and grades,\nyou might also be interested in my `pygrader`_ package, which uses\npgp-mime under the hood.\n\nConfiguring the SMTP connection\n-------------------------------\n\nPgp-mime supports two methods for sending messages (via\n``pgp_mime.mail``). It can either call your system's ``sendmail``\nequivalent, or connect directly to an SMTP_ server using ``smtplib``.\nSince I imagine SMTP will be more common, you can easily configure\nyour SMTP connection via ``~/.config/smtplib.conf``::\n\n [smtp]\n host: smtp.mail.uu.edu\n port: 587\n starttls: yes\n username: rincewind\n password: 7ugg@g3\n\nAll of these fields are optional. ``host`` defaults to ``localhost``\nand ``port`` defaults to 25. If ``username`` is not given, we do not\nattempt to login to the SMTP server after connecting.\n\nIf ``starttls`` is ``no`` or not given, the SMTP transaction occurs in\nplain text (although the underlying emails will still be encrypted).\nHowever, if you set a ``username`` (to login), pgp-mime will require a\nSTARTTLS_ to protect your password from sniffing.\n\nTesting\n=======\n\nRun the internal unit tests using nose_::\n\n $ nosetests --with-doctest --doctest-tests pgp_mime\n\nIf a Python-3-version of ``nosetests`` is not the default on your\nsystem, you may need to try something like::\n\n $ nosetests-3.2 --with-doctest --doctest-tests pgp_mime\n\nLicence\n=======\n\nThis project is distributed under the `GNU General Public License\nVersion 3`_ or greater.\n\nAuthor\n======\n\nW. Trevor King\nwking@tremily.us\n\n.. _PGP: http://en.wikipedia.org/wiki/Pretty_Good_Privacy\n.. _Gentoo: http://www.gentoo.org/\n.. _layman: http://layman.sourceforge.net/\n.. _wtk overlay: http://blog.tremily.us/posts/Gentoo_overlay/\n.. _wrappers: http://wiki.python.org/moin/GnuPrivacyGuard\n.. _pyassuan: http://blog.tremily.us/posts/pyassuan/\n.. _gpgme-tool:\n http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=blob;f=src/gpgme-tool.c;hb=HEAD\n.. _Git: http://git-scm.com/\n.. _homepage: http://blog.tremily.us/posts/pgp-mime/\n.. _wrappers and pinentry program: http://blog.tremily.us/posts/gpg-agent/\n.. _pygrader: http://blog.tremily.us/posts/pygrader/\n.. _SMTP: http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol\n.. _STARTTLS: http://en.wikipedia.org/wiki/STARTTLS\n.. _GnuPG: http://www.gnupg.org/\n.. _nose: http://readthedocs.org/docs/nose/en/latest/\n.. _GNU General Public License Version 3: http://www.gnu.org/licenses/gpl.html", "description_content_type": null, "docs_url": null, "download_url": "http://git.tremily.us/?p=pgp-mime.git;a=snapshot;h=v0.3;sf=tgz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://blog.tremily.us/posts/pgp-mime/", "keywords": null, "license": "GNU General Public License (GPL)", "maintainer": null, "maintainer_email": null, "name": "pgp-mime", "package_url": "https://pypi.org/project/pgp-mime/", "platform": "all", "project_url": "https://pypi.org/project/pgp-mime/", "project_urls": { "Download": "http://git.tremily.us/?p=pgp-mime.git;a=snapshot;h=v0.3;sf=tgz", "Homepage": "http://blog.tremily.us/posts/pgp-mime/" }, "release_url": "https://pypi.org/project/pgp-mime/0.3/", "requires_dist": null, "requires_python": null, "summary": "Tools for dealing with Pretty Good Privacy (PGP) and email.", "version": "0.3" }, "last_serial": 408546, "releases": { "0.2": [], "0.3": [] }, "urls": [] }