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

Class IMAP4Server

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


Protocol implementation for an IMAP4rev1 server.

The server can be in any of four states:
    Non-authenticated
    Authenticated
    Selected
    Logout

Method Summary
  __init__(self)
  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_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.
  connectionFailed(self)
(Deprecated) (inherited from Protocol)
  connectionLost(self, reason)
Called when the connection is shut down. (inherited from Protocol)
  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)
  lookupCommand(self, cmd)
  makeConnection(self, transport)
Make a connection to a transport and a server. (inherited from BaseProtocol)
  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
  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_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)
  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)
  _cbAppend(self, result, tag, mbox)
  _cbAuthChunk(self, result, auth, savedState, tag)
  _cbCheck(self, result, tag)
  _cbClose(self, result, tag)
  _cbContinueAppend(self, rest, tag, mbox, flags, date)
  _cbCopied(self, deferredIds, ids, failures, tag, mbox)
  _cbCopy(self, messages, tag, mbox)
  _cbExpunge(self, result, tag)
  _cbFetch(self, results, tag, uid)
  _cbLogin(self, account, tag)
  _cbSearch(self, result, tag, uid)
  _cbStatus(self, status, tag, box)
  _cbStore(self, result, tag, silent)
  _ebAppend(self, failure, tag)
  _ebCheck(self, failure, tag)
  _ebClose(self, failure, tag)
  _ebExpunge(self, failure, tag)
  _ebFetch(self, failure, tag)
  _ebLogin(self, failure, tag)
  _ebSearch(self, failure, tag)
  _ebStatus(self, failure, tag, box)
  _ebStore(self, failure, tag)
  _listWork(self, tag, args, sub, cmdName)
  _parseMbox(self, name)
  _respond(self, state, tag, message)
  _selectWork(self, tag, args, rw, cmdName)
  _setupForLiteral(self, octets)

Class Variable Summary
tuple __implements__
None account
dictionary CAPABILITIES
None challengers
string IDENT
None mbox
None tags
None _pendingBuffer
None _pendingLiteral
None _pendingSize

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.

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)

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)

Class Variable Details

__implements__

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

account

Type:
None
Value:
None                                                                   

CAPABILITIES

Type:
dictionary
Value:
{}                                                                     

challengers

Type:
None
Value:
None                                                                   

IDENT

Type:
string
Value:
'Twisted IMAP4rev1 Ready'                                              

mbox

Type:
None
Value:
None                                                                   

tags

Type:
None
Value:
None                                                                   

_pendingBuffer

Type:
None
Value:
None                                                                   

_pendingLiteral

Type:
None
Value:
None                                                                   

_pendingSize

Type:
None
Value:
None                                                                   

Generated by Epydoc 1.1 on Thu Apr 17 12:55:33 2003 http://epydoc.sf.net