STARTTLScommand. You tell curl to attempt this with
--sslor if you want to insist on a secure connection you use
--ssl-reqd. Like this:
imaps://. For such connections, curl will insist on connecting and negotiating a TLS connection already from the start, or it will fail its operation.