module Sisimai::Reason::NoRelaying

Sisimai::Reason::NoRelaying checks the bounce reason is “norelaying” or not. This class is called only Sisimai::Reason class.

This is the error that SMTP connection rejected with error message “Relaying Denied”. This reason does not exist in any version of bounceHammer.

... while talking to mailin-01.mx.example.com.:
>>> RCPT To:<kijitora@example.org>
<<< 554 5.7.1 <kijitora@example.org>: Relay access denied
554 5.0.0 Service unavailable

Constants

Index

Public Class Methods

description() click to toggle source
# File lib/sisimai/reason/norelaying.rb, line 37
def description; return 'Email rejected with error message "Relaying Denied"'; end
match(argv1) click to toggle source

Try to match that the given text and regular expressions @param [String] argv1 String to be matched with regular expressions @return [True,False] false: Did not match

true: Matched
# File lib/sisimai/reason/norelaying.rb, line 43
def match(argv1)
  return nil unless argv1
  return true if Index.any? { |a| argv1.include?(a) }
  return false
end
text() click to toggle source
# File lib/sisimai/reason/norelaying.rb, line 36
def text; return 'norelaying'; end
true(argvs) click to toggle source

Whether the message is rejected by 'Relaying denied' @param [Sisimai::Data] argvs Object to be detected the reason @return [True,False] true: Rejected for “relaying denied”

false: is not

@see www.ietf.org/rfc/rfc2822.txt

# File lib/sisimai/reason/norelaying.rb, line 54
def true(argvs)
  r = argvs.reason || ''
  if r.size > 0
    # Do not overwrite the reason
    return false if r.start_with?('securityerror', 'systemerror', 'undefined')
  else
    # Check the value of Diagnosic-Code: header with patterns
    return true if match(argvs.diagnosticcode.downcase)
  end
  return false
end