From 78ff7485c57482eae265fb8580a5c09a760d1789 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 24 Jun 2024 12:02:26 -0500 Subject: [PATCH] No more spam cooldown Since "spam" is a false positive so often at this point --- sgx_jmp.rb | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 6c5dee843ed89c9cb094776f4e38cdf58431ffcc..32df4997b3b8d58dd7a968485a81d41b9943db46 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -265,12 +265,6 @@ before( from: /(\A|@)#{FROM_BACKEND}(\/|\Z)/ ) { |iq| halt if IQ_MANAGER.fulfill(iq) } -SPAM_ERRS = [ - "rejected-spam-detected", - "destination-spam-detected", - "destination-rejected-due-to-spam-detection" -].freeze - before nil, to: /\Acustomer_/, from: /(\A|@)#{FROM_BACKEND}(\/|\Z)/ do |s| StatsD.increment("stanza_customer") @@ -278,17 +272,6 @@ before nil, to: /\Acustomer_/, from: /(\A|@)#{FROM_BACKEND}(\/|\Z)/ do |s| CustomerRepo.new(set_user: Sentry.method(:set_user)).find( s.to.node.delete_prefix("customer_") ).then do |customer| - if s.is_a?(Blather::Stanza::Message) && s.error? - err = Blather::StanzaError.import(s).text - if SPAM_ERRS.include?(err) - REDIS.setex( - "jmp_customer_spam_detected-#{customer.customer_id}", - 5 * 60, - err - ) - end - end - ReachabilityRepo::SMS.new .find(customer, s.from.node, stanza: s).then do |reach| reach.filter do