test imap function