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

Class SMTP

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

Known Subclasses:
DomainSMTP, DummySMTP

SMTP server-side protocol.
Method Summary
  __init__(self)
  connectionFailed(self)
(Deprecated) (inherited from Protocol)
  connectionLost(self, reason)
  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.
  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)
  rfc822date(self)
  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)
  timedout(self)
  validateFrom(self, helo, origin, success, failure)
  validateTo(self, user, success, failure)
  _fromInvalid(self, from_, code, msg)
  _fromValid(self, from_, code, msg)
  _messageHandled(self, _)
  _messageNotHandled(self, _)
  _toInvalid(self, to, code, msg)
  _toValid(self, to, code, msg)

Class Variable Summary
SRE_Pattern mail_re
str qstring
SRE_Pattern rcpt_re

Method Details

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
Overrides:
twisted.protocols.basic.LineReceiver.rawDataReceived

sendCode(self, code, message='')

Send an SMTP code with a message.

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.2 prerelease on Wed Jan 29 06:28:33 2003 http://epydoc.sf.net