Module: Sisimai::Reason::VirusDetected
- Defined in:
- lib/sisimai/reason/virusdetected.rb
Overview
Sisimai::Reason::VirusDetected checks the bounce reason is “virusdetected” or not. This class is called only Sisimai::Reason class.
This is an error that any virus or trojan horse detected in the message by a virus scanner program at a destination mail server. This reason has been divided from “securityerror” at Sisimai 4.22.0.
Your message was infected with a virus. You should download a virus
scanner and check your computer for viruses.
Sender: <sironeko@libsisimai.org>
Recipient: <kijitora@example.jp>
Constant Summary collapse
- Index =
["it has a potentially executable attachment"].freeze
- Pairs =
[ ["message was ", "ected", " virus"], ["virus", " detected"], ].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
The bounce reason is “virusdetected” or not.
Class Method Details
.description ⇒ Object
24 |
# File 'lib/sisimai/reason/virusdetected.rb', line 24 def description; return 'Email rejected due to a virus scanner on a destination host'; end |
.match(argv1) ⇒ Boolean
Try to match that the given text and regular expressions
30 31 32 33 34 35 |
# File 'lib/sisimai/reason/virusdetected.rb', line 30 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 |
.text ⇒ Object
23 |
# File 'lib/sisimai/reason/virusdetected.rb', line 23 def text; return 'virusdetected'; end |
.true(argvs) ⇒ Boolean
The bounce reason is “virusdetected” or not
43 44 45 46 47 48 49 50 |
# File 'lib/sisimai/reason/virusdetected.rb', line 43 def true(argvs) # The value of "reason" isn't "visusdetected" when the value of "command" is an SMTP command # to be sent before the SMTP DATA command because all the MTAs read the headers and the # entire message body after the DATA command. return true if argvs['reason'] == 'virusdetected' return false if Sisimai::SMTP::Command::ExceptDATA.include?(argvs['command']) return match(argvs['diagnosticcode'].downcase) end |