twisted.mail.smtp.SMTP(basic.LineOnlyReceiver, policies.TimeoutMixin)class documentation
twisted.mail.smtpView Source (View In Hierarchy)
Known subclasses: twisted.mail.smtp.ESMTP
SMTP server-side protocol.
|Instance Variable||host 0||The hostname of this mail server. (type:
|Method||timeoutConnection||Called when the connection times out.|
|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||lineLengthExceeded||Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.|
|Method||connectionLost||Called when the connection is shut down.|
|Method||validateFrom||Validate the address from which the message originates.|
|Method||validateTo||Validate the address for which the message is destined.|
|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
|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.|
Inherited from Protocol (via LineOnlyReceiver):
|Method||logPrefix||Return a prefix matching the class name, to identify log messages related to this protocol instance.|
Inherited from BaseProtocol (via LineOnlyReceiver, Protocol):
|Method||makeConnection||Make a connection to a transport and a server.|
Inherited from TimeoutMixin:
|Class Variable||timeOut||The number of seconds after which to timeout the connection.|
|Method||resetTimeout||Reset the timeout count down.|
|Method||setTimeout||Change the timeout period|
Called when the connection times out.
Override to define behavior other than dropping the connection.
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.
Send an SMTP code with a message.
Override this for when each line is received.
|Parameters||line||The line which was received with the delimiter removed. (type: |
|Parameters||command||The command to get from this class. (type: |
|Returns||The function which executes this command.|
Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.
Called when the connection is shut down.
Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Save the state resulting from a successful anonymous cred login.
Validate the address from which the message originates.
|Parameters||helo||The argument to the HELO command and the client's IP address. (type: |
|origin||The address the message is from (type: |
|Raises||SMTPBadSender||Raised of messages from this address are not to be accepted.|
Validate the address for which the message is destined.
|Parameters||user||The address to validate. (type: |
|Raises||SMTPBadRcpt||Raised if messages to the address are not to be accepted.|