Skip to content

Commit

Permalink
Allow IMAP4 email receiving to skip SSL certificate verification with…
Browse files Browse the repository at this point in the history
… `ssl=force` option (#41738).

Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23415 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
vividtone committed Dec 20, 2024
1 parent 02bd5c1 commit 3d51645
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/redmine/imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ class << self
def check(imap_options={}, options={})
host = imap_options[:host] || '127.0.0.1'
port = imap_options[:port] || '143'
ssl = !imap_options[:ssl].nil?
if imap_options[:ssl]
if imap_options[:ssl] == 'force'
ssl = {verify_mode: OpenSSL::SSL::VERIFY_NONE}
else
ssl = {verify_mode: OpenSSL::SSL::VERIFY_PEER}
end
else
ssl = false
end
starttls = !imap_options[:starttls].nil?
folder = imap_options[:folder] || 'INBOX'

Expand Down
2 changes: 2 additions & 0 deletions lib/tasks/email.rake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Available IMAP options:
host=HOST IMAP server host (default: 127.0.0.1)
port=PORT IMAP server port (default: 143)
ssl=SSL Use SSL/TLS? (default: false)
Setting `ssl=force` disables server certificate
verification
starttls=STARTTLS Use STARTTLS? (default: false)
username=USERNAME IMAP account
password=PASSWORD IMAP password
Expand Down

0 comments on commit 3d51645

Please sign in to comment.