FIX: POP3 doesn't work with TLS 1.3

FIX: POP3 doesn’t work with TLS 1.3

diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb
index 9bf10f9..80b858a 100644
--- a/app/jobs/scheduled/poll_mailbox.rb
+++ b/app/jobs/scheduled/poll_mailbox.rb
@@ -34,7 +34,7 @@ module Jobs
 
       if SiteSetting.pop3_polling_ssl
         if SiteSetting.pop3_polling_openssl_verify
-          pop3.enable_ssl
+          pop3.enable_ssl(max_version: OpenSSL::SSL::TLS1_2_VERSION)
         else
           pop3.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
         end
diff --git a/lib/tasks/emails.rake b/lib/tasks/emails.rake
index 73be734..9eb9250 100644
--- a/lib/tasks/emails.rake
+++ b/lib/tasks/emails.rake
@@ -37,7 +37,7 @@ task "emails:import" => :environment do
 
     mails_left = 1
     pop3 = Net::POP3.new(address, port)
-    pop3.enable_ssl if ssl
+    pop3.enable_ssl(max_version: OpenSSL::SSL::TLS1_2_VERSION) if ssl
 
     while mails_left > 0
       pop3.start(username, password) do |pop|

GitHub sha: 56c6e8e9

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: