> It seems like the core of the problem is that parts of the header -- i.e.: > > Content-Type: text/plain; charset="UTF-8" > > Content-Transfer-Encoding: base64 > > are assigned as part of the email body instead of the -header.
The message is a multipart message, where Content-Type and Content-Transfer-Encoding are given separately for each part, so they must be part of the email body. Each body part then has own header lines like this. For most bug log messages, one can read the body text like this: > import debianbts as bts > print(bts.get_bug_log(532150)[0]['body'] But sometimes something like this is needed: > print(bts.get_bug_log(853037)[0]['message'].get_payload()[0].get_payload(decode=True).decode())