Sichtbeleg Anpassung für Zeilendopplung etc
MailSession - Logerweiterung für AzurePortale
This commit is contained in:
@@ -202,6 +202,15 @@ Namespace Mail
|
||||
Try
|
||||
' STARTTLS: connect plain and then upgrade
|
||||
Logger.Debug("Connecting with [STARTTLS/Connect] on [{0}/{1}]", pSession.Server, pSession.Port)
|
||||
' Für Azure Communication Services: Explizite TLS-Konfiguration
|
||||
If pSession.Server.Contains("azurecomm.net") Then
|
||||
Logger.Debug("Azure Communication Services detected - forcing TLS 1.2")
|
||||
' Überschreibe alle vorherigen Einstellungen
|
||||
Client.SSLConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12
|
||||
Logger.Debug("Forced Encryption Protocols: [{0}]", Client.SSLConfiguration.EnabledSslProtocols)
|
||||
End If
|
||||
|
||||
|
||||
Client.Connect(pSession.Server, pSession.Port)
|
||||
|
||||
Dim oSupportsSTARTTLS As Boolean = SupportsSTARTTLS(Client)
|
||||
@@ -320,9 +329,32 @@ Namespace Mail
|
||||
|
||||
Private Sub DoUseBestLogin_BasicAuth(pClient As ClientBase, pUserName As String, pPassword As String)
|
||||
Logger.Debug("Logging in with Simple Auth")
|
||||
Logger.Debug("Username format: [{0}]", If(pUserName.Contains("@"), "Email format", "Other format"))
|
||||
|
||||
If TypeOf pClient Is Smtp Then
|
||||
DirectCast(pClient, Smtp).UseBestLogin(pUserName, pPassword)
|
||||
Dim smtp = DirectCast(pClient, Smtp)
|
||||
|
||||
' Zeige unterstützte Auth-Methoden (nur Logging, keine Funktionsänderung)
|
||||
Try
|
||||
Dim supportedExtensions = smtp.SupportedExtensions()
|
||||
Logger.Debug("Server supported extensions count: [{0}]", supportedExtensions.Count)
|
||||
If supportedExtensions.Count > 0 Then
|
||||
Logger.Debug("Server supported extensions: [{0}]", String.Join(", ", supportedExtensions.Select(Function(x) x.ToString())))
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Debug("Could not retrieve supported extensions: {0}", ex.Message)
|
||||
End Try
|
||||
|
||||
' Azure Communication Services Detection (nur Logging)
|
||||
If _Session?.Server?.Contains("azurecomm.net") Then
|
||||
Logger.Debug("Azure Communication Services detected")
|
||||
Logger.Debug("Note: Username should be '<endpoint>.communication.azure.com'")
|
||||
Logger.Debug("Note: Password should be the Access Key from Azure Portal")
|
||||
End If
|
||||
|
||||
' Ursprüngliche Funktionalität bleibt unverändert
|
||||
smtp.UseBestLogin(pUserName, pPassword)
|
||||
|
||||
ElseIf TypeOf pClient Is Imap Then
|
||||
DirectCast(pClient, Imap).UseBestLogin(pUserName, pPassword)
|
||||
Else
|
||||
@@ -399,10 +431,13 @@ Namespace Mail
|
||||
End Sub
|
||||
|
||||
Private Sub Session_ServerCertificateValidate(sender As Object, e As ServerCertificateValidateEventArgs)
|
||||
' i dont know why it works but it does
|
||||
Logger.Debug("Certificate validation for: [{0}]", e.Certificate?.Subject)
|
||||
Logger.Debug("SSL Policy Errors: [{0}]", e.SslPolicyErrors)
|
||||
|
||||
If (e.SslPolicyErrors And Not SMTP_IGNORED_ERRORS) = SslPolicyErrors.None Then
|
||||
e.IsValid = True
|
||||
Else
|
||||
Logger.Warn("Certificate validation failed. Errors: [{0}]", e.SslPolicyErrors)
|
||||
e.IsValid = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.0.0.0")>
|
||||
<Assembly: AssemblyVersion("2.1.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.1.0.0")>
|
||||
|
||||
Reference in New Issue
Block a user