Open fablaser opened 12 months ago
Hello, I found a temporary fix:
When you change in DNN from standard SMTP to oauth, in web.config mail defaultProvider="CoreMailProvider" will change to "MailKitMailProvider".
When you revert back to standard SMTP, the default provider will remain MailKitMailProvider. In order to manually fix the issue, it is necessary to change MailKitMailProvider to CoreMailProvider.
Please, take in consideration to fix this bug.
It seems like the MailKitMailProvider does not respect the setting "SSL off", since it's always set to SecureSocketOptions.Auto
instead of SecureSocketOptions.None
(http://www.mimekit.net/docs/html/T_MailKit_Security_SecureSocketOptions.htm):
It seems like the MailKitMailProvider does not respect the setting "SSL off", since it's always set to
SecureSocketOptions.Auto
instead ofSecureSocketOptions.None
(http://www.mimekit.net/docs/html/T_MailKit_Security_SecureSocketOptions.htm):
I don't know, anyway using standard SMTP, DNN should use CoreMailProvider instead of MailKitMailProvider. As I wrote, the default DNN email provider is CoreMailProvider.Using OAUTH, DNN switches to MailKitMailProvider but it will not change when you revert back to SMTP: it remains MailKitMailProvider .
It's currently quite tricky on how to handle this. We can remember the original mail provider and restore this once you switch back, however this bring other issues on the table:
XMailProvider
in web.config that doesn't support OAuth.YMailProvider
.XMailProvider
.We can check if the current provider is MailKitProvider and only then restore it back, but what if you want to keep using MailKitProvider?
I've talked with @valadas about this on Discord in the open source co-coding session. Daniel said it would better to introduce a separate config for the OAuth Mail Provider (for example <oAuthMail>
), which is probably better.
What's the best way to tackle this?
In my humble opinion, you should never manually change the email provider using web.config, but only using web interface. At the moment, any change using web interface is very risky because it can lead to a broken configuration.
@fablaser I was abel to reproduce this in 09.13.04 Can you please change the original Issue to include the actual issue (the switching to MailKitMailProvider) as that might increase the changes of this getting fixed :-)
Is there an existing issue for this?
What happened?
I updated my DNN instance from 9.12 to 9.13. After tried to setup OAUTH2 with exchange, I cannot revert back to a working SMTP configuration with anonymous authentication.
You will get the error "C'è un problema nella configurazione del server SMTP. La posta non è stata inviata. An error occurred while attempting to establish an SSL or TLS connection. The host name did not match the name given in the server's SSL certificate. Il certificato remoto non è stato ritenuto valido dalla procedura di convalida."
Steps to reproduce?
Current Behavior
No response
Expected Behavior
No response
Relevant log output
Anything else?
No response
Affected Versions
9.13.0 (latest release)
What browsers are you seeing the problem on?
Firefox
Code of Conduct