Module: Sisimai::Reason::FailedSTARTTLS

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

Overview

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

Constant Summary collapse

Index =

Email delivery failed due to STARTTLS related problem

[
  'starttls is required to send mail',
  'tls required but not supported',   # SendGrid:the recipient mailserver does not support TLS or have a valid certificate
].freeze

Class Method Summary collapse

Class Method Details

.descriptionObject



16
# File 'lib/sisimai/reason/failedstarttls.rb', line 16

def description; return "Email delivery failed due to STARTTLS related problem"; 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



21
22
23
24
25
# File 'lib/sisimai/reason/failedstarttls.rb', line 21

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

.textObject



15
# File 'lib/sisimai/reason/failedstarttls.rb', line 15

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

.true(argvs) ⇒ Boolean

Email delivery failed due to STARTTLS related problem

Parameters:

Returns:

  • (Boolean)

    true: FailedSTARTTLS false: Not FailedSTARTTLS

See Also:



32
33
34
35
36
# File 'lib/sisimai/reason/failedstarttls.rb', line 32

def true(argvs)
  return true if argvs["reason"] == Sisimai::Eb::ReTTLS || argvs["command"] == Sisimai::Eb::CeTTLS
  return true if [523, 524, 538].index(argvs["replycode"].to_i)
  return match(argvs["diagnosticcode"].downcase)
end