From: Oleg Broytman Date: Wed, 12 Mar 2014 23:00:26 +0000 (+0400) Subject: Allow -t 'text/*' -b 'image/*' -B '*/*' X-Git-Tag: v2.5.0~18 X-Git-Url: https://git.phdru.name/?p=mimedecode.git;a=commitdiff_plain;h=63f035c2a1e63b84155a41adbaadfc842615a1d6 Allow -t 'text/*' -b 'image/*' -B '*/*' --- 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!"