debian-mirror-gitlab/lib/gitlab/email/service_desk_receiver.rb

24 lines
512 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
module Gitlab
module Email
class ServiceDeskReceiver < Receiver
private
def find_handler(mail)
key = service_desk_key(mail)
return unless key
Gitlab::Email::Handler::ServiceDeskHandler.new(mail, nil, service_desk_key: key)
end
def service_desk_key(mail)
mail.to.find do |address|
key = ::Gitlab::ServiceDeskEmail.key_from_address(address)
break key if key
end
end
end
end
end