amira
amira

Reputation: 58

How to know that smtp server support ssl or not?

How to know if ssl is supported on smtp server from the terminal ?

Upvotes: 1

Views: 995

Answers (1)

user
user

Reputation: 6947

You can connect to the mail server on the standard port, send a EHLO command and see if the response includes the STARTTLS capability. This tells you that the mail server will let you run an encrypted session over a standard SMTP connection. For example:

$ telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost
220 localhost ESMTP
EHLO localhost
250-localhost
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS  <--- here it is
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
QUIT
221 2.0.0 Bye

Alternatively, you can try connecting to the default SMTP-over-SSL port of 465/tcp, and assume that the mail server supports SSL if you get a positive response and a successful SSL handshake followed by a SMTP greeting.

Upvotes: 4

Related Questions