On Thu, Apr 30, 2020 at 10:53:32AM -0400, Mark H. Wood wrote:
> 
> A couple more ideas:
> 
> 'maildrop' comes with some nice tools for working with mail in
> scripts.  (It's also a rather good filtering / routing / piping /
> you-name-it MDA.)

Maildrop is awesome and so much better than procmail.

> Python has some nice standard library classes that are really good
> at working with mailboxes (all kinds) and individual messages.

Yes, it does.

It can also be used very well with the Python bindings for the GnuPG
Project's GPGME API.  For example, here's a key import practiced on
Kevin's key (just because, since you can see that result.unchanged is
true and thus already had it).

    Python 3.8.2 (default, Apr 10 2020, 16:52:52)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.

    In [1]: import requests
    In [2]: import gpg
    In [3]: url = 
"https://u15940057.ct.sendgrid.net/ls/click?upn=TfVBFLs581SSFDYC71Gnki6ytoyFTNVdUM4dqUBeCPia35bNXiwzFmYClpz3QP21G39Y0NzH9gkmXiwhrGiBpg-3D-3DvPzl_3cJdHWS4A4qHYuI0cbfv110yZgaEGqoy3qsIRLwUxNzRrGopS9bx7-2Bfg7illxJcEW23Jj94-2FxX9QbXBps6sq9ps60TwKp-2BLbC0uPpPIFVdLsL2cY91jwsNnZh-2BTF6GnxtR8PfINUamDg02yqfOsAnA1Tp5UIHFwDtL6Kd5gx1LIigAcwJIMJ3Z-2BO3t4Ixr5-2FTeSHMvBdhGCPK0JJ0KnIsUHfmM9VirJ54dvtwlJuBrQ-3D
    In [4]: r = requests.get(url)
    In [5]: result = gpg.Context().key_import(r.content)
    In [6]: len(result.imports)
    Out[6]: 1
    In [7]: print(result)
    ImportResult(considered=1, imported=0, imported_rsa=0, 
imports=[ImportStatus(fpr='8975A9B33AA37910385C5308ADEF768480316BDA', result=0, 
status=0)], new_revocations=0, new_signatures=0, new_sub_keys=0, 
new_user_ids=0, no_user_id=0, not_imported=0, secret_imported=0, secret_read=0, 
secret_unchanged=0, skipped_new_keys=0, skipped_v3_keys=0, unchanged=1)
    In [8]:

It's also documented well enough that getting it to behave with with
all sorts of obscure custom stuff should be fairly straight forward.

    
https://u15940057.ct.sendgrid.net/ls/click?upn=TfVBFLs581SSFDYC71Gnkki6qSNYtAoDX72HhaQ1QGBpddfa6Vm1iYIIBKo-2Fou413nRux54jyBPutHuXImlrUCE7OuLoVf4j9OIDFXUgRqo-3DBOt8_3cJdHWS4A4qHYuI0cbfv110yZgaEGqoy3qsIRLwUxNzRrGopS9bx7-2Bfg7illxJcEZKVverhnQMd44ujj7uP5upQKh04GQiU8GohDJPSiZcVvo3nD4iDdOeqp4ZZeu3jR3-2Fn6UR3gxY2ilzxW6kG8800Ru-2BklYNaqx4gcU09POClr7bkB3bLyqeFn5pTkKfyCLSZwBV4IhLweWNSH0b-2Fh6iKVI7rMzSBD7LQ3IQu7wXg-3D

Obligatory disclaimer: I wrote the HOWTO and worked on the bindings
extensively.


Regards,
Ben

P.S.  The HOWTO is hosted on AWS S3, so you can make it HTTPS if you
      want to trigger and then bypass the SSL wildcard certificate
      mismatch error message.

Attachment: signature.asc
Description: PGP signature

Reply via email to