From cf42e6b5656a70a20a4c5c94f79887561b0d0a9b Mon Sep 17 00:00:00 2001 From: Lukas Juhrich Date: Tue, 19 Feb 2019 19:27:41 +0100 Subject: [PATCH] Use author in From header Refs #357 --- sipa/mail.py | 2 +- tests/test_mail.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sipa/mail.py b/sipa/mail.py index 148f5f1f..51891e6c 100644 --- a/sipa/mail.py +++ b/sipa/mail.py @@ -70,7 +70,7 @@ def send_mail(author: str, recipient: str, subject: str, message: str) -> bool: mail = MIMEText(message, _charset='utf-8') mail['Message-Id'] = make_msgid() - mail['From'] = sender + mail['From'] = author mail['Reply-To'] = author mail['X-OTRS-CustomerId'] = author mail['To'] = recipient diff --git a/tests/test_mail.py b/tests/test_mail.py index dd20e1db..91a99ef9 100644 --- a/tests/test_mail.py +++ b/tests/test_mail.py @@ -150,7 +150,7 @@ def test_sendmail_envelope_sender(self): "Wrong envelope sender set!") def test_sendmail_from_header(self): - self.assertIn(f"From: {self.app_mock.config['CONTACT_SENDER_MAIL']}\n", + self.assertIn(f"From: {self.args['author']}\n", self.observed_call_args.msg, "Wrong From: header!")