fix handling of illegal characters in header values

This commit is contained in:
2021-03-12 14:47:28 +01:00
parent 7adbd8d76b
commit c05593bfae
2 changed files with 4 additions and 7 deletions

View File

@@ -136,8 +136,5 @@ class MilterMessage(MIMEPart):
def replace_illegal_chars(string):
"""Replace illegal characters in header values."""
return string.replace(
"\x00", "").replace(
"\r", "").replace(
"\n", "")
"""Remove illegal characters from header values."""
return "".join(string.replace("\x00", "").splitlines())