mirror of
https://github.com/chatmail/relay.git
synced 2026-05-18 06:28:57 +00:00
filtermail: always allow privacy@testrun.org
This commit is contained in:
@@ -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}>"
|
||||
|
||||
Reference in New Issue
Block a user