First of all, you need to know the server IP's and ports. There are often included descriptions what protocol they are speak on which port:
Googlemail - Gmail
Server: Authentication: Port:
SMTP Server smtp.gmail.com SSL 465
smtp.gmail.com StartTLS 587
IMAP Server imap.gmail.com SSL 993
Server List from ARCLAB.
To check by yourself, you can use openssl
:
openssl s_client -crlf -connect smtp.gmail.com:993
and the output:
---
SSL handshake has read 3238 bytes and written 435 bytes
---
New, TLSv1/SSLv3, Cipher is RC4-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : RC4-SHA
Session-ID: 92C91152E2BBD7BC1A40889A4B31BB343045275F823F658B5042752B5FFCD072
Session-ID-ctx:
Master-Key: DE4696E40209CB2358ECD9A57537BCBAAC8892E4B1E243C9218F102997741B780C987F4CF7CFEFE7F66919496AFF1D4A
Key-Arg : None
Start Time: 1403632088
Timeout : 300 (sec)
Verify return code: 20 (unable to get local issuer certificate)
---
* OK Gimap ready for requests from 87.17X.XXX.XX qbxmb6xx690wic
Secure connections between SMTP MTA's is done mostly via TLS. TLS is unlike SSL an extra feature which is initialized with the SMTP command STARTTLS
.
You'll never know if a Google SMTP Server is sending via TLS to yahoo and vice versa, except you have access to the network between and you can sniff them. But you can at least check if the servers understand TLS. So if a server is configured for TLS, it will connect to yahoo or google servers via TLS.
host -t mx yahoo.com
yahoo.com mail is handled by 1 mta5.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta6.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta7.am0.yahoodns.net.
openssl s_client -starttls smtp -connect mta5.am0.yahoodns.net:25 -showcerts
and the same for google
host -t mx google.com
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
openssl s_client -starttls smtp -connect alt1.aspmx.l.google.com:25
And the output:
---
SSL handshake has read 3985 bytes and written 470 bytes
---
New, TLSv1/SSLv3, Cipher is RC4-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : RC4-SHA
Session-ID: 5BD83CAF6233F40A7CE5161232DDDDEB89D548C2E35CD12904ED766A4725CA83
Session-ID-ctx:
Master-Key: CA3AB66161D5A6464D0CAE30E614CABE5B44EFAAE7CE41377A7C18607DBC010E12C0DE42095CABE76E569ED77359367D
Key-Arg : None
Start Time: 1403643466
Timeout : 300 (sec)
Verify return code: 20 (unable to get local issuer certificate)
---
250 CHUNKING