sisimai 5.5.0-java → 5.7.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake-test.yml +0 -4
  3. data/ChangeLog.md +53 -0
  4. data/LICENSE +1 -1
  5. data/README-JA.md +26 -20
  6. data/README.md +30 -25
  7. data/lib/sisimai/address.rb +8 -31
  8. data/lib/sisimai/arf.rb +3 -5
  9. data/lib/sisimai/fact.rb +26 -36
  10. data/lib/sisimai/lhost/activehunter.rb +0 -2
  11. data/lib/sisimai/lhost/amazonses.rb +7 -9
  12. data/lib/sisimai/lhost/apachejames.rb +0 -1
  13. data/lib/sisimai/lhost/biglobe.rb +0 -16
  14. data/lib/sisimai/lhost/courier.rb +5 -4
  15. data/lib/sisimai/lhost/deutschetelekom.rb +120 -0
  16. data/lib/sisimai/lhost/domino.rb +0 -3
  17. data/lib/sisimai/lhost/dragonfly.rb +0 -27
  18. data/lib/sisimai/lhost/einsundeins.rb +1 -10
  19. data/lib/sisimai/lhost/exchange2003.rb +4 -4
  20. data/lib/sisimai/lhost/exchange2007.rb +5 -6
  21. data/lib/sisimai/lhost/exim.rb +35 -85
  22. data/lib/sisimai/lhost/ezweb.rb +12 -49
  23. data/lib/sisimai/lhost/fml.rb +4 -29
  24. data/lib/sisimai/lhost/gmail.rb +0 -23
  25. data/lib/sisimai/lhost/gmx.rb +7 -24
  26. data/lib/sisimai/lhost/googlegroups.rb +3 -3
  27. data/lib/sisimai/lhost/googleworkspace.rb +0 -4
  28. data/lib/sisimai/lhost/imailserver.rb +3 -9
  29. data/lib/sisimai/lhost/kddi.rb +6 -20
  30. data/lib/sisimai/lhost/mailfoundry.rb +0 -2
  31. data/lib/sisimai/lhost/mailmarshal.rb +1 -3
  32. data/lib/sisimai/lhost/messagingserver.rb +4 -15
  33. data/lib/sisimai/lhost/mfilter.rb +0 -1
  34. data/lib/sisimai/lhost/mimecast.rb +0 -1
  35. data/lib/sisimai/lhost/notes.rb +1 -2
  36. data/lib/sisimai/lhost/opensmtpd.rb +0 -40
  37. data/lib/sisimai/lhost/postfix.rb +10 -11
  38. data/lib/sisimai/lhost/qmail.rb +14 -81
  39. data/lib/sisimai/lhost/sendmail.rb +4 -4
  40. data/lib/sisimai/lhost/trendmicro.rb +3 -3
  41. data/lib/sisimai/lhost/v5sendmail.rb +0 -1
  42. data/lib/sisimai/lhost/verizon.rb +1 -2
  43. data/lib/sisimai/lhost/x1.rb +1 -2
  44. data/lib/sisimai/lhost/x2.rb +0 -2
  45. data/lib/sisimai/lhost/x3.rb +4 -9
  46. data/lib/sisimai/lhost/x6.rb +0 -1
  47. data/lib/sisimai/lhost/zoho.rb +0 -12
  48. data/lib/sisimai/lhost.rb +38 -19
  49. data/lib/sisimai/message.rb +3 -1
  50. data/lib/sisimai/order.rb +4 -1
  51. data/lib/sisimai/reason/authfailure.rb +9 -13
  52. data/lib/sisimai/reason/badreputation.rb +7 -7
  53. data/lib/sisimai/reason/blocked.rb +57 -83
  54. data/lib/sisimai/reason/contenterror.rb +16 -8
  55. data/lib/sisimai/reason/{mesgtoobig.rb → emailtoolarge.rb} +22 -25
  56. data/lib/sisimai/reason/expired.rb +27 -23
  57. data/lib/sisimai/reason/filtered.rb +13 -17
  58. data/lib/sisimai/reason/hasmoved.rb +2 -1
  59. data/lib/sisimai/reason/hostunknown.rb +25 -19
  60. data/lib/sisimai/reason/mailboxfull.rb +28 -49
  61. data/lib/sisimai/reason/networkerror.rb +28 -16
  62. data/lib/sisimai/reason/norelaying.rb +21 -20
  63. data/lib/sisimai/reason/notaccept.rb +13 -8
  64. data/lib/sisimai/reason/notcompliantrfc.rb +6 -9
  65. data/lib/sisimai/reason/policyviolation.rb +17 -26
  66. data/lib/sisimai/reason/ratelimited.rb +62 -0
  67. data/lib/sisimai/reason/rejected.rb +51 -59
  68. data/lib/sisimai/reason/requireptr.rb +13 -25
  69. data/lib/sisimai/reason/securityerror.rb +14 -19
  70. data/lib/sisimai/reason/spamdetected.rb +51 -101
  71. data/lib/sisimai/reason/suspend.rb +30 -24
  72. data/lib/sisimai/reason/syntaxerror.rb +1 -8
  73. data/lib/sisimai/reason/systemerror.rb +37 -23
  74. data/lib/sisimai/reason/systemfull.rb +1 -1
  75. data/lib/sisimai/reason/userunknown.rb +81 -112
  76. data/lib/sisimai/reason/virusdetected.rb +6 -8
  77. data/lib/sisimai/reason.rb +15 -15
  78. data/lib/sisimai/rfc1123.rb +1 -1
  79. data/lib/sisimai/rfc1894.rb +7 -6
  80. data/lib/sisimai/rfc2045.rb +2 -2
  81. data/lib/sisimai/rfc3464/thirdparty.rb +1 -1
  82. data/lib/sisimai/rfc3464.rb +10 -14
  83. data/lib/sisimai/rfc3834.rb +3 -4
  84. data/lib/sisimai/rfc791.rb +3 -38
  85. data/lib/sisimai/rhost/apple.rb +5 -5
  86. data/lib/sisimai/rhost/cloudflare.rb +2 -0
  87. data/lib/sisimai/rhost/cox.rb +22 -20
  88. data/lib/sisimai/rhost/facebook.rb +16 -16
  89. data/lib/sisimai/rhost/franceptt.rb +8 -3
  90. data/lib/sisimai/rhost/godaddy.rb +33 -15
  91. data/lib/sisimai/rhost/google.rb +63 -64
  92. data/lib/sisimai/rhost/iua.rb +1 -1
  93. data/lib/sisimai/rhost/messagelabs.rb +12 -12
  94. data/lib/sisimai/rhost/microsoft.rb +86 -86
  95. data/lib/sisimai/rhost/mimecast.rb +34 -34
  96. data/lib/sisimai/rhost/nttdocomo.rb +2 -2
  97. data/lib/sisimai/rhost/spectrum.rb +7 -7
  98. data/lib/sisimai/rhost/tencent.rb +9 -11
  99. data/lib/sisimai/rhost/yahooinc.rb +7 -8
  100. data/lib/sisimai/rhost.rb +1 -1
  101. data/lib/sisimai/smtp/command.rb +2 -0
  102. data/lib/sisimai/smtp/status.rb +73 -109
  103. data/lib/sisimai/string.rb +0 -27
  104. data/lib/sisimai/version.rb +1 -1
  105. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-01.eml +66 -0
  106. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-02.eml +68 -0
  107. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-03.eml +50 -0
  108. data/set-of-emails/should-not-crash/p5-664-iomart-mail-filter.eml +258 -0
  109. data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/.gitkeep +0 -0
  110. metadata +10 -6
  111. data/lib/sisimai/reason/exceedlimit.rb +0 -47
  112. data/lib/sisimai/reason/speeding.rb +0 -47
  113. data/lib/sisimai/reason/toomanyconn.rb +0 -59
@@ -10,109 +10,59 @@ module Sisimai
10
10
  # Last-Attempt-Date: Thu, 9 Apr 2008 23:34:45 +0900 (JST)
11
11
  module SpamDetected
12
12
  class << self
13
- require 'sisimai/string'
14
-
15
13
  Index = [
16
- ' - spam',
17
- '//www.spamhaus.org/help/help_spam_16.htm',
18
- '//dsbl.org/help/help_spam_16.htm',
19
- '//mail.163.com/help/help_spam_16.htm',
20
- '554 5.7.0 reject, id=',
21
- 'appears to be unsolicited',
22
- 'blacklisted url in message',
23
- 'block for spam',
24
- 'blocked by policy: no spam please',
25
- 'blocked by spamassassin', # rejected by SpamAssassin
26
- 'blocked for abuse. see http://att.net/blocks', # AT&T
27
- 'cannot be forwarded because it was detected as spam',
28
- 'considered unsolicited bulk e-mail (spam) by our mail filters',
29
- 'content filter rejection',
30
- 'cyberoam anti spam engine has identified this email as a bulk email',
31
- 'denied due to spam list',
32
- 'high probability of spam',
33
- 'is classified as spam and is rejected',
34
- 'listed in work.drbl.imedia.ru',
35
- 'the mail server detected your message as spam and has prevented delivery.', # CPanel/Exim with SA rejections on
36
- 'mail appears to be unsolicited', # rejected due to spam
37
- 'mail content denied', # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726
38
- 'may consider spam',
39
- 'message considered as spam or virus',
40
- 'message contains spam or virus',
41
- 'message content rejected',
42
- 'message detected as spam',
43
- 'message filtered',
44
- 'message filtered. please see the faqs section on spam',
45
- 'message filtered. refer to the troubleshooting page at ',
46
- 'message looks like spam',
47
- 'message is being rejected as it seems to be a spam',
48
- 'message refused by mailmarshal spamprofiler',
49
- 'message refused by trustwave seg spamprofiler',
50
- 'message rejected as spam',
51
- 'message rejected because of unacceptable content',
52
- 'message rejected due to suspected spam content',
53
- 'message rejected for policy reasons',
54
- 'message was rejected for possible spam/virus content',
55
- 'our email server thinks this email is spam',
56
- 'our system has detected that this message is ',
57
- 'probable spam',
58
- 'reject bulk.advertising',
59
- 'rejected: spamassassin score ',
60
- 'rejected - bulk email',
61
- 'rejecting banned content',
62
- 'rejecting mail content',
63
- 'related to content with spam-like characteristics',
64
- 'sender domain listed at ',
65
- 'sending address not accepted due to spam filter',
66
- 'spam blocked',
67
- 'spam check',
68
- 'spam content matched',
69
- 'spam detected',
70
- 'spam email',
71
- 'spam email not accepted',
72
- 'spam message rejected.', # mail.ru
73
- 'spam not accepted',
74
- 'spam refused',
75
- 'spam rejection',
76
- 'spam score ',
77
- 'spambouncer identified spam', # SpamBouncer identified SPAM
78
- 'spamming not allowed',
79
- 'too many spam complaints',
80
- 'too much spam.', # Earthlink
81
- 'the email message was detected as spam',
82
- 'the message has been rejected by spam filtering engine',
83
- 'the message was rejected due to classification as bulk mail',
84
- 'the content of this message looked like spam', # SendGrid
85
- 'this message appears to be spam',
86
- 'this message has been identified as spam',
87
- 'this message has been scored as spam with a probability',
88
- 'this message was classified as spam',
89
- 'this message was rejected by recurrent pattern detection system',
90
- 'transaction failed spam message not queued', # SendGrid
91
- 'we dont accept spam',
92
- 'your email appears similar to spam we have received before',
93
- 'your email breaches local uribl policy',
94
- 'your email had spam-like ',
95
- 'your email is considered spam',
96
- 'your email is probably spam',
97
- 'your email was detected as spam',
98
- 'your message as spam and has prevented delivery',
99
- 'your message has been temporarily blocked by our filter',
100
- 'your message has been rejected because it appears to be spam',
101
- 'your message has triggered a spam block',
102
- 'your message may contain the spam contents',
103
- 'your message failed several antispam checks',
14
+ "blacklisted url in message",
15
+ "block for spam",
16
+ "blocked by policy: no spam please",
17
+ "blocked by spamassassin", # rejected by SpamAssassin
18
+ "classified as spam and is rejected",
19
+ "content filter rejection",
20
+ "denied due to spam list",
21
+ "identified spam", # 554 SpamBouncer identified SPAM, message permanently rejected (#5.3.0)
22
+ "may consider spam",
23
+ "message content rejected",
24
+ "message has been temporarily blocked by our filter",
25
+ "message is being rejected as it seems to be a spam",
26
+ "message was rejected by recurrent pattern detection system",
27
+ "our email server thinks this email is spam",
28
+ "reject bulk.advertising",
29
+ "spam check",
30
+ "spam content ",
31
+ "spam detected",
32
+ "spam email",
33
+ "spam-like header",
34
+ "spam message",
35
+ "spam not accepted",
36
+ "spam refused",
37
+ "spamming not allowed",
38
+ "unsolicited ",
39
+ "your email breaches local uribl policy",
104
40
  ].freeze
105
41
  Pairs = [
106
- ['greylisted', ' please try again in'],
107
- ['mail score (', ' over '],
108
- ['mail rejete. mail rejected. ', '506'],
109
- ['our filters rate at and above ', ' percent probability of being spam'],
110
- ['rejected by ', ' (spam)'],
111
- ['rejected due to spam ', 'classification'],
112
- ['rejected due to spam ', 'content'],
113
- ['rule imposed as ', ' is blacklisted on'],
114
- ['spam ', ' exceeded'],
115
- ['this message scored ', ' spam points'],
42
+ ["accept", " spam"],
43
+ ["appears", " to ", "spam"],
44
+ ["bulk", "mail"],
45
+ ["considered", " spam"],
46
+ ["contain", " spam"],
47
+ ["detected", " spam"],
48
+ ["greylisted", " please try again in"],
49
+ ["mail score (", " over "],
50
+ ["mail rejete. mail rejected. ", "506"],
51
+ ["message ", "as spam"],
52
+ ["message ", "like spam"],
53
+ ["message ", "spamprofiler"],
54
+ ["probab", " spam"],
55
+ ["refused by", " spamprofiler"],
56
+ ["reject", " content"],
57
+ ["reject, id=", "spam"],
58
+ ["rejected by ", " (spam)"],
59
+ ["rejected due to spam ", "classification"],
60
+ ["rule imposed as ", " is blacklisted on"],
61
+ ["score", "spam"],
62
+ ["spam ", "block"],
63
+ ["spam ", "filter"],
64
+ ["spam ", " exceeded"],
65
+ ["spam ", "score"],
116
66
  ].freeze
117
67
 
118
68
  def text; return 'spamdetected'; end
@@ -141,7 +91,7 @@ module Sisimai
141
91
  # The value of "reason" isn't "spamdetected" when the value of "command" is an SMTP command
142
92
  # to be sent before the SMTP DATA command because all the MTAs read the headers and the
143
93
  # entire message body after the DATA command.
144
- return false if %w[CONN EHLO HELO MAIL RCPT].include?(argvs['command'])
94
+ return false if Sisimai::SMTP::Command::ExceptDATA.include?(argvs['command'])
145
95
  return match(argvs['diagnosticcode'].downcase)
146
96
  end
147
97
 
@@ -6,30 +6,35 @@ module Sisimai
6
6
  module Suspend
7
7
  class << self
8
8
  Index = [
9
- ' is currently suspended',
10
- ' temporary locked',
11
- 'archived recipient',
12
- 'boite du destinataire archivee',
13
- 'email account that you tried to reach is disabled',
14
- 'has been suspended',
15
- 'inactive account',
16
- 'invalid/inactive user',
17
- 'is a deactivated mailbox', # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000742
18
- 'is unavailable: user is terminated',
19
- 'mailbox currently suspended',
20
- 'mailbox disabled',
21
- 'mailbox is frozen',
22
- 'mailbox unavailable or access denied',
23
- 'recipient rejected: temporarily inactive',
24
- 'recipient suspend the service',
25
- "the email account that you tried to reach is inactive",
26
- 'this account has been disabled or discontinued',
27
- 'this account has been temporarily suspended',
28
- 'this address no longer accepts mail',
29
- 'this mailbox is disabled',
30
- 'user or domain is disabled',
31
- 'user suspended', # http://mail.163.com/help/help_spam_16.htm
32
- 'vdelivermail: account is locked email bounced',
9
+ " currently suspended",
10
+ " temporary locked",
11
+ "address no longer accepts mail",
12
+ "archived recipient",
13
+ "boite du destinataire archivee",
14
+ "email account that you tried to reach is inactive",
15
+ "inactive account",
16
+ "inactivity new mail is not currently being accepted for this mailbox",
17
+ "invalid/inactive user",
18
+ "is a deactivated mailbox", # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000742
19
+ "is unavailable: user is terminated",
20
+ "mailbox is frozen",
21
+ "mailbox is inactive",
22
+ "mailbox unavailable or access denied",
23
+ "recipient rejected: temporarily inactive",
24
+ "recipient suspend the service",
25
+ "temporarily unavailable user",
26
+ "user is no longer with ",
27
+ "user or domain is disabled",
28
+ "user suspended", # http://mail.163.com/help/help_spam_16.htm
29
+ "vdelivermail: account is locked email bounced",
30
+ ].freeze
31
+ Pairs = [
32
+ ["account ", "disabled"],
33
+ ["account ", "limited"],
34
+ ["has been ", "suspended"],
35
+ ["mailaddress ", "disabled"],
36
+ ["mailbox ", "disabled"],
37
+ ["not ", "active"],
33
38
  ].freeze
34
39
 
35
40
  def text; return 'suspend'; end
@@ -41,6 +46,7 @@ module Sisimai
41
46
  def match(argv1)
42
47
  return false if argv1.nil? || argv1.empty?
43
48
  return true if Index.any? { |a| argv1.include?(a) }
49
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
44
50
  return false
45
51
  end
46
52
 
@@ -22,14 +22,7 @@ module Sisimai
22
22
  # false: is not syntax error
23
23
  # @since 4.1.25
24
24
  # @see http://www.ietf.org/rfc/rfc2822.txt
25
- def true(argvs)
26
- return true if argvs['reason'] == 'syntaxerror'
27
-
28
- reply = argvs['replycode'].to_i
29
- return true if reply > 400 && reply < 408 || reply > 500 && reply < 508
30
- return false
31
- end
32
-
25
+ def true(argvs); return false; end
33
26
  end
34
27
  end
35
28
  end
@@ -9,33 +9,47 @@ module Sisimai
9
9
  # message has been in the queue too long.
10
10
  module SystemError
11
11
  class << self
12
- require 'sisimai/string'
13
12
  Index = [
14
- 'aliasing/forwarding loop broken',
13
+ "aliasing/forwarding loop broken",
14
+ "automatic homedir creator crashed", # qmail-ldap-1.03-20040101.patch:19817 - 19866
15
15
  "can't create user output file",
16
- 'could not load drd for domain',
17
- 'internal error reading data', # Microsoft
18
- 'internal server error: operation now in progress', # Microsoft
19
- 'interrupted system call',
20
- 'it encountered an error while being processed',
21
- 'it would create a mail loop',
22
- 'local configuration error',
23
- 'local error in processing',
24
- 'loop was found in the mail exchanger',
25
- 'loops back to myself',
26
- 'mail system configuration error',
27
- 'queue file write error',
28
- 'recipient deferred because there is no mdb',
29
- 'remote server is misconfigured',
30
- 'server configuration error',
31
- 'service currently unavailable',
32
- 'system config error',
33
- 'temporary local problem',
34
- 'timeout waiting for input',
35
- 'transaction failed ',
16
+ "cannot send e-mail to yourself",
17
+ "could not load ",
18
+ "delivery to file forbidden", # Exim/deliver.c:5614
19
+ "delivery to pipe forbidden", # Exim/deliver.c:5624
20
+ "input/output error",
21
+ "interrupted system call",
22
+ "it encountered an error while being processed",
23
+ "it would create a mail loop",
24
+ "ldap attribute", # qmail-ldap-1.03-20040101.patch:19817 - 19866
25
+ "ldap lookup", # qmail-ldap-1.03-20040101.patch:19817 - 19866
26
+ "ldap server", # qmail-ldap-1.03-20040101.patch:19817 - 19866
27
+ "lmtp error after ", # Exim/transports/lmtp.c:186
28
+ "local delivery failed", # Exim/transports/pipe.c:1156
29
+ "loop back warning:", # FML
30
+ "loop was found in the mail exchanger",
31
+ "loops back to myself",
32
+ "mail transport unavailable",
33
+ "may cause mail loop", # FML
34
+ "no such file or directory",
35
+ "error while executing qmail-forward", # qmail-ldap-1.03-20040101.patch:19817 - 19866
36
+ "queue file write error",
37
+ "recipient deferred because there is no mdb",
38
+ "remote server is misconfigured",
39
+ "service currently unavailable",
40
+ "several matches found in domino directory", # Donimo
41
+ "temporary local problem",
42
+ "timeout waiting for input",
43
+ "too many results returned but needs to be unique", # qmail-ldap-1.03-20040101.patch:19817 - 19866
44
+ "transaction failed ",
36
45
  ].freeze
37
46
  Pairs = [
38
- ['unable to connect ', 'daemon'],
47
+ ["config", " error"],
48
+ ["fml ", "has detected a loop condition so that"], # FML
49
+ ["internal ", "error"],
50
+ ["local ", "error"],
51
+ ["proxy", "broken pipe"],
52
+ ["unable to connect ", "daemon"],
39
53
  ].freeze
40
54
 
41
55
  def text; return 'systemerror'; end
@@ -9,8 +9,8 @@ module Sisimai
9
9
  module SystemFull
10
10
  class << self
11
11
  Index = [
12
+ 'exceeded storage allocation', # MS Exchange
12
13
  'mail system full',
13
- 'requested mail action aborted: exceeded storage allocation', # MS Exchange
14
14
  ].freeze
15
15
 
16
16
  def text; return 'systemfull'; end
@@ -14,8 +14,6 @@ module Sisimai
14
14
  # RCPT TO command)
15
15
  module UserUnknown
16
16
  class << self
17
- require 'sisimai/string'
18
-
19
17
  PreMatches = %w[NoRelaying Blocked MailboxFull HasMoved Rejected NotAccept]
20
18
  ModulePath = {
21
19
  'Sisimai::Reason::NoRelaying' => 'sisimai/reason/norelaying',
@@ -26,119 +24,89 @@ module Sisimai
26
24
  'Sisimai::Reason::NotAccept' => 'sisimai/reason/notaccept',
27
25
  }
28
26
  Index = [
29
- '#5.1.1 bad address',
30
- '550 address invalid',
31
- '5.1.0 address rejected.',
32
- 'address does not exist',
33
- 'address not present in directory',
34
- 'address unknown',
27
+ "#5.1.1 bad address",
28
+ "550 address invalid",
29
+ "5.1.0 address rejected.",
30
+ "address not present in directory",
31
+ "address unknown",
32
+ "badrcptto",
35
33
  "can't accept user",
36
- 'does not exist.',
37
- 'destination addresses were unknown',
38
- 'destination server rejected recipients',
39
- 'email address does not exist',
40
- 'email address could not be found',
41
- 'invalid address',
42
- 'invalid mailbox',
43
- 'invalid mailbox path',
44
- 'invalid recipient',
45
- 'is not a known user',
46
- 'is not a valid mailbox',
47
- 'is not an active address at this host',
48
- 'mailbox does not exist',
49
- 'mailbox invalid',
50
- 'mailbox is inactive',
51
- 'mailbox is unavailable',
52
- 'mailbox not present',
53
- 'mailbox not found',
54
- 'mailbox unavaiable',
55
- 'nessun utente simile in questo indirizzo',
56
- 'no account by that name here',
57
- 'no existe dicha persona',
58
- 'no existe ese usuario ',
59
- 'no mail box available for this user',
60
- 'no mailbox by that name is currently available',
61
- 'no mailbox found',
62
- 'no such address here',
63
- 'no such mailbox',
64
- 'no such person at this address',
65
- 'no such recipient',
66
- 'no such user',
67
- 'no thank you rejected: account unavailable',
68
- 'no valid recipients, bye',
69
- 'not a valid recipient',
70
- 'not a valid user here',
71
- 'not a local address',
72
- 'not email addresses',
73
- 'recipient address rejected. (in reply to rcpt to command)',
74
- 'recipient address rejected: access denied',
75
- 'recipient address rejected: invalid user',
76
- 'recipient address rejected: invalid-recipient',
77
- 'recipient address rejected: unknown user',
78
- 'recipient address rejected: userunknown',
79
- 'recipient does not exist',
80
- 'recipient is not accepted',
81
- 'recipient is not local',
82
- 'recipient not exist',
83
- 'recipient not found',
84
- 'recipient not ok',
85
- 'recipient refuses to accept your mail',
86
- 'recipient unknown',
87
- 'requested action not taken: mailbox unavailable',
88
- 'resolver.adr.recipient notfound',
89
- 'sorry, user unknown',
90
- 'sorry, badrcptto',
91
- 'sorry, no mailbox here by that name',
92
- 'sorry, your envelope recipient has been denied',
93
- "that domain or user isn't in my list of allowed rcpthosts",
94
- 'the email account that you tried to reach does not exist',
95
- 'the following recipients was undeliverable',
96
- "the user's email name is not found",
97
- 'there is no one at this address',
98
- 'this address no longer accepts mail',
99
- 'this email address is wrong or no longer valid',
100
- 'this recipient is in my badrecipientto list',
101
- 'this recipient is not in my validrcptto list',
102
- 'this spectator does not exist',
103
- 'unknown mailbox',
104
- 'unknown recipient',
105
- 'unknown user',
106
- 'user does not exist',
107
- 'user missing home directory',
108
- 'user not active',
109
- 'user not exist',
110
- 'user not found',
111
- 'user not known',
112
- 'user unknown',
113
- 'utilisateur inconnu !',
114
- 'vdeliver: invalid or unknown virtual user',
115
- 'weil die adresse nicht gefunden wurde oder keine e-mails empfangen kann',
116
- 'your envelope recipient is in my badrcptto list',
34
+ "destination addresses were unknown",
35
+ "destination server rejected recipients",
36
+ "domain or user isn't in my list of allowed rcpthosts",
37
+ "email account that you tried to reach does not exist",
38
+ "email address could not be found",
39
+ "invalid address",
40
+ "invalid mailbox",
41
+ "is not a known user",
42
+ "is not a valid mailbox",
43
+ "mailbox does not exist",
44
+ "mailbox invalid",
45
+ "mailbox not present",
46
+ "mailbox not found",
47
+ "nessun utente simile in questo indirizzo",
48
+ "no account by that name here",
49
+ "no existe dicha persona",
50
+ "no existe ese usuario ",
51
+ "no such recipient",
52
+ "no such user",
53
+ "no thank you rejected: account unavailable",
54
+ "no valid recipients, bye",
55
+ "not a valid recipient",
56
+ "not a valid user here",
57
+ "not a local address",
58
+ "not email addresses",
59
+ "recipient address rejected. (in reply to rcpt to command)",
60
+ "recipient address rejected: access denied",
61
+ "recipient address rejected: userunknown",
62
+ "recipient is in my badrecipientto list",
63
+ "recipient is not accepted",
64
+ "recipient is not in my validrcptto list",
65
+ "recipient is not local",
66
+ "recipient not ok",
67
+ "recipient refuses to accept your mail",
68
+ "recipient unknown",
69
+ "recipients was undeliverable",
70
+ "spectator does not exist",
71
+ "there is no one at this address",
72
+ "unknown mailbox",
73
+ "unknown recipient",
74
+ "unknown user",
75
+ "user missing home directory",
76
+ "user not known",
77
+ "user unknown",
78
+ "utilisateur inconnu !",
79
+ "weil die adresse nicht gefunden wurde oder keine e-mails empfangen kann",
80
+ "your envelope recipient has been denied",
117
81
  ].freeze
118
82
  Pairs = [
119
- ['<', '> not found'],
120
- ['<', '>... blocked by '],
121
- ['account ', ' does not exist at the organization'],
122
- ['adresse d au moins un destinataire invalide. invalid recipient.', '416'],
123
- ['adresse d au moins un destinataire invalide. invalid recipient.', '418'],
124
- ['bad', 'recipient'],
125
- ['mailbox ', 'does not exist'],
126
- ['mailbox ', 'unavailable or access denied'],
127
- ['no ', ' in name directory'],
128
- ['non', 'existent user'],
129
- ['rcpt <', ' does not exist'],
130
- ['rcpt (', 't exist '],
131
- ['recipient ', ' was not found in'],
132
- ['recipient address rejected: user ', ' does not exist'],
133
- ['recipient address rejected: user unknown in ', ' table'],
134
- ['said: 550-5.1.1 ', ' user unknown '],
135
- ['said: 550 5.1.1 ', ' user unknown '],
83
+ ["<", "> not found"],
84
+ ["<", ">... blocked by "],
85
+ ["account ", " does not exist at the organization"],
86
+ ["address", " no longer"],
87
+ ["address", " not exist"],
88
+ ["bad", "recipient"],
89
+ ["invalid", "recipient"],
90
+ ["invalid", "user"],
91
+ ["mailbox ", "does not exist"],
92
+ ["mailbox ", "unavailable"],
93
+ ["no ", " in name directory"],
94
+ ["no ", "mail", "box "],
95
+ ["no ", "such", "address"],
96
+ ["non", "existent user"],
97
+ ["rcpt <", " does not exist"],
98
+ ["rcpt (", "t exist "],
99
+ ["recipient no", "found"],
100
+ ["recipient ", " not exist"],
101
+ ["recipient ", " was not found in"],
136
102
  ["this user doesn't have a ", " account"],
137
- ['unknown e', 'mail address'],
138
- ['unknown local', 'part'],
139
- ['user ', ' was not found'],
140
- ['user ', ' does not exist'],
141
- ['user (', ') unknown'],
103
+ ["unknown e", "mail address"],
104
+ ["unknown local", "part"],
105
+ ["user ", " not exist"],
106
+ ["user ", "doesn't exist"],
107
+ ["user ", "not found"],
108
+ ["user (", ") unknown"],
109
+ ["user <", "> unknown"],
142
110
  ].freeze
143
111
 
144
112
  def text; return 'userunknown'; end
@@ -160,7 +128,8 @@ module Sisimai
160
128
  # false: is not unknown user.
161
129
  # @see http://www.ietf.org/rfc/rfc2822.txt
162
130
  def true(argvs)
163
- return true if argvs['reason'] == 'userunknown'
131
+ return true if argvs['reason'] == 'userunknown'
132
+ return false if Sisimai::SMTP::Command::BeforeRCPT.include?(argvs['command'])
164
133
 
165
134
  tempreason = Sisimai::SMTP::Status.name(argvs['deliverystatus'])
166
135
  return false if tempreason == 'suspend'
@@ -14,13 +14,10 @@ module Sisimai
14
14
  #
15
15
  module VirusDetected
16
16
  class << self
17
- Index = [
18
- 'it has a potentially executable attachment',
19
- 'the message was rejected because it contains prohibited virus or spam content',
20
- 'this form of attachment has been used by recent viruses or other malware',
21
- 'virus detected',
22
- 'virus phishing/malicious_url detected',
23
- 'your message was infected with a virus',
17
+ Index = ["it has a potentially executable attachment"].freeze
18
+ Pairs = [
19
+ ["message was ", "ected", " virus"],
20
+ ["virus", " detected"],
24
21
  ].freeze
25
22
 
26
23
  def text; return 'virusdetected'; end
@@ -33,6 +30,7 @@ module Sisimai
33
30
  def match(argv1)
34
31
  return false if argv1.nil? || argv1.empty?
35
32
  return true if Index.any? { |a| argv1.include?(a) }
33
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
36
34
  return false
37
35
  end
38
36
 
@@ -47,7 +45,7 @@ module Sisimai
47
45
  # to be sent before the SMTP DATA command because all the MTAs read the headers and the
48
46
  # entire message body after the DATA command.
49
47
  return true if argvs['reason'] == 'virusdetected'
50
- return false if %w[CONN EHLO HELO MAIL RCPT].include?(argvs['command'])
48
+ return false if Sisimai::SMTP::Command::ExceptDATA.include?(argvs['command'])
51
49
  return match(argvs['diagnosticcode'].downcase)
52
50
  end
53
51