From: Oleg Broytman Date: Sun, 8 Jun 2014 13:30:01 +0000 (+0400) Subject: Make option -e to work with multipart messages X-Git-Tag: v2.6.0~3 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=f0f753ad009f6bd7089e0d6d3fce3ffd111734f5;p=mimedecode.git Make option -e to work with multipart messages --- 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)