sisimai 5.4.1-java → 5.6.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 (150) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codecovio.yml +1 -1
  3. data/.github/workflows/rake-test.yml +1 -1
  4. data/ChangeLog.md +56 -0
  5. data/LICENSE +1 -1
  6. data/Makefile +2 -4
  7. data/README-JA.md +29 -23
  8. data/README.md +30 -24
  9. data/lib/sisimai/address.rb +92 -44
  10. data/lib/sisimai/arf.rb +7 -8
  11. data/lib/sisimai/datetime.rb +2 -2
  12. data/lib/sisimai/fact/json.rb +1 -2
  13. data/lib/sisimai/fact/yaml.rb +1 -2
  14. data/lib/sisimai/fact.rb +76 -36
  15. data/lib/sisimai/lda.rb +2 -2
  16. data/lib/sisimai/lhost/activehunter.rb +4 -5
  17. data/lib/sisimai/lhost/amazonses.rb +4 -5
  18. data/lib/sisimai/lhost/apachejames.rb +2 -2
  19. data/lib/sisimai/lhost/biglobe.rb +6 -6
  20. data/lib/sisimai/lhost/courier.rb +7 -7
  21. data/lib/sisimai/lhost/domino.rb +6 -6
  22. data/lib/sisimai/lhost/dragonfly.rb +5 -5
  23. data/lib/sisimai/lhost/einsundeins.rb +5 -5
  24. data/lib/sisimai/lhost/exchange2003.rb +7 -7
  25. data/lib/sisimai/lhost/exchange2007.rb +5 -5
  26. data/lib/sisimai/lhost/exim.rb +13 -15
  27. data/lib/sisimai/lhost/ezweb.rb +3 -2
  28. data/lib/sisimai/lhost/fml.rb +9 -9
  29. data/lib/sisimai/lhost/gmail.rb +9 -9
  30. data/lib/sisimai/lhost/gmx.rb +3 -3
  31. data/lib/sisimai/lhost/googlegroups.rb +6 -7
  32. data/lib/sisimai/lhost/googleworkspace.rb +5 -6
  33. data/lib/sisimai/lhost/imailserver.rb +4 -4
  34. data/lib/sisimai/lhost/kddi.rb +4 -4
  35. data/lib/sisimai/lhost/mailfoundry.rb +3 -3
  36. data/lib/sisimai/lhost/{mailmarshalsmtp.rb → mailmarshal.rb} +5 -5
  37. data/lib/sisimai/lhost/messagingserver.rb +8 -8
  38. data/lib/sisimai/lhost/mfilter.rb +8 -4
  39. data/lib/sisimai/lhost/mimecast.rb +105 -0
  40. data/lib/sisimai/lhost/notes.rb +5 -5
  41. data/lib/sisimai/lhost/opensmtpd.rb +5 -5
  42. data/lib/sisimai/lhost/postfix.rb +38 -32
  43. data/lib/sisimai/lhost/qmail.rb +11 -11
  44. data/lib/sisimai/lhost/sendmail.rb +13 -13
  45. data/lib/sisimai/lhost/{interscanmss.rb → trendmicro.rb} +8 -9
  46. data/lib/sisimai/lhost/v5sendmail.rb +7 -7
  47. data/lib/sisimai/lhost/verizon.rb +3 -3
  48. data/lib/sisimai/lhost/x1.rb +7 -4
  49. data/lib/sisimai/lhost/x2.rb +40 -12
  50. data/lib/sisimai/lhost/x3.rb +3 -3
  51. data/lib/sisimai/lhost/x6.rb +2 -2
  52. data/lib/sisimai/lhost/zoho.rb +5 -5
  53. data/lib/sisimai/lhost.rb +18 -17
  54. data/lib/sisimai/mail/maildir.rb +4 -4
  55. data/lib/sisimai/mail/mbox.rb +4 -4
  56. data/lib/sisimai/mail/memory.rb +1 -1
  57. data/lib/sisimai/mail/stdin.rb +2 -2
  58. data/lib/sisimai/message.rb +36 -34
  59. data/lib/sisimai/order.rb +5 -4
  60. data/lib/sisimai/reason/authfailure.rb +10 -14
  61. data/lib/sisimai/reason/badreputation.rb +8 -8
  62. data/lib/sisimai/reason/blocked.rb +58 -83
  63. data/lib/sisimai/reason/contenterror.rb +15 -10
  64. data/lib/sisimai/reason/{mesgtoobig.rb → emailtoolarge.rb} +23 -26
  65. data/lib/sisimai/reason/expired.rb +17 -24
  66. data/lib/sisimai/reason/failedstarttls.rb +1 -1
  67. data/lib/sisimai/reason/filtered.rb +14 -18
  68. data/lib/sisimai/reason/hasmoved.rb +3 -2
  69. data/lib/sisimai/reason/hostunknown.rb +18 -21
  70. data/lib/sisimai/reason/mailboxfull.rb +28 -50
  71. data/lib/sisimai/reason/mailererror.rb +1 -1
  72. data/lib/sisimai/reason/networkerror.rb +17 -17
  73. data/lib/sisimai/reason/norelaying.rb +20 -20
  74. data/lib/sisimai/reason/notaccept.rb +7 -10
  75. data/lib/sisimai/reason/notcompliantrfc.rb +6 -10
  76. data/lib/sisimai/reason/policyviolation.rb +12 -28
  77. data/lib/sisimai/reason/ratelimited.rb +62 -0
  78. data/lib/sisimai/reason/rejected.rb +46 -58
  79. data/lib/sisimai/reason/requireptr.rb +14 -26
  80. data/lib/sisimai/reason/securityerror.rb +14 -20
  81. data/lib/sisimai/reason/spamdetected.rb +52 -102
  82. data/lib/sisimai/reason/suspend.rb +27 -24
  83. data/lib/sisimai/reason/systemerror.rb +20 -24
  84. data/lib/sisimai/reason/systemfull.rb +2 -2
  85. data/lib/sisimai/reason/userunknown.rb +82 -114
  86. data/lib/sisimai/reason/vacation.rb +1 -1
  87. data/lib/sisimai/reason/virusdetected.rb +7 -9
  88. data/lib/sisimai/reason.rb +26 -26
  89. data/lib/sisimai/rfc1123.rb +58 -18
  90. data/lib/sisimai/rfc1894.rb +6 -8
  91. data/lib/sisimai/rfc2045.rb +25 -13
  92. data/lib/sisimai/rfc3464/thirdparty.rb +2 -3
  93. data/lib/sisimai/rfc3464.rb +6 -6
  94. data/lib/sisimai/rfc3834.rb +18 -8
  95. data/lib/sisimai/rfc5322.rb +9 -9
  96. data/lib/sisimai/rfc791.rb +2 -2
  97. data/lib/sisimai/rhost/aol.rb +4 -1
  98. data/lib/sisimai/rhost/apple.rb +15 -11
  99. data/lib/sisimai/rhost/cloudflare.rb +2 -0
  100. data/lib/sisimai/rhost/cox.rb +31 -25
  101. data/lib/sisimai/rhost/facebook.rb +24 -18
  102. data/lib/sisimai/rhost/franceptt.rb +92 -38
  103. data/lib/sisimai/rhost/godaddy.rb +34 -7
  104. data/lib/sisimai/rhost/google.rb +69 -70
  105. data/lib/sisimai/rhost/gsuite.rb +1 -1
  106. data/lib/sisimai/rhost/iua.rb +1 -1
  107. data/lib/sisimai/rhost/kddi.rb +1 -1
  108. data/lib/sisimai/rhost/messagelabs.rb +160 -2
  109. data/lib/sisimai/rhost/microsoft.rb +154 -107
  110. data/lib/sisimai/rhost/mimecast.rb +64 -55
  111. data/lib/sisimai/rhost/nttdocomo.rb +70 -90
  112. data/lib/sisimai/rhost/outlook.rb +1 -1
  113. data/lib/sisimai/rhost/spectrum.rb +8 -8
  114. data/lib/sisimai/rhost/tencent.rb +12 -13
  115. data/lib/sisimai/rhost/yahooinc.rb +9 -10
  116. data/lib/sisimai/rhost/zoho.rb +72 -0
  117. data/lib/sisimai/rhost.rb +4 -3
  118. data/lib/sisimai/smtp/command.rb +4 -2
  119. data/lib/sisimai/smtp/reply.rb +11 -4
  120. data/lib/sisimai/smtp/status.rb +67 -98
  121. data/lib/sisimai/smtp/transcript.rb +3 -3
  122. data/lib/sisimai/string.rb +4 -23
  123. data/lib/sisimai/version.rb +1 -1
  124. data/lib/sisimai.rb +1 -1
  125. data/set-of-emails/maildir/bsd/lhost-exim-56.eml +40 -40
  126. data/set-of-emails/maildir/bsd/lhost-mfilter-05.eml +41 -0
  127. data/set-of-emails/maildir/bsd/lhost-mimecast-01.eml +46 -0
  128. data/set-of-emails/maildir/bsd/lhost-mimecast-02.eml +59 -0
  129. data/set-of-emails/maildir/bsd/lhost-postfix-79.eml +81 -0
  130. data/set-of-emails/maildir/bsd/lhost-postfix-80.eml +84 -0
  131. data/set-of-emails/maildir/bsd/lhost-x1-03.eml +26 -0
  132. data/set-of-emails/maildir/bsd/lhost-x1-04.eml +45 -0
  133. data/set-of-emails/maildir/bsd/lhost-x2-07.eml +30 -0
  134. data/set-of-emails/maildir/bsd/rfc3464-66.eml +170 -0
  135. data/set-of-emails/maildir/bsd/rfc3834-06.eml +59 -0
  136. data/set-of-emails/maildir/bsd/rhost-zoho-01.eml +88 -0
  137. data/set-of-emails/maildir/bsd/rhost-zoho-02.eml +86 -0
  138. data/set-of-emails/maildir/bsd/rhost-zoho-03.eml +87 -0
  139. data/set-of-emails/maildir/bsd/rhost-zoho-04.eml +86 -0
  140. data/set-of-emails/maildir/not/rb-issue-368-bug.eml +39 -0
  141. data/sisimai-java.gemspec +1 -1
  142. data/sisimai.gemspec +1 -1
  143. metadata +28 -13
  144. data/lib/sisimai/reason/exceedlimit.rb +0 -47
  145. data/lib/sisimai/reason/speeding.rb +0 -47
  146. data/lib/sisimai/reason/toomanyconn.rb +0 -59
  147. /data/set-of-emails/maildir/bsd/{lhost-mailmarshalsmtp-02.eml → lhost-mailmarshal-02.eml} +0 -0
  148. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-01.eml → lhost-trendmicro-01.eml} +0 -0
  149. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-02.eml → lhost-trendmicro-02.eml} +0 -0
  150. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-03.eml → lhost-trendmicro-03.eml} +0 -0
@@ -17,28 +17,22 @@ module Sisimai
17
17
  #
18
18
  module SecurityError
19
19
  class << self
20
- require 'sisimai/string'
21
-
22
20
  Index = [
23
- 'account not subscribed to ses',
24
- 'authentication credentials invalid',
25
- 'authentication failure',
26
- 'authentication required',
27
- 'authentication turned on in your email client',
28
- 'executable files are not allowed in compressed files',
29
- 'insecure mail relay',
30
- 'recipient address rejected: access denied',
31
- "sorry, you don't authenticate or the domain isn't in my list of allowed rcpthosts",
32
- 'unauthenticated senders not allowed',
33
- 'verification failure',
34
- 'you are not authorized to send mail, authentication is required',
21
+ "account not subscribed to ses",
22
+ "authentication credentials invalid",
23
+ "authentication failure",
24
+ "authentication required",
25
+ "authentication turned on in your email client",
26
+ "unauthenticated senders not allowed",
27
+ "verification failure",
28
+ "you are not authorized to send mail, authentication is required",
29
+ "you don't authenticate or the domain isn't in my list of allowed rcpthosts",
35
30
  ].freeze
36
31
  Pairs = [
37
- ['authentication failed; server ', ' said: '], # Postfix
38
- ['authentification invalide', '305'],
39
- ['authentification requise', '402'],
40
- ['domain ', ' is a dead domain'],
41
- ['user ', ' is not authorized to perform ses:sendrawemail on resource'],
32
+ ["authentication failed; server ", " said: "], # Postfix
33
+ ["authentification invalide", "305"],
34
+ ["authentification requise", "402"],
35
+ ["user ", " is not authorized to perform ses:sendrawemail on resource"],
42
36
  ].freeze
43
37
 
44
38
  def text; return 'securityerror'; end
@@ -48,7 +42,7 @@ module Sisimai
48
42
  # @param [String] argv1 String to be matched with regular expressions
49
43
  # @return [Boolean] false: Did not match, true: Matched
50
44
  def match(argv1)
51
- return false unless argv1
45
+ return false if argv1.nil? || argv1.empty?
52
46
  return true if Index.any? { |a| argv1.include?(a) }
53
47
  return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
54
48
  return false
@@ -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
@@ -122,7 +72,7 @@ module Sisimai
122
72
  # @param [String] argv1 String to be matched with regular expressions
123
73
  # @return [Boolean] false: Did not match, true: Matched
124
74
  def match(argv1)
125
- return false unless argv1
75
+ return false if argv1.nil? || argv1.empty?
126
76
  return true if Index.any? { |a| argv1.include?(a) }
127
77
  return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
128
78
  return false
@@ -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,29 +6,31 @@ 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
- 'this account has been disabled or discontinued',
26
- 'this account has been temporarily suspended',
27
- 'this address no longer accepts mail',
28
- 'this mailbox is disabled',
29
- 'user or domain is disabled',
30
- 'user suspended', # http://mail.163.com/help/help_spam_16.htm
31
- '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
+ "user or domain is disabled",
26
+ "user suspended", # http://mail.163.com/help/help_spam_16.htm
27
+ "vdelivermail: account is locked email bounced",
28
+ ].freeze
29
+ Pairs = [
30
+ ["account ", "disabled"],
31
+ ["has been ", "suspended"],
32
+ ["mailbox ", "disabled"],
33
+ ["not ", "active"],
32
34
  ].freeze
33
35
 
34
36
  def text; return 'suspend'; end
@@ -38,8 +40,9 @@ module Sisimai
38
40
  # @param [String] argv1 String to be matched with regular expressions
39
41
  # @return [Boolean] false: Did not match, true: Matched
40
42
  def match(argv1)
41
- return false unless argv1
43
+ return false if argv1.nil? || argv1.empty?
42
44
  return true if Index.any? { |a| argv1.include?(a) }
45
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
43
46
  return false
44
47
  end
45
48
 
@@ -9,33 +9,29 @@ 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",
15
14
  "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 ',
15
+ "cannot send e-mail to yourself",
16
+ "could not load ",
17
+ "interrupted system call",
18
+ "it encountered an error while being processed",
19
+ "it would create a mail loop",
20
+ "loop was found in the mail exchanger",
21
+ "loops back to myself",
22
+ "queue file write error",
23
+ "recipient deferred because there is no mdb",
24
+ "remote server is misconfigured",
25
+ "service currently unavailable",
26
+ "temporary local problem",
27
+ "timeout waiting for input",
28
+ "transaction failed ",
36
29
  ].freeze
37
30
  Pairs = [
38
- ['unable to connect ', 'daemon'],
31
+ ["config", " error"],
32
+ ["internal ", "error"],
33
+ ["local ", "error"],
34
+ ["unable to connect ", "daemon"],
39
35
  ].freeze
40
36
 
41
37
  def text; return 'systemerror'; end
@@ -45,7 +41,7 @@ module Sisimai
45
41
  # @param [String] argv1 String to be matched with regular expressions
46
42
  # @return [Boolean] false: Did not match, true: Matched
47
43
  def match(argv1)
48
- return false unless argv1
44
+ return false if argv1.nil? || argv1.empty?
49
45
  return true if Index.any? { |a| argv1.include?(a) }
50
46
  return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
51
47
  return false
@@ -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
@@ -20,7 +20,7 @@ module Sisimai
20
20
  # @param [String] argv1 String to be matched with regular expressions
21
21
  # @return [Boolean] false: Did not match, true: Matched
22
22
  def match(argv1)
23
- return false unless argv1
23
+ return false if argv1.nil? || argv1.empty?
24
24
  return true if Index.any? { |a| argv1.include?(a) }
25
25
  return false
26
26
  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,118 +24,87 @@ 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
- '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",
116
81
  ].freeze
117
82
  Pairs = [
118
- ['<', '> not found'],
119
- ['<', '>... blocked by '],
120
- ['account ', ' does not exist at the organization'],
121
- ['adresse d au moins un destinataire invalide. invalid recipient.', '416'],
122
- ['adresse d au moins un destinataire invalide. invalid recipient.', '418'],
123
- ['bad', 'recipient'],
124
- ['mailbox ', 'does not exist'],
125
- ['mailbox ', 'unavailable or access denied'],
126
- ['no ', ' in name directory'],
127
- ['non', 'existent user'],
128
- ['rcpt <', ' does not exist'],
129
- ['rcpt (', 't exist '],
130
- ['recipient ', ' was not found in'],
131
- ['recipient address rejected: user ', ' does not exist'],
132
- ['recipient address rejected: user unknown in ', ' table'],
133
- ['said: 550-5.1.1 ', ' user unknown '],
134
- ['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"],
135
102
  ["this user doesn't have a ", " account"],
136
- ['unknown e', 'mail address'],
137
- ['unknown local', 'part'],
138
- ['user ', ' was not found'],
139
- ['user ', ' does not exist'],
140
- ['user (', ') unknown'],
103
+ ["unknown e", "mail address"],
104
+ ["unknown local", "part"],
105
+ ["user ", " not exist"],
106
+ ["user ", "not found"],
107
+ ["user (", ") unknown"],
141
108
  ].freeze
142
109
 
143
110
  def text; return 'userunknown'; end
@@ -147,7 +114,7 @@ module Sisimai
147
114
  # @param [String] argv1 String to be matched with regular expressions
148
115
  # @return [Boolean] false: Did not match, true: Matched
149
116
  def match(argv1)
150
- return false unless argv1
117
+ return false if argv1.nil? || argv1.empty?
151
118
  return true if Index.any? { |a| argv1.include?(a) }
152
119
  return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
153
120
  return false
@@ -159,7 +126,8 @@ module Sisimai
159
126
  # false: is not unknown user.
160
127
  # @see http://www.ietf.org/rfc/rfc2822.txt
161
128
  def true(argvs)
162
- return true if argvs['reason'] == 'userunknown'
129
+ return true if argvs['reason'] == 'userunknown'
130
+ return false if Sisimai::SMTP::Command::BeforeRCPT.include?(argvs['command'])
163
131
 
164
132
  tempreason = Sisimai::SMTP::Status.name(argvs['deliverystatus'])
165
133
  return false if tempreason == 'suspend'
@@ -183,12 +151,12 @@ module Sisimai
183
151
  next
184
152
  end
185
153
 
186
- next unless r.match(issuedcode)
154
+ next if r.match(issuedcode) == false
187
155
  # Match with reason defined in Sisimai::Reason::* except UserUnknown.
188
156
  matchother = true
189
157
  break
190
158
  end
191
- return true unless matchother # Did not match with other message patterns
159
+ return true if matchother == false # Did not match with other message patterns
192
160
 
193
161
  elsif argvs['command'] == 'RCPT'
194
162
  # When the SMTP command is not "RCPT", the session rejected by other
@@ -18,7 +18,7 @@ module Sisimai
18
18
  # @param [String] argv1 String to be matched with regular expressions
19
19
  # @return [Boolean] false: Did not match, true: Matched
20
20
  def match(argv1)
21
- return false unless argv1
21
+ return false if argv1.nil? || argv1.empty?
22
22
  return true if Index.any? { |a| argv1.include?(a) }
23
23
  return false
24
24
  end