Telnet/Connect to IMAP server over SSL or STARTTLS
SSL
openssl s_client -connect imap-mail.outlook.com:993
STARTTLS
openssl s_client -starttls imap -connect imap-mail.outlook.com:143
Source:
https://serverfault.com/questions/869291/connecting-to-hotmails-imap-server-using-telnet