feat: add pneumatube gateway bridging smolmail and SMTP via LMTP
This commit is contained in:
commit
722394a7bf
16 changed files with 954 additions and 0 deletions
18
tests/test_smtp_client.py
Normal file
18
tests/test_smtp_client.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import pytest
|
||||
|
||||
from pneumatube.smtp_client import InvalidAddress, validate
|
||||
|
||||
|
||||
def test_validate_accepts_plain_address():
|
||||
assert validate(" bob@example.org ") == "bob@example.org"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("address", [
|
||||
"not-an-email",
|
||||
"bob@localhost",
|
||||
"bob@example.org\r\nBcc: evil@example.org",
|
||||
"bob@example.org\nX-Injected: 1",
|
||||
])
|
||||
def test_validate_rejects_bad_addresses(address):
|
||||
with pytest.raises(InvalidAddress):
|
||||
validate(address)
|
||||
Loading…
Add table
Add a link
Reference in a new issue