feat: add pneumatube gateway bridging smolmail and SMTP via LMTP

This commit is contained in:
randogoth 2026-10-03 16:50:08 +03:00
commit 722394a7bf
16 changed files with 954 additions and 0 deletions

18
tests/test_smtp_client.py Normal file
View 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)