no need to modify reply-to. Remove this header if present.

This commit is contained in:
Son NK 2019-11-19 00:19:19 +01:00
parent a70928d166
commit 0ae7f2d68a
1 changed files with 12 additions and 5 deletions

View File

@ -121,11 +121,18 @@ class MailHandler:
if gen_email.enabled:
# add custom header
msg.add_header("X-SimpleLogin-Type", "Forward")
try:
msg.add_header("Reply-To", forward_email.reply_email)
except ValueError:
# the header exists already
msg.replace_header("Reply-To", forward_email.reply_email)
# no need to modify reply-to as it is used in From: header directly
# try:
# msg.add_header("Reply-To", forward_email.reply_email)
# except ValueError:
# # the header exists already
# msg.replace_header("Reply-To", forward_email.reply_email)
# remove reply-to header if present
if msg["Reply-To"]:
LOG.d("Delete reply-to header %s", msg["Reply-To"])
del msg["Reply-To"]
# change the from header so the sender comes from @simplelogin
# so it can pass DMARC check