Fix: Find mailbox with cc email (#4372)
This commit is contained in:
@@ -21,17 +21,20 @@ class ApplicationMailbox < ActionMailbox::Base
|
||||
def self.support_mail?
|
||||
proc do |inbound_mail_obj|
|
||||
is_a_support_email = false
|
||||
inbound_mail_obj.mail.to&.each do |email|
|
||||
channel = Channel::Email.find_by('lower(email) = ? OR lower(forward_to_email) = ?', email.downcase, email.downcase)
|
||||
if channel.present?
|
||||
is_a_support_email = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
is_a_support_email = true if reply_to_mail?(inbound_mail_obj, is_a_support_email)
|
||||
|
||||
is_a_support_email
|
||||
end
|
||||
end
|
||||
|
||||
def self.reply_to_mail?(inbound_mail_obj, is_a_support_email)
|
||||
return if is_a_support_email
|
||||
|
||||
channel = EmailChannelFinder.new(inbound_mail_obj.mail).perform
|
||||
channel.present?
|
||||
end
|
||||
|
||||
def self.catch_all_mail?
|
||||
proc { |_mail| true }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user