From: Oleg Broytman Date: Sun, 23 Feb 2014 19:50:42 +0000 (+0400) Subject: Remove headers and parameters before decoding X-Git-Tag: v2.3.8~4 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=4d0a37a9b6f605d5ae9c8713359480e9eebc0c29;p=mimedecode.git Remove headers and parameters before decoding --- diff --git a/mimedecode.py b/mimedecode.py index 1edd170..882034b 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -97,18 +97,18 @@ def decode_header_param(msg, header, param): def decode_headers(msg): "Decode message headers according to global options" - for header in gopts.decode_headers: - decode_header(msg, header) - - for header, param in gopts.decode_header_params: - decode_header_param(msg, header, param) - for header in gopts.remove_headers: del msg[header] for header, param in gopts.remove_header_params: msg.del_param(param, header) + for header in gopts.decode_headers: + decode_header(msg, header) + + for header, param in gopts.decode_header_params: + decode_header_param(msg, header, param) + def set_header(msg, header, value): "Replace header"