Add “pop3_polling_openssl_verify” setting to turn off TLS server certificate verification like “smtp_openssl_verify_mode”. Defaults to “true”, so it does not change current behavior.

This commit is contained in:
Andreas Motl 2016-11-11 21:59:15 +01:00
parent 3daba9351a
commit 43fd3ebd4a
3 changed files with 10 additions and 1 deletions

View File

@ -29,7 +29,14 @@ module Jobs
def poll_pop3
pop3 = Net::POP3.new(SiteSetting.pop3_polling_host, SiteSetting.pop3_polling_port)
pop3.enable_ssl if SiteSetting.pop3_polling_ssl
if SiteSetting.pop3_polling_ssl
if SiteSetting.pop3_polling_openssl_verify
pop3.enable_ssl
else
pop3.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
end
end
pop3.start(SiteSetting.pop3_polling_username, SiteSetting.pop3_polling_password) do |pop|
pop.delete_all do |p|

View File

@ -1248,6 +1248,7 @@ en:
manual_polling_enabled: "Push emails using the API for email replies."
pop3_polling_enabled: "Poll via POP3 for email replies."
pop3_polling_ssl: "Use SSL while connecting to the POP3 server. (Recommended)"
pop3_polling_openssl_verify: "Verify TLS server certificate (Default: enabled)"
pop3_polling_period_mins: "The period in minutes between checking the POP3 account for email. NOTE: requires restart."
pop3_polling_port: "The port to poll a POP3 account on."
pop3_polling_host: "The host to poll for email via POP3."

View File

@ -603,6 +603,7 @@ email:
default: false
validator: "POP3PollingEnabledSettingValidator"
pop3_polling_ssl: true
pop3_polling_openssl_verify: true
pop3_polling_period_mins: 5
pop3_polling_host: ''
pop3_polling_port: 995