Configuring cdosys to send using non default port with ssl sends garbled data (still unanswered)

M D 1 Reputation point
2021-02-10T06:38:21.69+00:00

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. It just appears to be GARBLED data. 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.

Thank you.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,429 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Teemo Tang 11,351 Reputation points
    2021-02-11T05:44:11.083+00:00

    For development, SMTP Authentication or .NET related question, you’d better ask for help from .NET or development related tag, current Windows 10 general and Windows Server tags are discussing about Windows 10 and server system itself and their built-in features, it is not a correct place to discuss development and CDOSYS Schema.
    Please understand.

    -------------------------------------------------------------------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. M D 1 Reputation point
    2021-07-12T23:33:05.233+00:00

    What a disappointment that no one can provide any insight on this.

    0 comments No comments