##// END OF EJS Templates
add support for pop3s (SSL) to redmine:email:receive_pop3 (#16707)...
Toshi MARUYAMA -
r12863:eaac0eff082e
parent child
Show More
@@ -21,8 +21,20 module Redmine
21 module POP3
21 module POP3
22 class << self
22 class << self
23 def check(pop_options={}, options={})
23 def check(pop_options={}, options={})
24 if pop_options[:ssl]
25 ssl = true
26 if pop_options[:ssl] == 'force'
27 Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
28 else
29 Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_PEER)
30 end
31 else
32 ssl = false
33 end
34
24 host = pop_options[:host] || '127.0.0.1'
35 host = pop_options[:host] || '127.0.0.1'
25 port = pop_options[:port] || '110'
36 port = pop_options[:port]
37 port ||= ssl ? '995' : '110'
26 apop = (pop_options[:apop].to_s == '1')
38 apop = (pop_options[:apop].to_s == '1')
27 delete_unprocessed = (pop_options[:delete_unprocessed].to_s == '1')
39 delete_unprocessed = (pop_options[:delete_unprocessed].to_s == '1')
28
40
@@ -138,6 +138,7 Available POP3 options:
138 username=USERNAME POP3 account
138 username=USERNAME POP3 account
139 password=PASSWORD POP3 password
139 password=PASSWORD POP3 password
140 apop=1 use APOP authentication (default: false)
140 apop=1 use APOP authentication (default: false)
141 ssl=SSL Use SSL? (default: false)
141 delete_unprocessed=1 delete messages that could not be processed
142 delete_unprocessed=1 delete messages that could not be processed
142 successfully from the server (default
143 successfully from the server (default
143 behaviour is to leave them on the server)
144 behaviour is to leave them on the server)
@@ -149,6 +150,7 END_DESC
149 pop_options = {:host => ENV['host'],
150 pop_options = {:host => ENV['host'],
150 :port => ENV['port'],
151 :port => ENV['port'],
151 :apop => ENV['apop'],
152 :apop => ENV['apop'],
153 :ssl => ENV['ssl'],
152 :username => ENV['username'],
154 :username => ENV['username'],
153 :password => ENV['password'],
155 :password => ENV['password'],
154 :delete_unprocessed => ENV['delete_unprocessed']}
156 :delete_unprocessed => ENV['delete_unprocessed']}
General Comments 0
You need to be logged in to leave comments. Login now