Commit deb62183 authored by Douwe Maan's avatar Douwe Maan

Merge branch '1363-redo-mailroom-support' into 'master'

Redo internals of Incoming Mail Support

See merge request !9385
parents 7af8bb26 649a1fcf
...@@ -333,7 +333,7 @@ gem 'newrelic_rpm', '~> 3.16' ...@@ -333,7 +333,7 @@ gem 'newrelic_rpm', '~> 3.16'
gem 'octokit', '~> 4.6.2' gem 'octokit', '~> 4.6.2'
gem 'mail_room', '~> 0.9.0' gem 'mail_room', '~> 0.9.1'
gem 'email_reply_trimmer', '~> 0.1' gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text' gem 'html2text'
......
...@@ -408,7 +408,7 @@ GEM ...@@ -408,7 +408,7 @@ GEM
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
mail (2.6.4) mail (2.6.4)
mime-types (>= 1.16, < 4) mime-types (>= 1.16, < 4)
mail_room (0.9.0) mail_room (0.9.1)
memoist (0.15.0) memoist (0.15.0)
method_source (0.8.2) method_source (0.8.2)
mime-types (2.99.3) mime-types (2.99.3)
...@@ -909,7 +909,7 @@ DEPENDENCIES ...@@ -909,7 +909,7 @@ DEPENDENCIES
license_finder (~> 2.1.0) license_finder (~> 2.1.0)
licensee (~> 8.0.0) licensee (~> 8.0.0)
loofah (~> 2.0.3) loofah (~> 2.0.3)
mail_room (~> 0.9.0) mail_room (~> 0.9.1)
method_source (~> 0.8) method_source (~> 0.8)
minitest (~> 5.7.0) minitest (~> 5.7.0)
mousetrap-rails (~> 1.4.6) mousetrap-rails (~> 1.4.6)
......
---
title: Redo internals of Incoming Mail Support
merge_request: 9385
author:
# If you change this file in a Merge Request, please also create
# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
:mailboxes: :mailboxes:
<% <%
require_relative "lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom) require_relative "../lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom)
config = Gitlab::MailRoom.config config = Gitlab::MailRoom.config
if Gitlab::MailRoom.enabled? if Gitlab::MailRoom.enabled?
......
...@@ -724,8 +724,11 @@ namespace :gitlab do ...@@ -724,8 +724,11 @@ namespace :gitlab do
def check_imap_authentication def check_imap_authentication
print "IMAP server credentials are correct? ... " print "IMAP server credentials are correct? ... "
config_path = Rails.root.join('config', 'mail_room.yml') config_path = Rails.root.join('config', 'mail_room.yml').to_s
config_file = YAML.load(ERB.new(File.read(config_path)).result) erb = ERB.new(File.read(config_path))
erb.filename = config_path
config_file = YAML.load(erb.result)
config = config_file[:mailboxes].first config = config_file[:mailboxes].first
if config if config
......
...@@ -8,7 +8,7 @@ describe 'mail_room.yml' do ...@@ -8,7 +8,7 @@ describe 'mail_room.yml' do
context 'when incoming email is disabled' do context 'when incoming email is disabled' do
before do before do
ENV['MAIL_ROOM_GITLAB_CONFIG_FILE'] = Rails.root.join('spec/fixtures/mail_room_disabled.yml').to_s ENV['MAIL_ROOM_GITLAB_CONFIG_FILE'] = Rails.root.join('spec/fixtures/config/mail_room_disabled.yml').to_s
Gitlab::MailRoom.reset_config! Gitlab::MailRoom.reset_config!
end end
...@@ -26,7 +26,7 @@ describe 'mail_room.yml' do ...@@ -26,7 +26,7 @@ describe 'mail_room.yml' do
let(:gitlab_redis) { Gitlab::Redis.new(Rails.env) } let(:gitlab_redis) { Gitlab::Redis.new(Rails.env) }
before do before do
ENV['MAIL_ROOM_GITLAB_CONFIG_FILE'] = Rails.root.join('spec/fixtures/mail_room_enabled.yml').to_s ENV['MAIL_ROOM_GITLAB_CONFIG_FILE'] = Rails.root.join('spec/fixtures/config/mail_room_enabled.yml').to_s
Gitlab::MailRoom.reset_config! Gitlab::MailRoom.reset_config!
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