From 63f035c2a1e63b84155a41adbaadfc842615a1d6 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 13 Mar 2014 03:00:26 +0400 Subject: [PATCH] Allow -t 'text/*' -b 'image/*' -B '*/*' --- mimedecode.py | 5 ++++- test/test_all | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mimedecode.py b/mimedecode.py index 9af561e..1e3bf74 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -312,7 +312,10 @@ def decode_part(msg): left_binary = False for content_type in masks: - if content_type in g.binary_mask: + if content_type in g.totext_mask or \ + content_type in g.decoded_binary_mask: + break + elif content_type in g.binary_mask: left_binary = True break diff --git a/test/test_all b/test/test_all index 52b0313..c7bdb28 100755 --- a/test/test_all +++ b/test/test_all @@ -59,6 +59,7 @@ test_file msg_02.txt msg_02.txt --set-param=X-Test:test:set test_file msg_02.txt msg_02-1.txt --set-param=X-Mailer:test=set 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 '*/*' if [ "$RC" -eq 0 ]; then echo "All tests passed!" -- 2.39.5