question

MD-2159 avatar image
0 Votes"
MD-2159 asked ·

How to configure cdosys to send using non default port with ssl (still unanswered)

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.

Thank you.

winapi-general
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I really hoped that someone would see this ticket and comment on it.
Has it disappeared due to the age of the ticket and finding the correct tag too late?

0 Votes 0 ·

1 Answer

TeemoTang-MSFT avatar image
0 Votes"
TeemoTang-MSFT answered ·

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.


· 6 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have changed the tag from windows to development as you suggested, although I really consider cdosys to be a built-in Windows feature since the cdosys.dll comes with the operating system last I checked. I guess it can be considered a fine line.
Note that this is definitely not a .NET question.
I found it really difficult to find an appropriate tag. I wish there was some clarity on what the tags are for.

Well, I thought I did, but apparently I cannot. It seems that there is no relevant tag.
I can find stuff for office, sharepoint, azure, and dotnet, but this is not an issue with any of those.

Is there some other Microsoft forum where I should be asking this question, hopefully that gets a lot of activity?

0 Votes 0 ·
MD-2159 avatar image MD-2159 TeemoTang-MSFT ·

I don't understand how that would help either since this is not an issue with asp, never mind asp.net.
The cdosys.dll is a component of Windows.
A version of the dll can be found in both the C:\Windows\SysWOW64 folder and the C:\Windows\system32 folder.
The properties of the file state that it is the "Microsoft CDO for Windows Library" version 6.6.19041.746 (on my pc) and the Product Name is "Microsoft Windows Operating System" Copyright "Microsoft Corporation..."

Is there no appropriate place to post these kinds of questions?

0 Votes 0 ·
MD-2159 avatar image MD-2159 TeemoTang-MSFT ·

I finally found this article announcement-8220general-windows-desktop-development-issues8221-forum-will-be-migrating-to-a which states to use the tag "winapi-general" so I have changed the tag to that. I find it unfortunate that the new tag names are very unclear as to the purpose, when compared to the forum names in the old msdn forum. They really need some tag lookup that can suggest tag and describe their purpose.
I hope it is now the correct tag to use!

0 Votes 0 ·
Show more comments

Is there a way to mark this as not the answer? I believe forums users may be misinterpreting my question as answered.

0 Votes 0 ·