]> git.phdru.name Git - mimedecode.git/commitdiff
Remove headers and parameters before decoding
authorOleg Broytman <phd@phdru.name>
Sun, 23 Feb 2014 19:50:42 +0000 (23:50 +0400)
committerOleg Broytman <phd@phdru.name>
Sun, 23 Feb 2014 19:50:42 +0000 (23:50 +0400)
mimedecode.py

index 1edd170f606b94872b8f5e15f1f449126898e070..882034b0f4f021d91277dd9e21676114caf144aa 100755 (executable)
@@ -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"