diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-05-16 08:28:52 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-05-16 08:28:52 +0000 |
commit | eaac0eff082e14fe5b87f1c9c2845e4077e1fbed (patch) | |
tree | 2b8b7932a755fab2259018cbdb0b761b37e6873d /lib/redmine/pop3.rb | |
parent | 6080a4cae38e29a849648323c7cfb576bb3bf81f (diff) | |
download | redmine-eaac0eff082e14fe5b87f1c9c2845e4077e1fbed.tar.gz redmine-eaac0eff082e14fe5b87f1c9c2845e4077e1fbed.zip |
add support for pop3s (SSL) to redmine:email:receive_pop3 (#16707)
Contributed by Eric Davis.
git-svn-id: http://svn.redmine.org/redmine/trunk@13138 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/pop3.rb')
-rw-r--r-- | lib/redmine/pop3.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/redmine/pop3.rb b/lib/redmine/pop3.rb index fcedb5003..3c7eb9595 100644 --- a/lib/redmine/pop3.rb +++ b/lib/redmine/pop3.rb @@ -21,8 +21,20 @@ module Redmine module POP3 class << self def check(pop_options={}, options={}) + if pop_options[:ssl] + ssl = true + if pop_options[:ssl] == 'force' + Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_NONE) + else + Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_PEER) + end + else + ssl = false + end + host = pop_options[:host] || '127.0.0.1' - port = pop_options[:port] || '110' + port = pop_options[:port] + port ||= ssl ? '995' : '110' apop = (pop_options[:apop].to_s == '1') delete_unprocessed = (pop_options[:delete_unprocessed].to_s == '1') |