Package twisted :: Package protocols :: Module smtp :: Class SMTP
[show private | hide private]
[frames | no frames]

Class SMTP

BaseProtocol --+        
               |        
        Protocol --+    
                   |    
        LineReceiver --+
                       |
                      SMTP

Known Subclasses:
DomainSMTP, ESMTP

SMTP server-side protocol.
Method Summary
  __init__(self)
  clearLineBuffer(self)
Clear buffered data. (inherited from LineReceiver)
  connectionFailed(self)
(Deprecated) (inherited from Protocol)
  connectionLost(self, reason)
Called when the connection is shut down.
  connectionMade(self)
Called when a connection is made.
  dataLineReceived(self, line)
  dataReceived(self, data)
Protocol.dataReceived. (inherited from LineReceiver)
  do_DATA(self, rest)
  do_HELO(self, rest)
  do_MAIL(self, rest)
  do_QUIT(self, rest)
  do_RCPT(self, rest)
  do_RSET(self, rest)
  do_UNKNOWN(self, rest)
  lineLengthExceeded(self, line)
Called when the maximum line length has been reached.
  lineReceived(self, line)
Override this for when each line is received.
  lookupMethod(self, command)
  makeConnection(self, transport)
Make a connection to a transport and a server. (inherited from BaseProtocol)
  rawDataReceived(self, data)
Throw away rest of long line
  receivedHeader(self, helo, origin, recipents)
  sendCode(self, code, message)
Send an SMTP code with a message.
  sendLine(self, line)
Sends a line to the other end of the connection. (inherited from LineReceiver)
  setLineMode(self, extra)
Sets the line-mode of this receiver. (inherited from LineReceiver)
  setRawMode(self)
Sets the raw mode of this receiver. (inherited from LineReceiver)
  startMessage(self, recipients)
  state_COMMAND(self, line)
  state_DATA(self, line)
  timedout(self)
  validateFrom(self, helo, origin)
  validateTo(self, user)
  _cbFromValidate(self, from_, code, msg)
  _cbToValidate(self, to, code, msg)
  _ebValidate(self, failure)
  _fromInvalid(self, from_, code, msg)
For compatibility
  _messageHandled(self, _)
  _messageNotHandled(self, failure)
  _toInvalid(self, to, code, msg)
For compatibility

Class Variable Summary
SRE_Pattern mail_re
str qstring
SRE_Pattern rcpt_re

Method Details

connectionLost(self, reason)

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parameters:
reason
           (type=twisted.python.failure.Failure)
Overrides:
twisted.internet.protocol.Protocol.connectionLost (inherited documentation)

connectionMade(self)

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.
Overrides:
twisted.internet.protocol.BaseProtocol.connectionMade (inherited documentation)

lineLengthExceeded(self, line)

Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.
Overrides:
twisted.protocols.basic.LineReceiver.lineLengthExceeded (inherited documentation)

lineReceived(self, line)

Override this for when each line is received.
Overrides:
twisted.protocols.basic.LineReceiver.lineReceived (inherited documentation)

rawDataReceived(self, data)

Throw away rest of long line

sendCode(self, code, message='')

Send an SMTP code with a message.

_fromInvalid(self, from_, code=550, msg='No mail for you!')

For compatibility

_toInvalid(self, to, code=550, msg='Cannot receive for specified address')

For compatibility

Class Variable Details

mail_re

Type:
SRE_Pattern
Value:
\s*FROM:\s*(<>|<("[^"]*"|\\.|[-A-Za-z0-9!#\$%&'\*\+/=\?\^_`\{\|\}~]|[@\
\.,:])+>|("[^"]*"|\\.|[-A-Za-z0-9!#\$%&'\*\+/=\?\^_`\{\|\}~]|[@\.,:])+\
)\s*(\s(.*))?$                                                         

qstring

Type:
str
Value:
'("[^"]*"|\\\\.|[-A-Za-z0-9!\\#$%&\'*+/=?^_`{|}~]|[@.,:])+'            

rcpt_re

Type:
SRE_Pattern
Value:
\s*TO:\s*(<("[^"]*"|\\.|[-A-Za-z0-9!#\$%&'\*\+/=\?\^_`\{\|\}~]|[@\.,:]\
)+>|("[^"]*"|\\.|[-A-Za-z0-9!#\$%&'\*\+/=\?\^_`\{\|\}~]|[@\.,:])+)\s*(\
\s(.*))?$                                                              

Generated by Epydoc 1.1 on Fri Jun 27 03:48:38 2003 http://epydoc.sf.net