@@ -21,8 +21,20 module Redmine | |||
|
21 | 21 | module POP3 |
|
22 | 22 | class << self |
|
23 | 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 | 35 | host = pop_options[:host] || '127.0.0.1' |
|
25 |
port = pop_options[:port] |
|
|
36 | port = pop_options[:port] | |
|
37 | port ||= ssl ? '995' : '110' | |
|
26 | 38 | apop = (pop_options[:apop].to_s == '1') |
|
27 | 39 | delete_unprocessed = (pop_options[:delete_unprocessed].to_s == '1') |
|
28 | 40 |
@@ -138,6 +138,7 Available POP3 options: | |||
|
138 | 138 | username=USERNAME POP3 account |
|
139 | 139 | password=PASSWORD POP3 password |
|
140 | 140 | apop=1 use APOP authentication (default: false) |
|
141 | ssl=SSL Use SSL? (default: false) | |
|
141 | 142 | delete_unprocessed=1 delete messages that could not be processed |
|
142 | 143 | successfully from the server (default |
|
143 | 144 | behaviour is to leave them on the server) |
@@ -149,6 +150,7 END_DESC | |||
|
149 | 150 | pop_options = {:host => ENV['host'], |
|
150 | 151 | :port => ENV['port'], |
|
151 | 152 | :apop => ENV['apop'], |
|
153 | :ssl => ENV['ssl'], | |
|
152 | 154 | :username => ENV['username'], |
|
153 | 155 | :password => ENV['password'], |
|
154 | 156 | :delete_unprocessed => ENV['delete_unprocessed']} |
General Comments 0
You need to be logged in to leave comments.
Login now