Skip to content

aiosmtpd

Provide a SMTP compatible interface to User Notify.

Classes:

  • SMTPHandler

    A SMTP handler compatible with the [aiosmtpd]: https://aiosmtpd.aio-libs.org/ library. Pass a

  • UsernamePasswordAuthenticator

    A custom authentication callable for use with aiosmtpd which verifies the username and password

SMTPHandler

SMTPHandler(session)

A SMTP handler compatible with the [aiosmtpd]: https://aiosmtpd.aio-libs.org/ library. Pass a User Notify session when constructing the instance.

An implementation of from_cli is provided which supports taking the service name on the command line.

Methods:

  • handle_DATA

    Hook handling submission of mail.

  • from_cli

    Construct a handler from CLI arguments. A mandatory argument of the service name must be

handle_DATA async

handle_DATA(server, session, envelope)

Hook handling submission of mail.

from_cli classmethod

from_cli(parser, *args)

Construct a handler from CLI arguments. A mandatory argument of the service name must be present. Optional arguments can be set via the USER_NOTIFY_ENVIRONMENT, USER_NOTIFY_IMPERSONATE_SERVICE_ACCOUNT and USER_NOTIFY_ROLE_SESSION_NAME environment variables.

UsernamePasswordAuthenticator

UsernamePasswordAuthenticator(username, password)

A custom authentication callable for use with aiosmtpd which verifies the username and password match those passed to the constructor.

Pass an instance of this class to the authenticator keyword argument when constructing the controller.

Methods:

__call__

__call__(server, session, envelope, mechanism, auth_data)