| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
This is modeled after the use of argcomplete in diffoscope, and it
should be possible to use it for any other pythonic mailscript that
uses argparse.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases, the user may want to try to use their own GnuPG secret
keys to decrypt encrypted parts of the message.
By default it is disabled so that we aren't accidentally triggering
the use of user secret key material.
Note that gpg(1) says:
It is highly recommended to use [--batch] along with the options
--status-fd and --with-colons for any unattended use of gpg.
I am deliberately choosing to not use either --status-fd or
--with-colons for email-print-mime-structure.
I'm not using --with-colons because there is no output from GnuPG that
we expect to be machine-readable -- we're just looking for the cleartext
of whatever ciphertext is in the message part.
I'm not using --status-fd because there is nothing actionable we can do
with GnuPG status messages, and asking for them would require switching
from subprocess.run to subprocess.Popen to take advantage of the
pass_fds argument, which in turn would make the script only work in a
POSIX environment (I believe, but have not tested, that the script can
currently be used on Windows).
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
|
|
| |
No functional change here: this just prepares for adding other
decryption capabilities.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Acked-by: Sean Whitton <spwhitton@spwhitton.name>
|
|
|
|
|
|
|
|
| |
This has no functional changes, it's just a reorganization for easier
readability. Thanks to Sean Whitton for the suggestion.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Acked-by: Sean Whitton <spwhitton@spwhitton.name>
|
|
|
|
|
|
|
|
| |
We want to make sure we're decrypting the thing that we expect. This
typecheck should keep us honest.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Acked-by: Sean Whitton <spwhitton@spwhitton.name>
|
|
|
|
|
|
| |
For consistency with the manpage.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add simple decryption capability for email-print-mime-structure, so
that it can do stuff like this:
$ email-print-mime-structure --pgpkey alice@openpgp.example.sec.asc < msg.eml
└┬╴multipart/encrypted 2190 bytes
├─╴application/pgp-encrypted 11 bytes
└─╴application/octet-stream 1613 bytes
↧ (decrypts to)
└─╴text/plain 425 bytes
$
At the moment, it only works with keys that can be found in the
filesystem, and when the pgpy module is installed.
Possible future work:
- try using gpg to do the decryption from whatever gpg's system
capabilities are
I've added python3-pgpy to the list of Recommends, since it is not a
hard dependency.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
| |
No functional changes. This is just a more readable function name.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
| |
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
|
|
|
| |
No functional change.
This is preparatory work to be able to consider the structure of each
part and determine whether we should consider trying to decrypt it.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
| |
No functional changes.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
|
|
| |
This adds a -h and --help option, which is currently pretty useless.
But the argparse will become useful shortly.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
|
| |
No functional changes. This is a refactoring commit to provide some
non-global scoping and easier readability.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
|
|
|
|
|
| |
We will need to send arguments to the printer, so it's handy to wrap
the functionality in a class.
No functional changes.
This diff is probably best reviewed with whitespace changes ignored.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
|
|
|
|
| |
This adds enough typechecking that the following check passes:
mypy --strict email-print-mimestructure
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
|
|
| |
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|