ImapServer:several small fixes