summaryrefslogtreecommitdiff
path: root/email-print-mime-structure
Commit message (Collapse)AuthorAge
* drop space before shell redirection operatorSean Whitton2019-11-02
| | | | | | For consistency with the manpage. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* email-print-mime-structure: add decryption capabilityDaniel Kahn Gillmor2019-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* email-print-mime-structure: renamed MimePrinter.test() to print_tree()Daniel Kahn Gillmor2019-11-02
| | | | | | No functional changes. This is just a more readable function name. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* email-print-mime-structure: add another FIXME about bytecountingDaniel Kahn Gillmor2019-11-02
| | | | Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* email-print-mime-structure: Pass parent and nth child info during walkDaniel Kahn Gillmor2019-11-02
| | | | | | | | | 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>
* email-print-mime-structure: nbytes should show as a decimal integerDaniel Kahn Gillmor2019-11-02
| | | | | | No functional changes. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* email-print-mime-structure: parse argmentsDaniel Kahn Gillmor2019-11-02
| | | | | | | | 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>
* email-print-mime-structure: put main() into its own functionDaniel Kahn Gillmor2019-11-02
| | | | | | | 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>
* email-print-mime-structure: refactor to a classDaniel Kahn Gillmor2019-11-02
| | | | | | | | | | | 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>
* email-print-mime-structure: be typesafeDaniel Kahn Gillmor2019-11-01
| | | | | | | | This adds enough typechecking that the following check passes: mypy --strict email-print-mimestructure Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* update email-print-mime-structure headers to include licensingDaniel Kahn Gillmor2019-09-14
| | | | Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* rename printmimestructure to email-print-mime-structureDaniel Kahn Gillmor2019-09-14
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>