summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-10-21 15:12:37 +0200
committerAnton Khirnov <anton@khirnov.net>2020-10-21 15:12:37 +0200
commit6de0adba527a9d232068c209c152b12250b6d173 (patch)
tree40cac94380f65c321cf6707eff96f3f1c7c3006b
parent2507677179b8d4afef563422e5d7e05ffb86859b (diff)
commands/thread: filter out content-transfer-encoding when piping decoded
This is a temporary hack, it should properly be handled consistently in future Message serializing API.
-rw-r--r--alot/commands/thread.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index 1e1e3e6d..bc1cc1a4 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -711,7 +711,11 @@ class PipeCommand(Command):
if self.output_format == 'raw':
msg_data = msg.as_bytes()
elif self.output_format == 'decoded':
- headertext = '\n'.join([key + ': ' + val for key, val in msg.headers.items()])
+ # XXX HACK: filter out content-transfer-encoding, since we are writing out
+ # the decoder version
+ # should be properly handled elsewhere (where? how?)
+ headers = filter(lambda i: i[0].lower() != 'content-transfer-encoding', msg.headers.items())
+ headertext = '\n'.join([key + ': ' + val for key, val in headers])
bodytext = msg.get_body_text()
msgtext = '%s\n\n%s' % (headertext, bodytext)