summaryrefslogtreecommitdiff
path: root/lib/system_check/incoming_email/foreman_configured_check.rb
blob: 1db7bf2b78221abac8b74432e5d9007a04cc27e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module SystemCheck
  module IncomingEmail
    class ForemanConfiguredCheck < SystemCheck::BaseCheck
      set_name 'Foreman configured correctly?'

      def check?
        path = Rails.root.join('Procfile')

        File.exist?(path) && File.read(path) =~ /^mail_room:/
      end

      def show_error
        try_fixing_it(
          'Enable mail_room in your Procfile.'
        )
        for_more_information(
          'doc/administration/reply_by_email.md'
        )
        fix_and_rerun
      end
    end
  end
end