1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-02 15:31:49 +00:00

add support for pop3s (SSL) to redmine📧receive_pop3 (#16707)

Contributed by Eric Davis.

git-svn-id: http://svn.redmine.org/redmine/trunk@13138 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-05-16 08:28:52 +00:00
parent 6080a4cae3
commit eaac0eff08
2 changed files with 15 additions and 1 deletions

View File

@ -21,8 +21,20 @@ module Redmine
module POP3 module POP3
class << self class << self
def check(pop_options={}, options={}) 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' 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') apop = (pop_options[:apop].to_s == '1')
delete_unprocessed = (pop_options[:delete_unprocessed].to_s == '1') delete_unprocessed = (pop_options[:delete_unprocessed].to_s == '1')

View File

@ -138,6 +138,7 @@ Available POP3 options:
username=USERNAME POP3 account username=USERNAME POP3 account
password=PASSWORD POP3 password password=PASSWORD POP3 password
apop=1 use APOP authentication (default: false) apop=1 use APOP authentication (default: false)
ssl=SSL Use SSL? (default: false)
delete_unprocessed=1 delete messages that could not be processed delete_unprocessed=1 delete messages that could not be processed
successfully from the server (default successfully from the server (default
behaviour is to leave them on the server) behaviour is to leave them on the server)
@ -149,6 +150,7 @@ END_DESC
pop_options = {:host => ENV['host'], pop_options = {:host => ENV['host'],
:port => ENV['port'], :port => ENV['port'],
:apop => ENV['apop'], :apop => ENV['apop'],
:ssl => ENV['ssl'],
:username => ENV['username'], :username => ENV['username'],
:password => ENV['password'], :password => ENV['password'],
:delete_unprocessed => ENV['delete_unprocessed']} :delete_unprocessed => ENV['delete_unprocessed']}