
I hope this helps someone else in future. It's a bit strange that this particular error message comes up when a library is missing and all SSL options are turned off.
#Surgemail smtp relay install
net 2.1 runtime installation doesn't actually install all the pre-requisites required for Mailkit. net runtime libcurl.Īfter running the following command it immediately started working without error: The resolution turned out to be a missing pre-requisite that was not installed with the. When I completely turned off SSL in MailKit and also overrode the certificate check and it still gave the same error about the certificate I knew something more was up. net 2.1 runtime and got the error stack trace in the block below when using IMAP to connect to the mail server.īecause the error specifically states it's a certificate issue I spent a lot of time trying many different things including opening the mail server non SSL port for IMAP and turning off SSL in my code completely, everything worked no matter what I did on my local Windows dev station but not on the Linux server. We recently ported our online services to Linux so I installed it on Linux with the. It worked fine on a Windows server for months.

The application is an internal company app that uses IMAP to check for mail and display it in a web page. I have a asp.net Core 2.1 project with Mailkit 2.0.5 on Ubuntu 16.04.4 and a Surgemail mail server we host ourselves. This was a vexing problem that I found a solution for and am posting in case anyone else runs into this issue.
