openssl s_client -connect $IP:993 -quiet

Open a TLS session to a mail service to read banners, or pull hostnames out of a certificate

Command: Linux

References:

https://docs.openssl.org/master/man1/openssl-s_client/