From 32360061b47bbf0097d5840a1d19f57b16277ab7 Mon Sep 17 00:00:00 2001 From: missytake Date: Fri, 8 Dec 2023 08:16:36 +0100 Subject: [PATCH] filtermail: address hpk's comments --- chatmaild/src/chatmaild/filtermail.py | 6 +++--- tests/chatmaild/test_filtermail.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chatmaild/src/chatmaild/filtermail.py b/chatmaild/src/chatmaild/filtermail.py index bd5984cd..1bc23a52 100644 --- a/chatmaild/src/chatmaild/filtermail.py +++ b/chatmaild/src/chatmaild/filtermail.py @@ -34,7 +34,7 @@ def check_encrypted(message): return True -def check_passthrough(recipient): +def is_passthrough_recipient(recipient): """Check whether a recipient is configured as passthrough.""" passthroughlist = ["privacy@testrun.org"] if recipient in passthroughlist: @@ -126,8 +126,8 @@ def check_DATA(envelope): if envelope.mail_from == recipient: # Always allow sending emails to self. continue - if check_passthrough(recipient): - # Always allow recipients marked as passthrough in chatmail.ini + if is_passthrough_recipient(recipient): + # Always allow recipients marked as passthrough continue res = recipient.split("@") if len(res) != 2: diff --git a/tests/chatmaild/test_filtermail.py b/tests/chatmaild/test_filtermail.py index 1ffbc965..fba7a9f9 100644 --- a/tests/chatmaild/test_filtermail.py +++ b/tests/chatmaild/test_filtermail.py @@ -1,4 +1,4 @@ -from chatmaild.filtermail import check_encrypted, check_DATA, SendRateLimiter, check_mdn, check_passthrough +from chatmaild.filtermail import check_encrypted, check_DATA, SendRateLimiter, check_mdn, is_passthrough_recipient import pytest @@ -87,7 +87,7 @@ def test_excempt_privacy(maildata, gencreds): to_addr = "privacy@testrun.org" false_to = "privacy@tstrn.org" false_to2 = "prvcy@testrun.org" - assert check_passthrough(to_addr) + assert is_passthrough_recipient(to_addr) msg = maildata("plain.eml", from_addr, to_addr)