summaryrefslogtreecommitdiff
path: root/lib/tasks/gitlab
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-02-29 11:04:40 +0100
committerDouwe Maan <douwe@selenight.nl>2016-02-29 11:04:40 +0100
commite1baa48584011772e6068a076e2f11ffaee88970 (patch)
tree31303cb1869789d326dc12894feee320c4e8f132 /lib/tasks/gitlab
parentbbdb9ba0361496d04d211c2a6f75c94e7df9d8f7 (diff)
downloadgitlab-ce-e1baa48584011772e6068a076e2f11ffaee88970.tar.gz
Fix `gitlab:incoming_email:check` task.
Diffstat (limited to 'lib/tasks/gitlab')
-rw-r--r--lib/tasks/gitlab/check.rake10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index d59872dc3a2..581ab26db79 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -728,13 +728,15 @@ namespace :gitlab do
def check_imap_authentication
print "IMAP server credentials are correct? ... "
- config = Gitlab.config.incoming_email
+ config_path = Rails.root.join('config', 'mail_room.yml')
+ config_file = YAML.load(ERB.new(File.read(config_path)).result)
+ config = config_file[:mailboxes].first
if config
begin
- imap = Net::IMAP.new(config.host, port: config.port, ssl: config.ssl)
- imap.starttls if config.start_tls
- imap.login(config.user, config.password)
+ imap = Net::IMAP.new(config[:host], port: config[:port], ssl: config[:ssl])
+ imap.starttls if config[:start_tls]
+ imap.login(config[:email], config[:password])
connected = true
rescue
connected = false