Module: Sisimai::Reason::BadReputation

Defined in:
lib/sisimai/reason/badreputation.rb

Overview

Sisimai::Reason::BadReputation checks the bounce reason is "BadReputation" or not. This class is called only Sisimai::Reason class.

This is the error that an email rejected due to a reputation score of the sender IP address.

Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [192.0.2.22] Our system has detected that this message is
               likely suspicious due to the very low reputation of the sending IP address.
               To best protect our users from spam, the message has been blocked. Please
               visit https://support.google.com/mail/answer/188131 for more information.

Constant Summary collapse

Index =
[
  "has been temporarily rate limited due to ip reputation",
  "ip/domain reputation problems",
  "likely suspicious due to the very low reputation",
  "none/bad reputation", # t-online.de
  "poor email reputation score",
  "sending mta's poor reputation",
  "temporarily deferred due to unexpected volume or user complaints", # Yahoo Inc.
].freeze

Class Method Summary collapse

Class Method Details

.descriptionObject



28
# File 'lib/sisimai/reason/badreputation.rb', line 28

def description; return 'Email rejected due to an IP address reputation'; end

.match(argv1) ⇒ Boolean

Try to match that the given text and regular expressions

Parameters:

  • argv1 (String)

    String to be matched with regular expressions

Returns:

  • (Boolean)

    false: Did not match, true: Matched



33
34
35
36
37
# File 'lib/sisimai/reason/badreputation.rb', line 33

def match(argv1)
  return false if argv1.nil? || argv1.empty?
  return true  if Index.any? { |a| argv1.include?(a) }
  return false
end

.textObject



27
# File 'lib/sisimai/reason/badreputation.rb', line 27

def text; return Sisimai::Eb::ReFAMA; end

.true(argvs) ⇒ Boolean

The bounce reason is "BadReputation" or not

Parameters:

Returns:

  • (Boolean)

    true: is BadReputation, false: is not BadReputation

See Also:



43
44
45
46
# File 'lib/sisimai/reason/badreputation.rb', line 43

def true(argvs)
  return true if argvs['reason'] == Sisimai::Eb::ReFAMA
  return match(argvs['diagnosticcode'].downcase)
end