1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-09 09:01:31 +00:00

IMAP STARTTLS support (#16823).

Patch by Jan Pipek.

git-svn-id: http://svn.redmine.org/redmine/trunk@13950 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2015-01-27 20:54:45 +00:00
parent c7eb67b403
commit 1184e50ee8
2 changed files with 7 additions and 1 deletions

View File

@ -24,9 +24,13 @@ module Redmine
host = imap_options[:host] || '127.0.0.1'
port = imap_options[:port] || '143'
ssl = !imap_options[:ssl].nil?
starttls = !imap_options[:tls].nil?
folder = imap_options[:folder] || 'INBOX'
imap = Net::IMAP.new(host, port, ssl)
if starttls
imap.starttls
end
imap.login(imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?
imap.select(folder)
imap.uid_search(['NOT', 'SEEN']).each do |uid|

View File

@ -77,7 +77,8 @@ General options:
Available IMAP options:
host=HOST IMAP server host (default: 127.0.0.1)
port=PORT IMAP server port (default: 143)
ssl=SSL Use SSL? (default: false)
ssl=SSL Use SSL/TLS? (default: false)
starttls=STARTTLS Use STARTTLS? (default: false)
username=USERNAME IMAP account
password=PASSWORD IMAP password
folder=FOLDER IMAP folder to read (default: INBOX)
@ -118,6 +119,7 @@ END_DESC
imap_options = {:host => ENV['host'],
:port => ENV['port'],
:ssl => ENV['ssl'],
:starttls => ENV['starttls'],
:username => ENV['username'],
:password => ENV['password'],
:folder => ENV['folder'],