From e1baa48584011772e6068a076e2f11ffaee88970 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 29 Feb 2016 11:04:40 +0100 Subject: Fix `gitlab:incoming_email:check` task. --- lib/tasks/gitlab/check.rake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/tasks') 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 -- cgit v1.2.1