def HandleSuccessfulLogin(cli, conn, connectDelay, loginDelay) :
    """
    @param conn: the IMAP connection

    @param connectDelay, loginDelay: Timing
    @type  connectDelay, loginDelay: float

    @return: final exit code
    @rtype:  int
    """
    capabilities = conn.capabilities

    print "OK IMAP Login Successful"
    print "  Connect:  %(connectDelay).2fms" % locals()
    print "  Login:    %(loginDelay).2fms" % locals()

    imap_helpers.printCapabilities(conn, capabilities)

    imap_helpers.printMailboxesWithItemCount(conn)

    conn.logout()
    return 0
def HandleSuccessfulLogin(cli, conn, connectDelay, loginDelay) :
    """
    @param conn: the IMAP connection

    @param connectDelay, loginDelay: Timing
    @type  connectDelay, loginDelay: float

    @return: final exit code
    @rtype:  int
    """

    HandleMeasureCommand(cli, loginDelay)
    #HandleMeasureCommand(cli, connectDelayd)

    if cli.IsVerbose() :
        imap_helpers.printMailboxesWithItemCount(conn)

    if cli.IsVerbose() :
        imap_helpers.printMailboxesWithLatestMail(conn)

    conn.logout()
    return cli.MapNagiosReturnCode(nagios_stuff.NAGIOS_RC_OK)