Module: Sisimai::Rhost::IUA

Defined in:
lib/sisimai/rhost/iua.rb

Overview

Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument of find() method when the value of “rhost” of the object is “*.email.ua”. This class is called only Sisimai::Fact class.

Constant Summary collapse

ErrorCodes =
{
  # https://mail.i.ua/err/$(CODE)
  '1'  => 'norelaying',  # The use of SMTP as mail gate is forbidden.
  '2'  => 'userunknown', # User is not found.
  '3'  => 'suspend',     # Mailbox was not used for more than 3 months
  '4'  => 'mailboxfull', # Mailbox is full.
  '5'  => 'ratelimited', # Letter sending limit is exceeded.
  '6'  => 'norelaying',  # Use SMTP of your provider to send mail.
  '7'  => 'blocked',     # Wrong value if command HELO/EHLO parameter.
  '8'  => 'rejected',    # Couldn't check sender address.
  '9'  => 'blocked',     # IP-address of the sender is blacklisted.
  '10' => 'filtered',    # Not in the list Mail address management.
}.freeze

Class Method Summary collapse

Class Method Details

.find(argvs) ⇒ String

Detect bounce reason from www.i.ua/

Parameters:

Returns:



25
26
27
28
29
30
31
32
# File 'lib/sisimai/rhost/iua.rb', line 25

def find(argvs)
  return "" if argvs["diagnosticcode"].empty?
  issuedcode = argvs['diagnosticcode'].downcase
  codenumber = issuedcode.index('.i.ua/err/') > 0 ? issuedcode[issuedcode.index('/err/') + 5, 2] : 0
  codenumber = codenumber[0, 1] if codenumber.index('/') == 1

  return ErrorCodes[codenumber] || ''
end