浏览代码

Change subject to let user know the email is forwarded from SL

Son NK 5 年之前
父节点
当前提交
a28c90f110
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      email_handler.py

+ 6 - 0
email_handler.py

@@ -126,6 +126,12 @@ class MailHandler:
                     except ValueError:
                     except ValueError:
                         # the header exists already
                         # the header exists already
                         msg.replace_header("Reply-To", forward_email.reply_email)
                         msg.replace_header("Reply-To", forward_email.reply_email)
+                    # modify subject to let user know the email is forwarded from SL
+                    original_subject = msg["Subject"]
+                    msg.replace_header(
+                        "Subject",
+                        f"Forwarded by SimpleLogin. Subject: {original_subject}. From: {website_email}",
+                    )
 
 
                     LOG.d(
                     LOG.d(
                         "Send mail from %s to %s, mail_options %s, rcpt_options %s ",
                         "Send mail from %s to %s, mail_options %s, rcpt_options %s ",