diff --git a/app/models/channel/filter/identify_sender.rb b/app/models/channel/filter/identify_sender.rb index c324abae7..a5833fcf9 100644 --- a/app/models/channel/filter/identify_sender.rb +++ b/app/models/channel/filter/identify_sender.rb @@ -112,8 +112,6 @@ module Channel::Filter::IdentifySender display_name = nil if recipient =~ /.*<(.+?)>/ address = $1 - elsif recipient =~ /<(.+?)>/ - address = $1 end if recipient =~ /^(.+?)<(.+?)>/ display_name = $1 diff --git a/app/models/channel/filter/monitoring_base.rb b/app/models/channel/filter/monitoring_base.rb index 08eecf563..27c8282b7 100644 --- a/app/models/channel/filter/monitoring_base.rb +++ b/app/models/channel/filter/monitoring_base.rb @@ -47,7 +47,10 @@ class Channel::Filter::MonitoringBase # follow up detection by meta data open_states = Ticket::State.by_category(:open) - Ticket.where(state: open_states).each { |ticket| + ticket_ids = Ticket.where(state: open_states).order(created_at: :desc).limit(5000).pluck(:id) + ticket_ids.each { |ticket_id| + ticket = Ticket.find_by(id: ticket_id) + next if !ticket next if !ticket.preferences next if !ticket.preferences['integration'] next if ticket.preferences['integration'] != integration