python
from lamson import MailRequest
from lamson.routing import route, route_like
@route("(address)@(host)")
def handle_message(message, address=None, host=None):
pass
@route_like(handle_message)
def handle_error(message, address=None, host=None):
pass
def start_server():
MailRequest(starttls=False).run()
python
from lamson import MailRequest
from lamson.routing import route, route_like
@route("(address)@(host)")
def handle_message(message, address=None, host=None):
pass
@route_like(handle_message)
def handle_notification(message, address=None, host=None):
pass
@route_like(handle_message)
def handle_subscription(message, address=None, host=None):
pass
def start_server():
MailRequest(starttls=False).run()
python
from lamson.testing import SMTPError, RouterCleanup
def test_handle_message():
with RouterCleanup() as router:
router.deliver("test@example.com", "Hello Lamson!")
assert len(router.inbox()) == 1