imap: many tests and capability to list folders