Commit b05dc46f authored by charlie ablett's avatar charlie ablett

Merge branch 'john_long-support-multiple-mailbox-email-check' into 'master'

Support multiple mailboxes incoming email check

See merge request gitlab-org/gitlab!35639
parents a8ba6a0d e7eb15bd
---
title: Support multiple mailboxes incoming email check
merge_request: 35639
author:
type: fixed
...@@ -28,9 +28,12 @@ module SystemCheck ...@@ -28,9 +28,12 @@ module SystemCheck
private private
def try_connect_imap def try_connect_imap
imap = Net::IMAP.new(config[:host], port: config[:port], ssl: config[:ssl]) config.each do |mailbox|
imap.starttls if config[:start_tls] $stdout.puts "Checking #{mailbox[:email]}"
imap.login(config[:email], config[:password]) imap = Net::IMAP.new(mailbox[:host], port: mailbox[:port], ssl: mailbox[:ssl])
imap.starttls if mailbox[:start_tls]
imap.login(mailbox[:email], mailbox[:password])
end
true true
rescue => error rescue => error
@error = error @error = error
...@@ -51,7 +54,7 @@ module SystemCheck ...@@ -51,7 +54,7 @@ module SystemCheck
erb.filename = mail_room_config_path erb.filename = mail_room_config_path
config_file = YAML.load(erb.result) config_file = YAML.load(erb.result)
config_file.dig(:mailboxes, 0) config_file[:mailboxes]
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment