diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-01-27 20:54:45 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-01-27 20:54:45 +0000 |
commit | 1184e50ee8de587a8ce906acb7837c9f3dd996e7 (patch) | |
tree | f7264bf8e31a15e254aa10b982a4535f1747bee3 /lib/redmine/imap.rb | |
parent | c7eb67b4032c0afda51581cd45d2f9737f9abf90 (diff) | |
download | redmine-1184e50ee8de587a8ce906acb7837c9f3dd996e7.tar.gz redmine-1184e50ee8de587a8ce906acb7837c9f3dd996e7.zip |
IMAP STARTTLS support (#16823).
Patch by Jan Pipek.
git-svn-id: http://svn.redmine.org/redmine/trunk@13950 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/imap.rb')
-rw-r--r-- | lib/redmine/imap.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/redmine/imap.rb b/lib/redmine/imap.rb index 3fbc72d45..418066632 100644 --- a/lib/redmine/imap.rb +++ b/lib/redmine/imap.rb @@ -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| |