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



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

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



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

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

.textObject



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

def text; return 'notcompliantrfc'; 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:



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

def true(argvs)
  return true if argvs['reason'] == 'notcompliantrfc'
  return match(argvs['diagnosticcode'].downcase)
end