Package defining a generic SMTP server class that can be used on a pre-connected socket. This works by calling optionally-defined callbacks in certain situations (typically when a client sends various commands).
- class slimta.smtp.server.Server(socket, handlers[, address=None[, auth=False[, context=None[, tls_immediately=False[, command_timeout=None[, data_timeout=None]]]]]])¶
Class that implements an SMTP server given a connected socket. This object has an
extensionsattribute that is an
Extensionsobject that contains the SMTP extensions the server supports.
gevent.socket.socket) – Connected socket for the session.
handlers – Object with methods that will be called when corresponding SMTP commands are received. These methods can modify the
Replybefore the command response is sent.
address – The address of the connected client.
auth – If True, enable authentication with default mechanisms. May also be given as a list of SASL mechanism names to support, e.g.
['PLAIN', 'LOGIN', 'CRAM-MD5'].
context – Enables SSL encryption on connected sockets using the information given in the context.
tls_immediately – If True, the socket will be encrypted immediately on connection rather than advertising
command_timeout – Optional timeout waiting for a command to be sent from the client.
data_timeout – Optional timeout waiting for data to be sent from the client.
- property encrypted¶
True if the session transport is encrypted, False otherwise.