From a415f90906dd4c6f353c0932c64326b63f1a2fe8 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 14 Sep 2023 15:40:23 +0200 Subject: [PATCH] Messaging: Fix Mail Session --- Messaging/Mail/MailSession.vb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Messaging/Mail/MailSession.vb b/Messaging/Mail/MailSession.vb index 61c30bfc..e0ad7362 100644 --- a/Messaging/Mail/MailSession.vb +++ b/Messaging/Mail/MailSession.vb @@ -166,7 +166,7 @@ Namespace Mail ElseIf pSession.AuthType = AUTH_SSL Then Try - If pSession.Port = 465 Then + If pSession.Port = 993 Then Logger.Debug("Connecting with [ConnectSSL] on [{0}/{1}]", pSession.Server, pSession.Port) Client.ConnectSSL(pSession.Server, pSession.Port) Else @@ -186,8 +186,13 @@ Namespace Mail ElseIf Session.AuthType = AUTH_SSLTLS Or Session.AuthType = AUTH_STARTTLS Then Try - Logger.Debug("Connecting with [Connect] on [{0}/{1}]", pSession.Server, pSession.Port) - Client.Connect(pSession.Server, pSession.Port) + If pSession.Port = 993 Then + Logger.Debug("Connecting with [ConnectSSL] on [{0}/{1}]", pSession.Server, pSession.Port) + Client.ConnectSSL(pSession.Server, pSession.Port) + Else + Logger.Debug("Connecting with [Connect] on [{0}/{1}]", pSession.Server, pSession.Port) + Client.Connect(pSession.Server, pSession.Port) + End If Logger.Info("Connection Successful!") Dim oSupportsSTARTTLS As Boolean = SupportsSTARTTLS(Client)