mirror of
https://github.com/chatmail/relay.git
synced 2026-05-18 20:08:21 +00:00
filtermail: always allow privacy@testrun.org
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from chatmaild.filtermail import check_encrypted, check_DATA, SendRateLimiter, check_mdn
|
||||
from chatmaild.filtermail import check_encrypted, check_DATA, SendRateLimiter, check_mdn, check_passthrough
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -80,3 +80,28 @@ def test_send_rate_limiter():
|
||||
else:
|
||||
assert i == SendRateLimiter.MAX_USER_SEND_PER_MINUTE + 1
|
||||
break
|
||||
|
||||
|
||||
def test_excempt_privacy(maildata, gencreds):
|
||||
from_addr = gencreds()[0]
|
||||
to_addr = "privacy@testrun.org"
|
||||
false_to = "privacy@tstrn.org"
|
||||
false_to2 = "prvcy@testrun.org"
|
||||
assert check_passthrough(to_addr)
|
||||
|
||||
msg = maildata("plain.eml", from_addr, to_addr)
|
||||
|
||||
class env:
|
||||
mail_from = from_addr
|
||||
rcpt_tos = [to_addr]
|
||||
content = msg.as_bytes()
|
||||
|
||||
# assert that None/no error is returned
|
||||
assert not check_DATA(envelope=env)
|
||||
|
||||
class env2:
|
||||
mail_from = from_addr
|
||||
rcpt_tos = [to_addr, false_to, false_to2]
|
||||
content = msg.as_bytes()
|
||||
|
||||
assert "500" in check_DATA(envelope=env2)
|
||||
|
||||
Reference in New Issue
Block a user