Module: Sisimai::Reason::HasMoved
- Defined in:
- lib/sisimai/reason/hasmoved.rb
Overview
Sisimai::Reason::HasMoved checks the bounce reason is “hasmoved” or not. This class is called only Sisimai::Reason class.
This is the error that a user’s mailbox has moved (and is not forwarded automatically). Sisimai will set “hasmoved” to the reason of email bounce if the value of Status: field in a bounce email is “5.1.6”.
Constant Summary collapse
- Index =
[' has been replaced by '].freeze
Class Method Summary collapse
- .description ⇒ Object
-
.match(argv1) ⇒ Boolean
Try to match that the given text and regular expressions.
- .text ⇒ Object
-
.true(argvs) ⇒ Boolean
Whether the address has moved or not.
Class Method Details
.description ⇒ Object
14 |
# File 'lib/sisimai/reason/hasmoved.rb', line 14 def description; return "Email rejected due to user's mailbox has moved and is not forwarded automatically"; end |
.match(argv1) ⇒ Boolean
Try to match that the given text and regular expressions
19 20 21 22 23 |
# File 'lib/sisimai/reason/hasmoved.rb', line 19 def match(argv1) return false if argv1.nil? || argv1.empty? return true if Index.any? { |a| argv1.include?(a) } return false end |
.text ⇒ Object
13 |
# File 'lib/sisimai/reason/hasmoved.rb', line 13 def text; return 'hasmoved'; end |
.true(argvs) ⇒ Boolean
Whether the address has moved or not
30 31 32 33 34 |
# File 'lib/sisimai/reason/hasmoved.rb', line 30 def true(argvs) return true if argvs['reason'] == 'hasmoved' return false if Sisimai::SMTP::Command::BeforeRCPT.include?(argvs['command']) return match(argvs['diagnosticcode'].downcase) end |