diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php index 840f0c996..3b94ba020 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php @@ -153,8 +153,10 @@ class ImapClient extends \MailSo\Net\NetClient // $encrypted = !empty(\stream_get_meta_data($this->ConnectionResource())['crypto']); $type = $this->IsSupported('LOGINDISABLED') ? '' : 'LOGIN'; // RFC3501 6.2.3 $types = [ -// 'SCRAM-SHA-256' => 1, // !$encrypted -// 'SCRAM-SHA-1' => 1, // !$encrypted + // if !$encrypted: +// 'SCRAM-SHA-256' => 1, +// 'SCRAM-SHA-1' => 1, + // if $encrypted: 'CRAM-MD5' => $aCredentials['UseAuthCramMd5IfSupported'], 'PLAIN' => $aCredentials['UseAuthPlainIfSupported'], 'OAUTHBEARER' => $aCredentials['UseAuthOAuth2IfSupported'], diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php index 74ef0836a..69e350e6a 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Smtp/SmtpClient.php @@ -125,8 +125,10 @@ class SmtpClient extends \MailSo\Net\NetClient // $encrypted = !empty(\stream_get_meta_data($this->ConnectionResource())['crypto']); $type = ''; $types = [ - 'SCRAM-SHA-256' => 1, // !$encrypted - 'SCRAM-SHA-1' => 1, // !$encrypted + // if !$encrypted: + 'SCRAM-SHA-256' => 1, + 'SCRAM-SHA-1' => 1, + // if $encrypted: 'CRAM-MD5' => $aCredentials['UseAuthCramMd5IfSupported'], 'PLAIN' => $aCredentials['UseAuthPlainIfSupported'], 'OAUTHBEARER' => $aCredentials['UseAuthOAuth2IfSupported'], diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php index a96876d10..02ec64105 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Account.php @@ -364,59 +364,6 @@ class Account $bResult = $aCredentials['UseAuth'] && $oClient->Login($aCredentials); $oPlugins->RunHook("{$client_name}.after-login", array($this, $oClient, $bResult, $aCredentials)); return $bResult; - -/* -// $encrypted = !empty(\stream_get_meta_data($oClient->ConnectionResource())['crypto']); - $type = $oClient->IsSupported('LOGINDISABLED') ? '' : 'LOGIN'; // RFC3501 6.2.3 - $types = [ -// 'SCRAM-SHA-256' => 1, // !$encrypted -// 'SCRAM-SHA-1' => 1, // !$encrypted - 'CRAM-MD5' => $aSmtpCredentials['UseAuthCramMd5IfSupported'], - 'PLAIN' => $aSmtpCredentials['UseAuthPlainIfSupported'], - 'OAUTHBEARER' => $aSmtpCredentials['UseAuthOAuth2IfSupported'], - 'XOAUTH2' => $aSmtpCredentials['UseAuthOAuth2IfSupported'], - 'LOGIN' => 1, - ]; - foreach ($types as $sasl_type => $active) { - if ($active && $oClient->IsSupported("AUTH={$sasl_type}") && \SnappyMail\SASL::isSupported($sasl_type)) { - $type = $sasl_type; - break; - } - } - - $SASL = \SnappyMail\SASL::factory($type); - $SASL->base64 = true; - -// $oClient->Login($SASL); -*/ -/* -// $encrypted = !empty(\stream_get_meta_data($oClient->ConnectionResource())['crypto']); - $type = ''; - $types = [ - 'SCRAM-SHA-256' => 1, // !$encrypted - 'SCRAM-SHA-1' => 1, // !$encrypted - 'CRAM-MD5' => $bUseAuthCramMd5IfSupported, - 'PLAIN' => $bUseAuthPlainIfSupported, - 'LOGIN' => 1, // $encrypted - 'XOAUTH2' => 0 - ]; - foreach ($types as $sasl_type => $active) { - if ($active && $oClient->IsAuthSupported($sasl_type) && \SnappyMail\SASL::isSupported($sasl_type)) { - $type = $sasl_type; - break; - } - } - - if (!$type) { - \trigger_error("SMTP {$oClient->GetConnectedHost()} no supported AUTH options. Disable login" . ($oClient->IsSupported('STARTTLS') ? ' or try with STARTTLS' : '')); - $oClient->writeLogException( - new \MailSo\Smtp\Exceptions\LoginBadMethodException, - \MailSo\Log\Enumerations\Type::NOTICE, true); - } - - $SASL = \SnappyMail\SASL::factory($type); - $SASL->base64 = true; -*/ } }