remove \r or \n from headers before processing

This commit is contained in:
Son 2022-01-11 13:11:28 +01:00
parent 5e7ff7a694
commit 42a29eba90
1 changed files with 4 additions and 0 deletions

View File

@ -382,6 +382,10 @@ def replace_header_when_reply(msg: Message, alias: Alias, header: str):
# headers can be an array of Header, convert it to string here
headers = [str(h) for h in headers]
# headers can contain \r or \n
headers = [h.replace("\r", "") for h in headers]
headers = [h.replace("\n", "") for h in headers]
for _, reply_email in getaddresses(headers):
# no transformation when alias is already in the header
# can happen when user clicks "Reply All"