From f0f753ad009f6bd7089e0d6d3fce3ffd111734f5 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 8 Jun 2014 17:30:01 +0400 Subject: [PATCH] Make option -e to work with multipart messages --- ChangeLog | 2 +- mimedecode.docbook | 6 +++--- mimedecode.py | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b51d69..36012e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ Version 2.5.1 (2014-04-??) - Make option -i to work with multipart messages. + Make options -e/-i to work with multipart messages. Open all files in binary mode. Output os.linesep instead of '\n'. diff --git a/mimedecode.docbook b/mimedecode.docbook index 7ca12cd..d01f492 100644 --- a/mimedecode.docbook +++ b/mimedecode.docbook @@ -521,9 +521,9 @@ cat input_file | mimedecode.py -o output_file - Option -i can also ignore a multipart subpart of a MIME message. In that case - the entire subtree of that multipart is removed and replaced with ignore - warning. + Options -e/-i can also work with multipart subparts of a MIME message. In + case of -i the entire subtree of that multipart is removed and replaced with + ignore warning. diff --git a/mimedecode.py b/mimedecode.py index 7d96a3d..d239a1f 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -394,6 +394,8 @@ def decode_multipart(msg): if boundary: output("%s--%s--%s" % (os.linesep, boundary, os.linesep)) return + elif content_type in g.error_mask: + raise ValueError, "content type %s prohibited" % ctype output_headers(msg) -- 2.39.2