Welcome to mirror list, hosted at ThFree Co, Russian Federation.

service_desk_email.rb « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f8dba82cb406a6deed158446e6525548e45be0d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Gitlab
  module ServiceDeskEmail
    class << self
      def enabled?
        !!config&.enabled && config&.address.present?
      end

      def key_from_address(address)
        wildcard_address = config&.address
        return unless wildcard_address

        Gitlab::IncomingEmail.key_from_address(address, wildcard_address: wildcard_address)
      end

      def config
        Gitlab.config.service_desk_email
      end
    end
  end
end