filtermail: always allow privacy@testrun.org

This commit is contained in:
missytake
2023-12-07 15:16:40 +01:00
committed by holger krekel
parent 8cb77d3b98
commit 2055e9f5b8
2 changed files with 37 additions and 1 deletions

View File

@@ -34,6 +34,14 @@ def check_encrypted(message):
return True
def check_passthrough(recipient):
"""Check whether a recipient is configured as passthrough."""
passthroughlist = ["privacy@testrun.org"]
if recipient in passthroughlist:
return True
return False
def check_mdn(message, envelope):
if len(envelope.rcpt_tos) != 1:
return False
@@ -118,6 +126,9 @@ 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
continue
res = recipient.split("@")
if len(res) != 2:
return f"500 Invalid address <{recipient}>"