I have an application that runs on Windows 10 and Windows Server 2016/2019 and uses cdosys.dll to send emails to an SMTP server via a port with "UseSSL" enabled.
I have been informed that IT wants to block connection on the default port 25 and instead redirect the application to use a different port.
I have tried to do this but it does not seem to work.
I tried to determine what cdosys is doing internally but can find nothing on this.
I then created a .NET application using "System.Net.Sockets.TcpClient" to simulate the initial connection of an SMTP server so I could see what cdosys.dll is doing when attempting to communicate with an SMTP server.
To make this work, I simply have cdosys.dll connect to my simulated SMTP server which then relays the transmitted data (modified when needed) between our internal SMTP Server (Exchange 2019) and cdosys.dll. This allowed me to watch and log what it was doing.
I found that if I connect using the default SMTP port 25, everything seems to be working as expected.
All communication starts out as plain text until the STARTTLS command is issued at which point I cut off the communication.
If I instead use a different port (e.g. 26, 2525, 1234), instead of cdosys.dll behaving the same way, it sends a byte stream that I am unable to determine what it is. When using port 25, that byte stream can be converted to ASCII text, but not on alternate ports. It is also not UNICODE data. I thought this might be an Implicit SSL connection instead of an Explicit one, so I tried to enable a secure connection using "System.Net.Security.SslStream", but it will not receive any data.
I am unsure what my issue is.
I can provide code if someone believes it would be useful, but it is a lot. I am hoping there is someone with knowledge of what cdosys.dll is doing internally so I can determine what the issue is, or if someone has suggestions on how I can make it work. I hope I do not have to try to contact the original developer as that is not a simple thing to do. This is a third party tool that integrates with out app which we provide to clients so many of them are using this. I also do not look forward to the potential prospect of re-writing it. Unfortunately I cannot give details of that tool.
I appreciate any help of insight that anyone can provide.