gpgmymail/README.md

45 lines
1.4 KiB
Markdown
Raw Normal View History

2024-11-04 16:24:24 +00:00
# gpgmymail
2024-11-15 17:55:22 +00:00
Takes an email from stdin and encrypts it to stdout using the recipient's PGP
key, provided as an argument when calling the script.
Leaves a `X-gpgmymail-Status` header on the email, which has the following
statuses:
* `entered` - the email has entered the encryption function, but not been
encrypted
* `encrypted` - the encryption function has encrypted the email
2024-11-04 16:24:24 +00:00
Written to be a Sieve filter to be used with `sieve_extprograms`. Can be used
in a Sieve filter e.g.:
```sieve
require ["vnd.dovecot.filter"];
filter "gpgmymail" "pid1@revsuine.xyz";
```
Will encrypt all incoming mail with the `pid1@revsuine.xyz` PGP key.
TODO link my blog post when I make it fully explaining how to use as Sieve
filter.
2024-11-04 16:31:40 +00:00
I use this script on my own mail server so this should be maintained to work
with the up-to-date versions of Python and python-gnupg
# Requirements
* Python 3
* [python-gnupg](https://gnupg.readthedocs.io/en/latest/)
2024-11-12 14:06:19 +00:00
# Notes on Scope
Since this script is written to be used as a Sieve filter, no exclusion
behaviour which is much better achieved with Sieve will be implemented, e.g.
"do not encrypt emails from kate@gmail.com".
2024-11-04 16:24:24 +00:00
# Credits
* Julian Klode for the [original code](https://github.com/julian-klode/ansible.jak-linux.org/blob/dovecot/roles/mailserver/files/usr/local/lib/dovecot-sieve-filters/gpgmymail)
2024-11-12 14:06:19 +00:00
* revsuine for modifications to gpgmymail