summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-03-02 10:43:57 +0000
committerDouwe Maan <douwe@gitlab.com>2016-03-02 10:43:57 +0000
commit8ec49e47ec7e8181ce4087f4b24008b0d07f7d9e (patch)
tree0870383139318f771c1368df95c5bd4a3fb41f95 /lib/tasks
parentc71c5876cbb66890c87de063982d671299c9dc8e (diff)
parent84473c75134cb9d151c3a2e5f572b77f910573f7 (diff)
downloadgitlab-ce-8ec49e47ec7e8181ce4087f4b24008b0d07f7d9e.tar.gz
Merge branch 'mail-room-config-without-rails' into 'master'
Don't load all of GitLab in mail_room Fixes #12731 cc @jacobvosmaer See merge request !3005
Diffstat (limited to 'lib/tasks')
-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