Просмотр исходного кода

make sure to replace Reply-To header in reply phase

Son NK 5 лет назад
Родитель
Сommit
072e73187b
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      email_handler.py

+ 6 - 1
email_handler.py

@@ -251,8 +251,13 @@ class MailHandler:
             LOG.d("Remove DKIM-Signature %s", msg["DKIM-Signature"])
             del msg["DKIM-Signature"]
 
-        # email seems to come from alias
+        # the email comes from alias
         msg.replace_header("From", alias)
+
+        # some email providers like ProtonMail adds automatically the Reply-To field
+        # make sure to replace it too
+        add_or_replace_header(msg, "Reply-To", alias)
+
         msg.replace_header("To", forward_email.website_email)
 
         # add List-Unsubscribe header