Module: Sisimai::Reason::SecurityError

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

Overview

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

This is the error that a security violation was detected on a destination mail server. Depends on the security policy on the server, a sender’s email address is camouflaged address.

Sisimai will set “securityerror” to the reason of email bounce if the value of Status: field in a bounce email is “5.7.*”.

Action: failed
Status: 5.7.1
Remote-MTA: DNS; gmail-smtp-in.l.google.com
Diagnostic-Code: SMTP; 552-5.7.0 Our system detected an illegal attachment on your message. Please
Last-Attempt-Date: Tue, 28 Apr 2009 11:02:45 +0900 (JST)

Constant Summary collapse

Index =
[
  "account not subscribed to ses",
  "authentication credentials invalid",
  "authentication failure",
  "authentication required",
  "authentication turned on in your email client",
  "could not retrieve credentials", # OpenSMTPD/smtpd/mta.c
  "unauthenticated senders not allowed",
  "verification failure",
  "you are not authorized to send mail, authentication is required",
  "you don't authenticate or the domain isn't in my list of allowed rcpthosts",
].freeze
Pairs =
[
  ["authentication failed; server ", " said: "], # Postfix
  ["authentification invalide", "305"],
  ["authentification requise", "402"],
  ["user ", " is not authorized to perform ses:sendrawemail on resource"],
].freeze

Class Method Summary collapse

Class Method Details

.descriptionObject



40
# File 'lib/sisimai/reason/securityerror.rb', line 40

def description; return 'Email rejected due to security violation was detected on a destination host'; 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



45
46
47
48
49
50
# File 'lib/sisimai/reason/securityerror.rb', line 45

def match(argv1)
  return false if argv1.nil? || argv1.empty?
  return true  if Index.any? { |a| argv1.include?(a) }
  return true  if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
  return false
end

.textObject



39
# File 'lib/sisimai/reason/securityerror.rb', line 39

def text; return 'securityerror'; end

.true(_argvs) ⇒ Boolean

The bounce reason is SecurityError or not

Parameters:

Returns:

  • (Boolean)

    true: is security error false: is not security error

See Also:



57
# File 'lib/sisimai/reason/securityerror.rb', line 57

def true(_argvs); return false; end