From 85af7d6f04f8bbf82e9899e530707b43e5dfa560 Mon Sep 17 00:00:00 2001 From: Leonidas Spyropoulos Date: Sun, 9 Jun 2024 23:08:35 +0100 Subject: [PATCH] fix: revert Set reply-to header for notifications to ML The change broke the initial emails to the ML. Not sure why but reverting this now and might look at later This reverts commit 783422369e60628d08a141cd274e2d0a17f7220f. fixes: #502 --- aurweb/scripts/notify.py | 13 +------------ test/test_notify.py | 7 ------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py index 5bb81e20..0e548be4 100755 --- a/aurweb/scripts/notify.py +++ b/aurweb/scripts/notify.py @@ -59,13 +59,10 @@ class Notification: body += "\n" + "[%d] %s" % (i + 1, ref) return body.rstrip() - def get_reply_to(self): - return aurweb.config.get("notifications", "reply-to") - def _send(self) -> None: sendmail = aurweb.config.get("notifications", "sendmail") sender = aurweb.config.get("notifications", "sender") - reply_to = self.get_reply_to() + reply_to = aurweb.config.get("notifications", "reply-to") reason = self.__class__.__name__ if reason.endswith("Notification"): reason = reason[: -len("Notification")] @@ -566,7 +563,6 @@ class RequestOpenNotification(Notification): ) self._to = aurweb.config.get("options", "aur_request_ml") - self._reply_to = self._to query = ( db.query(PackageRequest) @@ -603,9 +599,6 @@ class RequestOpenNotification(Notification): def get_recipients(self): return [(self._to, "en")] - def get_reply_to(self): - return self._reply_to - def get_cc(self): return self._cc @@ -661,7 +654,6 @@ class RequestCloseNotification(Notification): self._user = user.Username if user else None self._to = aurweb.config.get("options", "aur_request_ml") - self._reply_to = self._to query = ( db.query(PackageRequest) @@ -708,9 +700,6 @@ class RequestCloseNotification(Notification): def get_recipients(self): return [(self._to, "en")] - def get_reply_to(self): - return self._reply_to - def get_cc(self): return self._cc diff --git a/test/test_notify.py b/test/test_notify.py index bc6d878f..3d773bc2 100644 --- a/test/test_notify.py +++ b/test/test_notify.py @@ -13,7 +13,6 @@ from aurweb.testing.smtp import FakeSMTP, FakeSMTP_SSL aur_location = config.get("options", "aur_location") aur_request_ml = config.get("options", "aur_request_ml") -aur_reply_to = config.get("notifications", "reply-to") @pytest.fixture(autouse=True) @@ -412,7 +411,6 @@ def test_open_close_request( email = Email(1).parse() assert email.headers.get("To") == aur_request_ml - assert email.headers.get("Reply-to") == aur_request_ml assert email.headers.get("Cc") == ", ".join([user.Email, user2.Email]) expected = f"[PRQ#{pkgreq.ID}] Orphan Request for {pkgbase.Name}" assert email.headers.get("Subject") == expected @@ -434,7 +432,6 @@ This is a request test comment. email = Email(2).parse() assert email.headers.get("To") == aur_request_ml - assert email.headers.get("Reply-to") == aur_request_ml assert email.headers.get("Cc") == ", ".join([user.Email, user2.Email]) expected = f"[PRQ#{pkgreq.ID}] Orphan Request for {pkgbase.Name} Rejected" assert email.headers.get("Subject") == expected @@ -453,7 +450,6 @@ Request #{pkgreq.ID} has been rejected by {user2.Username} [1]. email = Email(3).parse() assert email.headers.get("To") == aur_request_ml - assert email.headers.get("Reply-to") == aur_request_ml assert email.headers.get("Cc") == ", ".join([user.Email, user2.Email]) expected = f"[PRQ#{pkgreq.ID}] Orphan Request for " f"{pkgbase.Name} Accepted" assert email.headers.get("Subject") == expected @@ -480,7 +476,6 @@ def test_close_request_comaintainer_cc( email = Email(1).parse() assert email.headers.get("To") == aur_request_ml - assert email.headers.get("Reply-to") == aur_request_ml assert email.headers.get("Cc") == ", ".join([user.Email, user2.Email]) @@ -535,7 +530,6 @@ def test_close_request_closure_comment( email = Email(1).parse() assert email.headers.get("To") == aur_request_ml - assert email.headers.get("Reply-to") == aur_request_ml assert email.headers.get("Cc") == ", ".join([user.Email, user2.Email]) expected = f"[PRQ#{pkgreq.ID}] Orphan Request for {pkgbase.Name} Accepted" assert email.headers.get("Subject") == expected @@ -727,7 +721,6 @@ def test_notification_defaults(): assert notif.get_refs() == tuple() assert notif.get_headers() == dict() assert notif.get_cc() == list() - assert notif.get_reply_to() == aur_reply_to def test_notification_oserror(user: User, caplog: pytest.LogCaptureFixture):