Package twisted :: Package protocols :: Module imap4 :: Class IMAP4Server
[show private | hide private]
[frames | no frames]

Class IMAP4Server

BaseProtocol --+        
               |        
        Protocol --+    
                   |    
        LineReceiver --+
                       |
        TimeoutMixin --+
                       |
                      IMAP4Server


Protocol implementation for an IMAP4rev1 server.

The server can be in any of four states:
Method Summary
  __init__(self, contextFactory)
  auth_APPEND(self, tag, args)
  auth_CAPABILITY(self, tag, args)
  auth_CREATE(self, tag, args)
  auth_DELETE(self, tag, args)
  auth_EXAMINE(self, tag, args)
  auth_LIST(self, tag, args)
  auth_LOGOUT(self, tag, args)
  auth_LSUB(self, tag, args)
  auth_NOOP(self, tag, args)
  auth_QUIT(self, tag, args)
  auth_RENAME(self, tag, args)
  auth_SELECT(self, tag, args)
  auth_STATUS(self, tag, args)
  auth_SUBSCRIBE(self, tag, args)
  auth_UNSUBSCRIBE(self, tag, args)
Account authenticateLogin(self, user, passwd)
Lookup the account associated with the given parameters
  checkpoint(self)
Called when the client issues a CHECK command.
  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.
  dataReceived(self, data)
Protocol.dataReceived. (inherited from LineReceiver)
  dispatchCommand(self, tag, cmd, rest)
  flagsChanged(self, newFlags)
  lineLengthExceeded(self, line)
Called when the maximum line length has been reached. (inherited from LineReceiver)
  lineReceived(self, line)
Override this for when each line is received.
  listCapabilities(self)
  logout_CAPABILITY(self, tag, args)
  logout_LOGOUT(self, tag, args)
  logout_NOOP(self, tag, args)
  logout_QUIT(self, tag, args)
  lookupCommand(self, cmd)
Any object which implements write(string) and seek(int, int) messageFile(self, octets)
Create a file to which an incoming message may be written.
  modeChanged(self, writeable)
  newMessages(self, exists, recent)
  rawDataReceived(self, data)
Override this for when raw data is received.
  registerChallenger(self, chal)
Register a new form of authentication
  resetTimeout(self)
Reset the timeout count down (inherited from TimeoutMixin)
  select_APPEND(self, tag, args)
  select_CAPABILITY(self, tag, args)
  select_CHECK(self, tag, args)
  select_CLOSE(self, tag, args)
  select_COPY(self, tag, args, uid)
  select_CREATE(self, tag, args)
  select_DELETE(self, tag, args)
  select_EXAMINE(self, tag, args)
  select_EXPUNGE(self, tag, args)
  select_FETCH(self, tag, args, uid)
  select_LIST(self, tag, args)
  select_LOGOUT(self, tag, args)
  select_LSUB(self, tag, args)
  select_NOOP(self, tag, args)
  select_QUIT(self, tag, args)
  select_RENAME(self, tag, args)
  select_SEARCH(self, tag, args, uid)
  select_SELECT(self, tag, args)
  select_STATUS(self, tag, args)
  select_STORE(self, tag, args, uid)
  select_SUBSCRIBE(self, tag, args)
  select_UID(self, tag, args)
  select_UNSUBSCRIBE(self, tag, args)
  sendBadResponse(self, tag, message)
  sendContinuationRequest(self, msg)
  sendLine(self, line)
Sends a line to the other end of the connection. (inherited from LineReceiver)
  sendNegativeResponse(self, tag, message)
  sendPositiveResponse(self, tag, message)
  sendServerGreeting(self)
  sendUntaggedResponse(self, message)
  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)
  setTimeout(self, period)
Change the timeout period (inherited from TimeoutMixin)
  timeoutConnection(self)
Called when the connection times out.
  unauth_AUTHENTICATE(self, tag, args)
  unauth_CAPABILITY(self, tag, args)
  unauth_LOGIN(self, tag, args)
  unauth_LOGOUT(self, tag, args)
  unauth_NOOP(self, tag, args)
  unauth_QUIT(self, tag, args)
  unauth_STARTTLS(self, tag, args)

Class Variable Summary
tuple __implements__
NoneType account
dict CAPABILITIES
NoneType challengers
str IDENT
NoneType mbox
int POSTAUTH_TIMEOUT
str state
NoneType tags
int timeOut

Method Details

authenticateLogin(self, user, passwd)

Lookup the account associated with the given parameters

Override this method to define the desired authentication behavior.
Parameters:
user - The username to lookup
           (type=str)
passwd - The password to login with
           (type=str)
Returns:
An appropriate account object, or None
           (type=Account)

checkpoint(self)

Called when the client issues a CHECK command.

This should perform any checkpoint operations required by the server. It may be a long running operation, but may not block. If it returns a deferred, the client will only be informed of success (or failure) when the deferred's callback (or errback) is invoked.

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)

lineReceived(self, line)

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

messageFile(self, octets)

Create a file to which an incoming message may be written.
Parameters:
octets - The number of octets which will be written to the file
           (type=int)
Returns:
A file-like object
           (type=Any object which implements write(string) and seek(int, int))

rawDataReceived(self, data)

Override this for when raw data is received.
Overrides:
twisted.protocols.basic.LineReceiver.rawDataReceived (inherited documentation)

registerChallenger(self, chal)

Register a new form of authentication

Challengers registered here will be listed as available to the client in the CAPABILITY response.
Parameters:
chal - The object to use to perform the client side of this authentication scheme.
           (type=Implementor of IServerAuthentication)

timeoutConnection(self)

Called when the connection times out. Override to define behavior other than dropping the connection.
Overrides:
twisted.protocols.policies.TimeoutMixin.timeoutConnection (inherited documentation)

Class Variable Details

__implements__

Type:
tuple
Value:
(<class twisted.protocols.imap4.IMailboxListener at 0x87d540c>,)       

account

Type:
NoneType
Value:
None                                                                   

CAPABILITIES

Type:
dict
Value:
{}                                                                     

challengers

Type:
NoneType
Value:
None                                                                   

IDENT

Type:
str
Value:
'Twisted IMAP4rev1 Ready'                                              

mbox

Type:
NoneType
Value:
None                                                                   

POSTAUTH_TIMEOUT

Type:
int
Value:
1800                                                                   

state

Type:
str
Value:
'unauth'                                                               

tags

Type:
NoneType
Value:
None                                                                   

timeOut

Type:
int
Value:
60                                                                     

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