Using TLS email protocol in a program
-
Hello all. I wanted to repost this with some more info that will hopefully help understand my question a little better. Please see screenshots links a the bottom of post. Our email program needs to connect and send mail using MS O365 accounts and the TLS protocol for security reasons with port 587. For testing, I used TELNET to the O365 STMP server using port 587, the EHLO command and starting TLS using the STARTTLS command but that is far as I can get. After that, anything I do just sits there and no more responses from the server. I am trying to figure login commands at this point, which I researched from Google but didn't seem to work, much less anything else. A set of connection rules I found about TLS here on Code Project is the list below. If I need to, I can send a screenshot of what the TELNET session looks like to help out. Any help would be very appreciated. Thanks! 1. The client connects to the server using TCP. 2. The server sends a welcome message using the un-encrypted connection to the client. 3. The client sends a EHLO command using the un-encrypted connection to the server. 4. The server responds to the EHLO command using the un-encrypted connection. 5. The client sends a STARTTLS command using the un-encrypted connection to the server. 6. The server responds to the STARTTLS command using the un-encrypted connection. 7. The client negotiates an encrypted connection with the server. 8. The client sends a EHLO command using the encrypted connection to the server. 9. The server responds to the EHLO command using the encrypted connection. A) This first image is how I TELNET to email server for testing purposes. In the program, we use SMTP sockets to do the same thing: Image 3 B) This next one is a normal SMTP screen using port 25 (NO TLS) and connects successfully: Image 1 C) Last screenshot is my TELNET attempt to TLS protocol in which I am stuck on what to do next after successfully starting the TLS sever: Image 4
-
Hello all. I wanted to repost this with some more info that will hopefully help understand my question a little better. Please see screenshots links a the bottom of post. Our email program needs to connect and send mail using MS O365 accounts and the TLS protocol for security reasons with port 587. For testing, I used TELNET to the O365 STMP server using port 587, the EHLO command and starting TLS using the STARTTLS command but that is far as I can get. After that, anything I do just sits there and no more responses from the server. I am trying to figure login commands at this point, which I researched from Google but didn't seem to work, much less anything else. A set of connection rules I found about TLS here on Code Project is the list below. If I need to, I can send a screenshot of what the TELNET session looks like to help out. Any help would be very appreciated. Thanks! 1. The client connects to the server using TCP. 2. The server sends a welcome message using the un-encrypted connection to the client. 3. The client sends a EHLO command using the un-encrypted connection to the server. 4. The server responds to the EHLO command using the un-encrypted connection. 5. The client sends a STARTTLS command using the un-encrypted connection to the server. 6. The server responds to the STARTTLS command using the un-encrypted connection. 7. The client negotiates an encrypted connection with the server. 8. The client sends a EHLO command using the encrypted connection to the server. 9. The server responds to the EHLO command using the encrypted connection. A) This first image is how I TELNET to email server for testing purposes. In the program, we use SMTP sockets to do the same thing: Image 3 B) This next one is a normal SMTP screen using port 25 (NO TLS) and connects successfully: Image 1 C) Last screenshot is my TELNET attempt to TLS protocol in which I am stuck on what to do next after successfully starting the TLS sever: Image 4
If you are going to be running this from your main office or even several offices/places that have a Static IP or FQDN that uses Dynamic DNS, why not add a Receive Connector to your Office 365 Portal. Login to Office 365 Portal[^] with your Admin Credentials - Click Admin -> Admin centers -> Exchange -> mail flow -> connectors. Click + (New) -> From: Partner organization To: Office 365 -> Next -> Name: Bruce (what ever) -> Next -> Use the sender's IP address -> Next -> + (Add IP) 1.2.3.4 -> OK -> Next -> Select Security restrictions and click your way through. You should be able to side step TLS and still be somewhat secured through the connector.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004