fix header handling (again)

This commit is contained in:
2022-02-23 18:37:21 +01:00
parent 4653320a22
commit fc14f281c7

View File

@@ -37,7 +37,10 @@ def decode_header(header):
encoding = "ascii"
result = dheader[0].decode(encoding, errors="replace") if isinstance(dheader[0], bytes) else dheader[0]
header_strs.append(result)
return "".join(header_strs)
header_text = "".join(header_strs)
header_text = re.sub(r"\n(\s)", r" ", header_text)
#header_text = re.sub(r"\n(\s)", r"", header_text)
return header_text
def get_body_text(msg):
# from https://stackoverflow.com/a/1463144