class documentation

class twisted.mail.smtp.SMTP(basic.LineOnlyReceiver, policies.TimeoutMixin): (source)

Known subclasses: twisted.mail.smtp.ESMTP

View In Hierarchy

SMTP server-side protocol.

Property host Undocumented
Class Variable timeout Undocumented
Class Variable portal Undocumented
Class Variable noisy Undocumented
Instance Variable deliveryFactory Undocumented
Instance Variable delivery Undocumented
Method __init__ Undocumented
Instance Variable mode Undocumented
Method host.setter Undocumented
Method timeoutConnection Called when the connection times out.
Method greeting Undocumented
Method connectionMade Called when a connection is made.
Method sendCode Send an SMTP code with a message.
Method lineReceived Override this for when each line is received.
Method state_COMMAND Undocumented
Method sendSyntaxError Undocumented
Method lookupMethod
Method lineLengthExceeded Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.
Method do_UNKNOWN Undocumented
Method do_HELO Undocumented
Method do_QUIT Undocumented
Class Variable qstring Undocumented
Class Variable mail_re Undocumented
Class Variable rcpt_re Undocumented
Method do_MAIL Undocumented
Method do_RCPT Undocumented
Method do_DATA Undocumented
Instance Variable datafailed Undocumented
Method connectionLost Called when the connection is shut down.
Method do_RSET Undocumented
Method dataLineReceived Undocumented
Instance Variable challenger Undocumented
Method validateFrom Validate the address from which the message originates.
Method validateTo Validate the address for which the message is destined.
Method receivedHeader Undocumented
Instance Variable _onLogout Undocumented
Instance Variable _from Undocumented
Instance Variable _helo Undocumented
Instance Variable _to Undocumented
Instance Variable _host Undocumented
Method _cbFromValidate Undocumented
Method _ebFromValidate Undocumented
Method _cbToValidate Undocumented
Method _ebToValidate Undocumented
Method _disconnect Undocumented
Instance Variable __messages Undocumented
Instance Variable __inheader Undocumented
Instance Variable __inbody Undocumented
Method _messageHandled Undocumented
Method _cbAnonymousAuthentication Save the state resulting from a successful anonymous cred login.

Inherited from LineOnlyReceiver:

Class Variable delimiter The line-ending delimiter to use. By default this is b'\r\n'.
Class Variable MAX_LENGTH The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16384.
Method dataReceived Translates bytes into lines, and calls lineReceived.
Method sendLine Sends a line to the other end of the connection.
Instance Variable _buffer Undocumented

Inherited from Protocol (via LineOnlyReceiver):

Class Variable factory Undocumented
Method logPrefix Return a prefix matching the class name, to identify log messages related to this protocol instance.

Inherited from BaseProtocol (via LineOnlyReceiver, Protocol):

Instance Variable connected Undocumented
Instance Variable transport Undocumented
Method makeConnection Make a connection to a transport and a server.

Inherited from TimeoutMixin:

Instance Variable timeOut The number of seconds after which to timeout the connection.
Method callLater Wrapper around reactor.callLater for test purpose.
Method resetTimeout Reset the timeout count down.
Method setTimeout Change the timeout period
Instance Variable __timeoutCall Undocumented
Method __timedOut Undocumented
@property
host = (source)

Undocumented

timeout = (source)

Undocumented

(type: int)
portal = (source)

Undocumented

noisy = (source)

Undocumented

(type: bool)
deliveryFactory = (source)

Undocumented

delivery = (source)

Undocumented

_onLogout = (source)

Undocumented

def __init__(self, delivery=None, deliveryFactory=None): (source)

Undocumented

mode = (source)

Undocumented

_from = (source)

Undocumented

_helo = (source)

Undocumented

Undocumented

(type: list)
@host.setter
def host(self, toSet): (source)

Undocumented

_host = (source)

Undocumented

def timeoutConnection(self): (source)

Called when the connection times out.

Override to define behavior other than dropping the connection.

def greeting(self): (source)

Undocumented

def connectionMade(self): (source)

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

def sendCode(self, code, message=b''): (source)

Send an SMTP code with a message.

def lineReceived(self, line): (source)

Override this for when each line is received.

ParameterslineThe line which was received with the delimiter removed. (type: bytes)
def state_COMMAND(self, line): (source)

Undocumented

def sendSyntaxError(self): (source)

Undocumented

def lookupMethod(self, command): (source)
ParameterscommandThe command to get from this class. (type: str)
ReturnsThe function which executes this command.
def lineLengthExceeded(self, line): (source)

Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.

def do_UNKNOWN(self, rest): (source)

Undocumented

def do_HELO(self, rest): (source)

Undocumented

def do_QUIT(self, rest): (source)

Undocumented

qstring = (source)

Undocumented

mail_re = (source)

Undocumented

rcpt_re = (source)

Undocumented

def do_MAIL(self, rest): (source)

Undocumented

def _cbFromValidate(self, fromEmail, code=250, msg=b'Sender address accepted'): (source)

Undocumented

def _ebFromValidate(self, failure): (source)

Undocumented

def do_RCPT(self, rest): (source)

Undocumented

def _cbToValidate(self, to, user=None, code=250, msg=b'Recipient address accepted'): (source)

Undocumented

def _ebToValidate(self, failure): (source)

Undocumented

def _disconnect(self, msgs): (source)

Undocumented

def do_DATA(self, rest): (source)

Undocumented

datafailed = (source)

Undocumented

__messages = (source)

Undocumented

__inheader = (source)

Undocumented

(type: int)
__inbody = (source)

Undocumented

(type: int)
def connectionLost(self, reason): (source)

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.

ParametersreasonUndocumented (type: twisted.python.failure.Failure)
def do_RSET(self, rest): (source)

Undocumented

def dataLineReceived(self, line): (source)

Undocumented

def _messageHandled(self, resultList): (source)

Undocumented

def _cbAnonymousAuthentication(self, result): (source)

Save the state resulting from a successful anonymous cred login.

challenger = (source)

Undocumented

def validateFrom(self, helo, origin): (source)

Validate the address from which the message originates.

ParametersheloThe argument to the HELO command and the client's IP address. (type: (bytes, bytes))
originThe address the message is from (type: Address)
Returnsorigin or a Deferred whose callback will be passed origin. (type: Deferred or Address)
RaisesSMTPBadSenderRaised of messages from this address are not to be accepted.
def validateTo(self, user): (source)

Validate the address for which the message is destined.

ParametersuserThe address to validate. (type: User)
ReturnsA Deferred which becomes, or a callable which takes no arguments and returns an object implementing IMessage. This will be called and the returned object used to deliver the message when it arrives. (type: no-argument callable)
RaisesSMTPBadRcptRaised if messages to the address are not to be accepted.
def receivedHeader(self, helo, origin, recipients): (source)

Undocumented

API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.