Version 2.5.1 (2014-04-??)
+ Make option -i to work with multipart messages.
+
Open all files in binary mode. Output os.linesep instead of '\n'.
Test --save-headers|body|message masks one after another to allow
no boundary, nothing.
-Extend options -eIi to multipart subparts.
-
-
Never touch multipart/encrypted and multipart/signed (but allow -I).
earlier than -B */*.
</para>
+<para>
+ 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.
+</para>
+
<para>
Initially all 5 lists are empty, so without any additional parameters
the program always uses the default decoding (as -t */*).
"Decode multipart"
decode_headers(msg)
+ boundary = msg.get_boundary()
+
+ masks = []
+ ctype = msg.get_content_type()
+ if ctype:
+ masks.append(ctype)
+ mtype = ctype.split('/')[0]
+ masks.append(mtype + '/*')
+ masks.append('*/*')
+
+ for content_type in masks:
+ if content_type in g.ignore_mask:
+ output_headers(msg)
+ output("%sMessage body of type %s skipped.%s" % (os.linesep, ctype, os.linesep))
+ if boundary:
+ output("%s--%s--%s" % (os.linesep, boundary, os.linesep))
+ return
+
output_headers(msg)
if msg.preamble: # Preserve the first part, it is probably not a RFC822-message
output(os.linesep)
first_subpart = True
- boundary = msg.get_boundary()
-
for subpart in msg.get_payload():
if boundary:
if first_subpart:
--- /dev/null
+From test Sat Feb 1 00:00:00 2014
+Mime-Version: 1.0
+Content-Type: Multipart/Mixed; Boundary="NextPart"
+To: IETF-Announce:;
+From: Internet-Drafts@ietf.org
+Subject: I-D ACTION:draft-ietf-mboned-mix-00.txt
+Date: Tue, 22 Dec 1998 16:55:06 -0500
+
+--NextPart
+
+Blah blah blah
+
+--NextPart
+Content-Type: Multipart/Alternative; Boundary="OtherAccess"
+
+
+Message body of type multipart/alternative skipped.
+
+--OtherAccess--
+
+--NextPart--
+
test_file msg_02.txt msg_02-1.txt --set-param=X-Mailer:test:set
test_file msg_13.txt msg_13-1.txt -B '*/*'
test_file msg_13.txt msg_13.txt -t 'text/*' -b 'image/*' -B '*/*'
+test_file msg_36.txt msg_36-1.txt -i multipart/alternative
# Test --save-*
test2() {