This FAQ describes how to test an IMAP user login for a server with SSL enabled using cleartext authentication.
Make an imap connection:
openssl s_client -connect mail.domain.tld:993
At the prompt enter “01 login” with your username and password:
01 login <username> <password>
When done, issue:
02 logout
Reference: Link