'Handle a STAT command.
@rtype: L{Deferred <defer.Deferred>}
@return: A deferred which triggers after the response to the STAT
command has been issued.'

def do_STAT(self):

    d = defer.maybeDeferred(self.mbox.listMessages)
    def cbMessages(msgs):
        return self._coiterate(formatStatResponse(msgs))
    def ebMessages(err):
        self.failResponse(err.getErrorMessage())
        log.msg('Unexpected    do_STAT    failure:')
        log.err(err)
    return self._longOperation(d.addCallbacks(cbMessages, ebMessages))
