Module: Sisimai::Reason::NotCompliantRFC

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

Overview

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

This is the error that an email is not compliant RFC 5322 or other email related RFCs. For example, there are multiple "Subject" headers in the email.

Constant Summary collapse

Index =
[
  "duplicate header",
  "duplicated message-id",
  "message is not rfc 5322 compliant",
  "multiple addresses in from: header are not accepted",
  "rfc 1035 violation",
  "https://support.google.com/mail/?p=rfcmessagenoncompliant",
].freeze

Class Method Summary collapse

Class Method Details

.descriptionObject



21
# File 'lib/sisimai/reason/notcompliantrfc.rb', line 21

def description; return 'Email rejected due to non-compliance with RFC'; 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



26
27
28
29
30
# File 'lib/sisimai/reason/notcompliantrfc.rb', line 26

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

.textObject



20
# File 'lib/sisimai/reason/notcompliantrfc.rb', line 20

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

.true(argvs) ⇒ Boolean

Whether the email is RFC compliant or not

Parameters:

Returns:

  • (Boolean)

    true: RFC comliant false: Is not RFC compliant

See Also:



37
38
39
40
# File 'lib/sisimai/reason/notcompliantrfc.rb', line 37

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