sisimai 4.25.16-java → 5.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/rake-test.yml +55 -0
  3. data/.travis.yml +3 -3
  4. data/ANALYTICAL-PRECISION +2 -2
  5. data/Benchmarks.mk +3 -3
  6. data/CONTRIBUTING +1 -1
  7. data/ChangeLog.md +451 -393
  8. data/Developers.mk +5 -6
  9. data/Gemfile +1 -1
  10. data/Makefile +15 -15
  11. data/README-JA.md +323 -149
  12. data/README.md +319 -149
  13. data/Rakefile +9 -3
  14. data/Repository.mk +2 -3
  15. data/lib/sisimai/address.rb +118 -74
  16. data/lib/sisimai/arf.rb +84 -82
  17. data/lib/sisimai/datetime.rb +5 -52
  18. data/lib/sisimai/{data → fact}/json.rb +7 -9
  19. data/lib/sisimai/fact/yaml.rb +31 -0
  20. data/lib/sisimai/fact.rb +506 -0
  21. data/lib/sisimai/lhost/activehunter.rb +12 -14
  22. data/lib/sisimai/lhost/amavis.rb +11 -14
  23. data/lib/sisimai/lhost/amazonses.rb +37 -42
  24. data/lib/sisimai/lhost/amazonworkmail.rb +15 -19
  25. data/lib/sisimai/lhost/aol.rb +12 -15
  26. data/lib/sisimai/lhost/apachejames.rb +19 -21
  27. data/lib/sisimai/lhost/barracuda.rb +10 -12
  28. data/lib/sisimai/lhost/bigfoot.rb +21 -22
  29. data/lib/sisimai/lhost/biglobe.rb +15 -16
  30. data/lib/sisimai/lhost/courier.rb +20 -20
  31. data/lib/sisimai/lhost/domino.rb +23 -20
  32. data/lib/sisimai/lhost/einsundeins.rb +23 -18
  33. data/lib/sisimai/lhost/exchange2003.rb +30 -29
  34. data/lib/sisimai/lhost/exchange2007.rb +70 -58
  35. data/lib/sisimai/lhost/exim.rb +179 -174
  36. data/lib/sisimai/lhost/ezweb.rb +31 -56
  37. data/lib/sisimai/lhost/facebook.rb +21 -34
  38. data/lib/sisimai/lhost/fml.rb +43 -48
  39. data/lib/sisimai/lhost/gmail.rb +29 -29
  40. data/lib/sisimai/lhost/gmx.rb +18 -17
  41. data/lib/sisimai/lhost/googlegroups.rb +11 -11
  42. data/lib/sisimai/lhost/gsuite.rb +21 -28
  43. data/lib/sisimai/lhost/imailserver.rb +25 -39
  44. data/lib/sisimai/lhost/interscanmss.rb +28 -31
  45. data/lib/sisimai/lhost/kddi.rb +22 -28
  46. data/lib/sisimai/lhost/mailfoundry.rb +11 -12
  47. data/lib/sisimai/lhost/mailmarshalsmtp.rb +25 -29
  48. data/lib/sisimai/lhost/mailru.rb +37 -40
  49. data/lib/sisimai/lhost/mcafee.rb +21 -31
  50. data/lib/sisimai/lhost/messagelabs.rb +17 -21
  51. data/lib/sisimai/lhost/messagingserver.rb +40 -37
  52. data/lib/sisimai/lhost/mfilter.rb +16 -17
  53. data/lib/sisimai/lhost/mxlogic.rb +24 -33
  54. data/lib/sisimai/lhost/notes.rb +17 -17
  55. data/lib/sisimai/lhost/office365.rb +64 -28
  56. data/lib/sisimai/lhost/opensmtpd.rb +12 -13
  57. data/lib/sisimai/lhost/outlook.rb +12 -16
  58. data/lib/sisimai/lhost/postfix.rb +179 -130
  59. data/lib/sisimai/lhost/powermta.rb +12 -14
  60. data/lib/sisimai/lhost/qmail.rb +44 -47
  61. data/lib/sisimai/lhost/receivingses.rb +15 -21
  62. data/lib/sisimai/lhost/sendgrid.rb +34 -34
  63. data/lib/sisimai/lhost/sendmail.rb +65 -53
  64. data/lib/sisimai/lhost/surfcontrol.rb +19 -19
  65. data/lib/sisimai/lhost/v5sendmail.rb +45 -39
  66. data/lib/sisimai/lhost/verizon.rb +35 -39
  67. data/lib/sisimai/lhost/x1.rb +18 -17
  68. data/lib/sisimai/lhost/x2.rb +17 -14
  69. data/lib/sisimai/lhost/x3.rb +19 -19
  70. data/lib/sisimai/lhost/x4.rb +72 -57
  71. data/lib/sisimai/lhost/x5.rb +17 -19
  72. data/lib/sisimai/lhost/x6.rb +41 -17
  73. data/lib/sisimai/lhost/yahoo.rb +17 -16
  74. data/lib/sisimai/lhost/yandex.rb +16 -21
  75. data/lib/sisimai/lhost/zoho.rb +16 -15
  76. data/lib/sisimai/lhost.rb +8 -10
  77. data/lib/sisimai/mail/maildir.rb +1 -3
  78. data/lib/sisimai/mail/mbox.rb +3 -4
  79. data/lib/sisimai/mail/memory.rb +0 -1
  80. data/lib/sisimai/mail/stdin.rb +1 -3
  81. data/lib/sisimai/mail.rb +3 -7
  82. data/lib/sisimai/mda.rb +28 -42
  83. data/lib/sisimai/message.rb +444 -326
  84. data/lib/sisimai/order.rb +5 -5
  85. data/lib/sisimai/reason/authfailure.rb +65 -0
  86. data/lib/sisimai/reason/badreputation.rb +53 -0
  87. data/lib/sisimai/reason/blocked.rb +96 -160
  88. data/lib/sisimai/reason/contenterror.rb +8 -9
  89. data/lib/sisimai/reason/delivered.rb +4 -6
  90. data/lib/sisimai/reason/exceedlimit.rb +10 -12
  91. data/lib/sisimai/reason/expired.rb +7 -8
  92. data/lib/sisimai/reason/feedback.rb +2 -3
  93. data/lib/sisimai/reason/filtered.rb +17 -19
  94. data/lib/sisimai/reason/hasmoved.rb +9 -10
  95. data/lib/sisimai/reason/hostunknown.rb +15 -15
  96. data/lib/sisimai/reason/mailboxfull.rb +11 -12
  97. data/lib/sisimai/reason/mailererror.rb +18 -20
  98. data/lib/sisimai/reason/mesgtoobig.rb +9 -11
  99. data/lib/sisimai/reason/networkerror.rb +5 -8
  100. data/lib/sisimai/reason/norelaying.rb +8 -11
  101. data/lib/sisimai/reason/notaccept.rb +13 -14
  102. data/lib/sisimai/reason/notcompliantrfc.rb +43 -0
  103. data/lib/sisimai/reason/onhold.rb +6 -9
  104. data/lib/sisimai/reason/policyviolation.rb +14 -12
  105. data/lib/sisimai/reason/rejected.rb +26 -24
  106. data/lib/sisimai/reason/requireptr.rb +69 -0
  107. data/lib/sisimai/reason/securityerror.rb +34 -36
  108. data/lib/sisimai/reason/spamdetected.rb +115 -147
  109. data/lib/sisimai/reason/speeding.rb +49 -0
  110. data/lib/sisimai/reason/suspend.rb +12 -11
  111. data/lib/sisimai/reason/syntaxerror.rb +11 -10
  112. data/lib/sisimai/reason/systemerror.rb +7 -9
  113. data/lib/sisimai/reason/systemfull.rb +7 -8
  114. data/lib/sisimai/reason/toomanyconn.rb +9 -11
  115. data/lib/sisimai/reason/undefined.rb +2 -3
  116. data/lib/sisimai/reason/userunknown.rb +129 -146
  117. data/lib/sisimai/reason/vacation.rb +3 -4
  118. data/lib/sisimai/reason/virusdetected.rb +10 -11
  119. data/lib/sisimai/reason.rb +59 -64
  120. data/lib/sisimai/rfc1894.rb +55 -28
  121. data/lib/sisimai/rfc2045.rb +373 -0
  122. data/lib/sisimai/rfc3464.rb +250 -308
  123. data/lib/sisimai/rfc3834.rb +42 -45
  124. data/lib/sisimai/rfc5322.rb +177 -146
  125. data/lib/sisimai/rfc5965.rb +31 -0
  126. data/lib/sisimai/rhost/cox.rb +5 -6
  127. data/lib/sisimai/rhost/franceptt.rb +6 -8
  128. data/lib/sisimai/rhost/godaddy.rb +12 -12
  129. data/lib/sisimai/rhost/google.rb +530 -0
  130. data/lib/sisimai/rhost/iua.rb +9 -10
  131. data/lib/sisimai/rhost/kddi.rb +6 -8
  132. data/lib/sisimai/rhost/{exchangeonline.rb → microsoft.rb} +115 -114
  133. data/lib/sisimai/rhost/mimecast.rb +51 -42
  134. data/lib/sisimai/rhost/nttdocomo.rb +12 -12
  135. data/lib/sisimai/rhost/spectrum.rb +10 -12
  136. data/lib/sisimai/rhost/{tencentqq.rb → tencent.rb} +7 -8
  137. data/lib/sisimai/rhost.rb +23 -31
  138. data/lib/sisimai/smtp/command.rb +59 -0
  139. data/lib/sisimai/smtp/error.rb +4 -7
  140. data/lib/sisimai/smtp/reply.rb +161 -74
  141. data/lib/sisimai/smtp/status.rb +507 -393
  142. data/lib/sisimai/smtp/transcript.rb +124 -0
  143. data/lib/sisimai/smtp.rb +0 -1
  144. data/lib/sisimai/string.rb +74 -5
  145. data/lib/sisimai/time.rb +1 -2
  146. data/lib/sisimai/version.rb +1 -1
  147. data/lib/sisimai.rb +46 -31
  148. data/set-of-emails/maildir/bsd/lhost-domino-02.eml +6 -3
  149. data/set-of-emails/maildir/bsd/lhost-googlegroups-15.eml +174 -0
  150. data/set-of-emails/maildir/bsd/lhost-gsuite-15.eml +229 -0
  151. data/set-of-emails/maildir/bsd/lhost-postfix-75.eml +51 -0
  152. data/set-of-emails/maildir/bsd/lhost-postfix-76.eml +101 -0
  153. data/set-of-emails/maildir/bsd/lhost-postfix-77.eml +74 -0
  154. data/set-of-emails/maildir/bsd/lhost-postfix-78.eml +91 -0
  155. data/set-of-emails/maildir/bsd/lhost-receivingses-08.eml +88 -0
  156. data/set-of-emails/maildir/bsd/lhost-sendmail-60.eml +85 -0
  157. data/set-of-emails/maildir/bsd/rfc3464-43.eml +88 -0
  158. data/set-of-emails/maildir/bsd/rhost-google-03.eml +101 -0
  159. data/set-of-emails/maildir/bsd/rhost-google-04.eml +102 -0
  160. data/set-of-emails/maildir/bsd/rhost-google-05.eml +82 -0
  161. data/set-of-emails/maildir/bsd/rhost-google-06.eml +102 -0
  162. data/set-of-emails/maildir/bsd/rhost-google-07.eml +69 -0
  163. data/set-of-emails/maildir/bsd/rhost-google-08.eml +99 -0
  164. data/sisimai-java.gemspec +1 -1
  165. data/sisimai.gemspec +1 -1
  166. metadata +48 -26
  167. data/.rspec +0 -2
  168. data/lib/sisimai/data/yaml.rb +0 -33
  169. data/lib/sisimai/data.rb +0 -411
  170. data/lib/sisimai/mime.rb +0 -456
  171. data/lib/sisimai/rhost/googleapps.rb +0 -261
  172. /data/set-of-emails/maildir/bsd/{rfc3464-41.eml → rfc3834-05.eml} +0 -0
  173. /data/set-of-emails/maildir/bsd/{rhost-googleapps-01.eml → rhost-google-01.eml} +0 -0
  174. /data/set-of-emails/maildir/bsd/{rhost-googleapps-02.eml → rhost-google-02.eml} +0 -0
  175. /data/set-of-emails/maildir/bsd/{rhost-exchangeonline-01.eml → rhost-microsoft-01.eml} +0 -0
  176. /data/set-of-emails/maildir/bsd/{rhost-exchangeonline-02.eml → rhost-microsoft-02.eml} +0 -0
  177. /data/set-of-emails/maildir/bsd/{rhost-exchangeonline-03.eml → rhost-microsoft-03.eml} +0 -0
  178. /data/set-of-emails/maildir/bsd/{rhost-tencentqq-01.eml → rhost-tencent-01.eml} +0 -0
  179. /data/set-of-emails/maildir/bsd/{rhost-tencentqq-02.eml → rhost-tencent-02.eml} +0 -0
  180. /data/set-of-emails/maildir/bsd/{rhost-tencentqq-03.eml → rhost-tencent-03.eml} +0 -0
@@ -1,151 +1,119 @@
1
1
  module Sisimai
2
2
  module Reason
3
- # Sisimai::Reason::SpamDetected checks the bounce reason is "spamdetected"
4
- # due to Spam content in the message or not. This class is called only
5
- # Sisimai::Reason class.
6
- #
7
- # This is the error that the message you sent was rejected by "spam filter"
8
- # which is running on the remote host.
9
- # This reason has added in Sisimai 4.1.25 and does not exist in any version
10
- # of bounceHammer.
3
+ # Sisimai::Reason::SpamDetected checks the bounce reason is "spamdetected" due to Spam content
4
+ # in the message or not. This class is called only Sisimai::Reason class. This is the error that
5
+ # the message you sent was rejected by "spam filter" which is running on the remote host.
11
6
  #
12
7
  # Action: failed
13
8
  # Status: 5.7.1
14
9
  # Diagnostic-Code: smtp; 550 5.7.1 Message content rejected, UBE, id=00000-00-000
15
10
  # Last-Attempt-Date: Thu, 9 Apr 2008 23:34:45 +0900 (JST)
16
11
  module SpamDetected
17
- # Imported from p5-Sisimail/lib/Sisimai/Reason/SpamDetected.pm
18
12
  class << self
19
- Regex = %r{(?>
20
- ["]the[ ]mail[ ]server[ ]detected[ ]your[ ]message[ ]as[ ]spam[ ]and[ ]
21
- has[ ]prevented[ ]delivery[.]["] # CPanel/Exim with SA rejections on
22
- |(?:\d[.]\d[.]\d|\d{3})[ ]spam\z
23
- |554[ ]5[.]7[.]0[ ]reject,[ ]id=\d+
24
- |appears[ ]to[ ]be[ ]unsolicited
25
- |blacklisted[ ]url[ ]in[ ]message
26
- |block[ ]for[ ]spam
27
- |blocked[ ]by[ ](?:
28
- policy:[ ]no[ ]spam[ ]please
29
- |spamassassin # rejected by SpamAssassin
30
- )
31
- |blocked[ ]for[ ]abuse[.][ ]see[ ]http://att[.]net/blocks # AT&T
32
- |bulk[ ]email
33
- |considered[ ]unsolicited[ ]bulk[ ]e-mail[ ][(]spam[)][ ]by[ ]our[ ]mail[ ]filters
34
- |content[ ]filter[ ]rejection
35
- |cyberoam[ ]anti[ ]spam[ ]engine[ ]has[ ]identified[ ]this[ ]email[ ]as[ ]a[ ]bulk[ ]email
36
- |denied[ ]due[ ]to[ ]spam[ ]list
37
- |greylisted.?.[ ]please[ ]try[ ]again[ ]in
38
- |high[ ]probability[ ]of[ ]spam
39
- |https?://(?:www[.]spamhaus[.]org|dsbl[.]org|mail[.]163[.]com/help/help_spam_16[.]htm)
40
- |listed[ ]in[ ]work[.]drbl[.]imedia[.]ru
41
- |mail[ ](?:
42
- appears[ ]to[ ]be[ ]unsolicited # rejected due to spam
43
- |content[ ]denied # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726
44
- |rejete[.][ ]mail[ ]rejected[.][ ][0-9a-z_]+506
45
- )
46
- |may[ ]consider[ ]spam
47
- |message[ ](?:
48
- considered[ ]as[ ]spam[ ]or[ ]virus
49
- |contains[ ]spam[ ]or[ ]virus
50
- |content[ ]rejected
51
- |detected[ ]as[ ]spam
52
- |filtered
53
- |filtered[.][ ](?:
54
- please[ ]see[ ]the[ ]faqs[ ]section[ ]on[ ]spam
55
- |refer[ ]to[ ]the[ ]troubleshooting[ ]page[ ]at[ ]
56
- )
57
- |is[ ]being[ ]rejected[ ]as[ ]it[ ]seems[ ]to[ ]be[ ]a[ ]spam
58
- |looks[ ]like[ ]spam
59
- |refused[ ]by[ ](?:
60
- mailmarshal[ ]spamprofiler
61
- |trustwave[ ]seg[ ]spamprofiler
62
- )
63
- |rejected[ ](?:
64
- as[ ]spam
65
- |because[ ]of[ ]unacceptable[ ]content
66
- |due[ ]to[ ]suspected[ ]spam[ ]content
67
- |for[ ]policy[ ]reasons
68
- )
69
- )
70
- |our[ ](?:
71
- email[ ]server[ ]thinks[ ]this[ ]email[ ]is[ ]spam
72
- |filters[ ]rate[ ]at[ ]and[ ]above[ ]\d+[ ]percent[ ]probability[ ]of[ ]being[ ]spam
73
- |system[ ]has[ ]detected[ ]that[ ]this[ ]message[ ]is
74
- )
75
- |probable[ ]spam
76
- |reject[ ]bulk[.]advertising
77
- |rejected(?:
78
- :[ ]spamassassin[ ]score[ ]
79
- |[ ]by[ ][^ ]+[ ][(]spam[)]
80
- |[ ]due[ ]to[ ]spam[ ](?:url[ ]in[ ])?(?:classification|content)
81
- )
82
- |rejecting[ ](?:banned|mail)[ ]content
83
- |related[ ]to[ ]content[ ]with[ ]spam[-]like[ ]characteristics
84
- |rule[ ]imposed[ ]as[ ][^ ]+[ ]is[ ]blacklisted[ ]on
85
- |sender[ ]domain[ ]listed[ ]at[ ][^ ]+
86
- |sending[ ]address[ ]not[ ]accepted[ ]due[ ]to[ ]spam[ ]filter
87
- |spam[ ](?:
88
- [^ ]+[ ]exceeded
89
- |blocked
90
- |check
91
- |content[ ]matched
92
- |detected
93
- |email
94
- |email[ ]not[ ]accepted
95
- |message[ ]rejected[.] # mail.ru
96
- |not[ ]accepted
97
- |refused
98
- |rejection
99
- |reporting[ ]address # SendGrid: a message to an address has previously been marked as Spam by the recipient.
100
- |score[ ]
101
- )
102
- |spambouncer[ ]identified[ ]spam # SpamBouncer identified SPAM
103
- |spamming[ ]not[ ]allowed
104
- |too[ ]much[ ]spam[.] # Earthlink
105
- |the[ ]email[ ]message[ ]was[ ]detected[ ]as[ ]spam
106
- |the[ ]message[ ](?:
107
- has[ ]been[ ]rejected[ ]by[ ]spam[ ]filtering[ ]engine
108
- |was[ ]rejected[ ]due[ ]to[ ]classification[ ]as[ ]bulk[ ]mail
109
- )
110
- |the[ ]content[ ]of[ ]this[ ]message[ ]looked[ ]like[ ]spam # SendGrid
111
- |this[ ](?:e-mail|mail)[ ](?:
112
- cannot[ ]be[ ]forwarded[ ]because[ ]it[ ]was[ ]detected[ ]as[ ]spam
113
- |is[ ]classified[ ]as[ ]spam[ ]and[ ]is[ ]rejected
114
- )
115
- |this[ ]message[ ](?:
116
- appears[ ]to[ ]be[ ]spam
117
- |has[ ]been[ ](?:
118
- identified[ ]as[ ]spam
119
- |scored[ ]as[ ]spam[ ]with[ ]a[ ]probability
120
- )
121
- |scored[ ][^ ]+[ ]spam[ ]points
122
- |was[ ]classified[ ]as[ ]spam
123
- |was[ ]rejected[ ]by[ ]recurrent[ ]pattern[ ]detection[ ]system
124
- )
125
- |transaction[ ]failed[ ]spam[ ]message[ ]not[ ]queued # SendGrid
126
- |we[ ]dont[ ]accept[ ]spam
127
- |you're[ ]using[ ]a[ ]mass[ ]mailer
128
- |your[ ](?:
129
- email[ ](?:
130
- appears[ ]similar[ ]to[ ]spam[ ]we[ ]have[ ]received[ ]before
131
- |breaches[ ]local[ ]uribl[ ]policy
132
- |had[ ]spam[-]like[ ]
133
- |is[ ](?:considered|probably)[ ]spam
134
- |was[ ]detected[ ]as[ ]spam
135
- )
136
- |message[ ](?:
137
- as[ ]spam[ ]and[ ]has[ ]prevented[ ]delivery
138
- |has[ ]been[ ](?:
139
- temporarily[ ]blocked[ ]by[ ]our[ ]filter
140
- |rejected[ ]because[ ]it[ ]appears[ ]to[ ]be[ ]spam
141
- )
142
- |has[ ]triggered[ ]a[ ]spam[ ]block
143
- |may[ ]contain[ ]the[ ]spam[ ]contents
144
- |failed[ ]several[ ]antispam[ ]checks
145
- )
146
- )
147
- )
148
- }x
13
+ require 'sisimai/string'
14
+
15
+ 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',
104
+ ].freeze
105
+ Pairs = [
106
+ ['greylisted', ' please try again in'],
107
+ ['mail rejete. mail rejected. ', '506'],
108
+ ['our filters rate at and above ', ' percent probability of being spam'],
109
+ ['rejected by ', ' (spam)'],
110
+ ['rejected due to spam ', 'classification'],
111
+ ['rejected due to spam ', 'content'],
112
+ ['rule imposed as ', ' is blacklisted on'],
113
+ ['spam ', ' exceeded'],
114
+ ['this message scored ', ' spam points'],
115
+ ].freeze
116
+ Regex = %r/(?:\d[.]\d[.]\d|\d{3})[ ]spam\z/.freeze
149
117
 
150
118
  def text; return 'spamdetected'; end
151
119
  def description; return 'Email rejected by spam filter running on the remote host'; end
@@ -156,25 +124,27 @@ module Sisimai
156
124
  # true: Matched
157
125
  def match(argv1)
158
126
  return nil unless argv1
127
+ return true if Index.any? { |a| argv1.include?(a) }
128
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
159
129
  return true if argv1 =~ Regex
160
130
  return false
161
131
  end
162
132
 
163
133
  # Rejected due to spam content in the message
164
- # @param [Sisimai::Data] argvs Object to be detected the reason
134
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
165
135
  # @return [True,False] true: rejected due to spam
166
136
  # false: is not rejected due to spam
167
137
  # @see http://www.ietf.org/rfc/rfc2822.txt
168
138
  def true(argvs)
169
- return nil if argvs.deliverystatus.empty?
170
- return true if argvs.reason == 'spamdetected'
171
- return true if Sisimai::SMTP::Status.name(argvs.deliverystatus).to_s == 'spamdetected'
139
+ return nil if argvs['deliverystatus'].empty?
140
+ return true if argvs['reason'] == 'spamdetected'
141
+ return true if Sisimai::SMTP::Status.name(argvs['deliverystatus']).to_s == 'spamdetected'
172
142
 
173
143
  # The value of "reason" isn't "spamdetected" when the value of "smtpcommand" is an SMTP
174
144
  # command to be sent before the SMTP DATA command because all the MTAs read the headers
175
145
  # and the entire message body after the DATA command.
176
- return false if %w[CONN EHLO HELO MAIL RCPT].include?(argvs.smtpcommand)
177
- return true if match(argvs.diagnosticcode.downcase)
146
+ return false if %w[CONN EHLO HELO MAIL RCPT].include?(argvs['smtpcommand'])
147
+ return true if match(argvs['diagnosticcode'].downcase)
178
148
  return false
179
149
  end
180
150
 
@@ -183,5 +153,3 @@ module Sisimai
183
153
  end
184
154
  end
185
155
 
186
-
187
-
@@ -0,0 +1,49 @@
1
+ module Sisimai
2
+ module Reason
3
+ # Sisimai::Reason::Speeding checks the bounce reason is "speeding" or not. This class is called
4
+ # only Sisimai::Reason class. This is the error that a connection rejected due to exceeding a
5
+ # rate limit or sending too fast.
6
+ module Speeding
7
+ class << self
8
+ Index = [
9
+ 'mail sent from your IP address has been temporarily rate limited',
10
+ 'please try again slower',
11
+ 'receiving mail at a rate that prevents additional messages from being delivered',
12
+ ].freeze
13
+
14
+ def text; return 'speeding'; end
15
+ def description; return 'Rejected due to exceeding a rate limit or sending too fast'; end
16
+
17
+ # Try to match that the given text and regular expressions
18
+ # @param [String] argv1 String to be matched with regular expressions
19
+ # @return [True,False] false: Did not match
20
+ # true: Matched
21
+ def match(argv1)
22
+ return nil unless argv1
23
+ return true if Index.any? { |a| argv1.include?(a) }
24
+ return false
25
+ end
26
+
27
+ # Speeding or not
28
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
29
+ # @return [True,False] true: is speeding
30
+ # false: is not speeding
31
+ # @see http://www.ietf.org/rfc/rfc2822.txt
32
+ def true(argvs)
33
+ return nil if argvs['deliverystatus'].empty?
34
+ return true if argvs['reason'] == 'speeding'
35
+
36
+ # Action: failed
37
+ # Status: 4.7.1
38
+ # Remote-MTA: dns; smtp.example.jp
39
+ # Diagnostic-Code: smtp; 451 4.7.1 <mx.example.org[192.0.2.2]>: Client host rejected:
40
+ # Please try again slower
41
+ return true if match(argvs['diagnosticcode'].downcase)
42
+ return false
43
+ end
44
+
45
+ end
46
+ end
47
+ end
48
+ end
49
+
@@ -1,31 +1,31 @@
1
1
  module Sisimai
2
2
  module Reason
3
- # Sisimai::Reason::Suspend checks the bounce reason is C<suspend> or not.
4
- # This class is called only Sisimai::Reason class.
5
- #
6
- # This is the error that a recipient account is being suspended due to
7
- # unpaid or other reasons.
3
+ # Sisimai::Reason::Suspend checks the bounce reason is "suspend" or not. This class is called
4
+ # only Sisimai::Reason class. This is the error that a recipient account is being suspended
5
+ # due to unpaid or other reasons.
8
6
  module Suspend
9
- # Imported from p5-Sisimail/lib/Sisimai/Reason/Suspend.pm
10
7
  class << self
11
8
  Index = [
12
9
  ' is currently suspended',
13
10
  ' temporary locked',
11
+ 'archived recipient',
14
12
  'boite du destinataire archivee',
15
13
  'email account that you tried to reach is disabled',
16
14
  'has been suspended',
17
15
  'invalid/inactive user',
18
16
  'is a deactivated mailbox', # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000742
17
+ 'is unavailable: user is terminated',
19
18
  'mailbox currently suspended',
20
19
  'mailbox is frozen',
21
20
  'mailbox unavailable or access denied',
22
21
  'recipient rejected: temporarily inactive',
23
22
  'recipient suspend the service',
24
23
  'this account has been disabled or discontinued',
24
+ 'this address no longer accepts mail',
25
25
  'this mailbox is disabled',
26
26
  'user suspended', # http://mail.163.com/help/help_spam_16.htm
27
27
  'vdelivermail: account is locked email bounced',
28
- ]
28
+ ].freeze
29
29
 
30
30
  def text; return 'suspend'; end
31
31
  def description; return 'Email rejected due to a recipient account is being suspended'; end
@@ -41,14 +41,15 @@ module Sisimai
41
41
  end
42
42
 
43
43
  # The envelope recipient's mailbox is suspended or not
44
- # @param [Sisimai::Data] argvs Object to be detected the reason
44
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
45
45
  # @return [True,False] true: is mailbox suspended
46
46
  # false: is not suspended
47
47
  # @see http://www.ietf.org/rfc/rfc2822.txt
48
48
  def true(argvs)
49
- return nil if argvs.deliverystatus.empty?
50
- return true if argvs.reason == 'suspend'
51
- return true if match(argvs.diagnosticcode.downcase)
49
+ return nil if argvs['deliverystatus'].empty?
50
+ return true if argvs['reason'] == 'suspend'
51
+ return true if argvs['replycode'].to_i == 525
52
+ return true if match(argvs['diagnosticcode'].downcase)
52
53
  return false
53
54
  end
54
55
 
@@ -1,33 +1,34 @@
1
1
  module Sisimai
2
2
  module Reason
3
- # Sisimai::Reason::SyntaxError checks the bounce reason is "syntaxerror" or
4
- # not. This class is called only Sisimai::Reason class.
3
+ # Sisimai::Reason::SyntaxError checks the bounce reason is "syntaxerror" or not. This class is
4
+ # called only Sisimai::Reason class.
5
5
  #
6
- # This is the error that a destination mail server could not recognize SMTP
7
- # command which is sent from a sender's MTA. Sisimai will set "syntaxerror"
8
- # to the reason if the value of "replycode" begins with "50" such as 502,
9
- # or 503.
6
+ # This is the error that a destination mail server could not recognize SMTP command which is
7
+ # sent from a sender's MTA. Sisimai will set "syntaxerror" to the reason if the value of
8
+ # "replycode" begins with "50" such as 502, or 503.
10
9
  # Action: failed
11
10
  # Status: 5.5.0
12
11
  # Diagnostic-Code: SMTP; 503 Improper sequence of commands
13
12
  #
14
13
  module SyntaxError
15
- # Imported from p5-Sisimail/lib/Sisimai/Reason/SyntaxError.pm
16
14
  class << self
17
15
  def text; return 'syntaxerror'; end
18
16
  def description; return 'Email rejected due to syntax error at sent commands in SMTP session'; end
19
17
  def match(*); return nil; end
20
18
 
21
19
  # Connection rejected due to syntax error or not
22
- # @param [Sisimai::Data] argvs Object to be detected the reason
20
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
23
21
  # @return [True,False] true: Connection rejected due to
24
22
  # syntax error
25
23
  # false: is not syntax error
26
24
  # @since 4.1.25
27
25
  # @see http://www.ietf.org/rfc/rfc2822.txt
28
26
  def true(argvs)
29
- return true if argvs.reason == 'syntaxerror'
30
- return true if argvs.replycode =~ /\A[45]0[0-7]\z/
27
+ return true if argvs['reason'] == 'syntaxerror'
28
+
29
+ reply = argvs['replycode'].to_i
30
+ return true if reply > 400 && reply < 408
31
+ return true if reply > 500 && reply < 508
31
32
  return false
32
33
  end
33
34
 
@@ -1,16 +1,13 @@
1
1
  module Sisimai
2
2
  module Reason
3
- # Sisimai::Reason::SystemError checks the bounce reason is "systemerror" or
4
- # not. This class is called only Sisimai::Reason class.
5
- #
6
- # This is the error that an email has bounced due to system error on the
7
- # remote host such as LDAP connection failure or other internal system error.
3
+ # Sisimai::Reason::SystemError checks the bounce reason is "systemerror" or not. This class is
4
+ # called only Sisimai::Reason class. This is the error that an email has bounced due to system
5
+ # error on the remote host such as LDAP connection failure or other internal system error.
8
6
  #
9
7
  # <kijitora@example.net>:
10
8
  # Unable to contact LDAP server. (#4.4.3)I'm not going to try again; this
11
9
  # message has been in the queue too long.
12
10
  module SystemError
13
- # Imported from p5-Sisimail/lib/Sisimai/Reason/SystemError.pm
14
11
  class << self
15
12
  Index = [
16
13
  'aliasing/forwarding loop broken',
@@ -27,14 +24,15 @@ module Sisimai
27
24
  'loops back to myself',
28
25
  'mail system configuration error',
29
26
  'queue file write error',
27
+ 'recipient deferred because there is no mdb',
30
28
  'remote server is misconfigured',
31
29
  'server configuration error',
32
30
  'service currently unavailable',
33
31
  'system config error',
34
32
  'temporary local problem',
35
33
  'timeout waiting for input',
36
- 'transaction failed',
37
- ]
34
+ 'transaction failed ',
35
+ ].freeze
38
36
 
39
37
  def text; return 'systemerror'; end
40
38
  def description; return 'Email returned due to system error on the remote host'; end
@@ -50,7 +48,7 @@ module Sisimai
50
48
  end
51
49
 
52
50
  # The bounce reason is system error or not
53
- # @param [Sisimai::Data] argvs Object to be detected the reason
51
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
54
52
  # @return [True,False] true: is system error
55
53
  # false: is not system error
56
54
  # @see http://www.ietf.org/rfc/rfc2822.txt
@@ -1,18 +1,17 @@
1
1
  module Sisimai
2
2
  module Reason
3
- # Sisimai::Reason::SystemFull checks the bounce reason is "systemfull" or
4
- # not. This class is called only Sisimai::Reason class.
3
+ # Sisimai::Reason::SystemFull checks the bounce reason is "systemfull" or not. This class is called
4
+ # only Sisimai::Reason class.
5
5
  #
6
- # This is the error that a destination mail server's disk (or spool) is full.
7
- # Sisimai will set C<systemfull> to the reason of email bounce if the value
8
- # of Status: field in a bounce email is "4.3.1" or "5.3.1".
6
+ # This is the error that a destination mail server's disk (or spool) is full. Sisimai will set
7
+ # systemfull to the reason of email bounce if the value of Status: field in a bounce email is
8
+ # "4.3.1" or "5.3.1".
9
9
  module SystemFull
10
- # Imported from p5-Sisimail/lib/Sisimai/Reason/SystemFull.pm
11
10
  class << self
12
11
  Index = [
13
12
  'mail system full',
14
13
  'requested mail action aborted: exceeded storage allocation', # MS Exchange
15
- ]
14
+ ].freeze
16
15
 
17
16
  def text; return 'systemfull'; end
18
17
  def description; return "Email rejected due to a destination mail server's disk is full"; end
@@ -28,7 +27,7 @@ module Sisimai
28
27
  end
29
28
 
30
29
  # The bounce reason is system full or not
31
- # @param [Sisimai::Data] argvs Object to be detected the reason
30
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
32
31
  # @return [True,False] true: is system full
33
32
  # false: is not system full
34
33
  # @see http://www.ietf.org/rfc/rfc2822.txt
@@ -1,16 +1,14 @@
1
1
  module Sisimai
2
2
  module Reason
3
- # Sisimai::Reason::TooManyConn checks the bounce reason is "toomanyconn" or
4
- # not. This class is called only Sisimai::Reason class.
3
+ # Sisimai::Reason::TooManyConn checks the bounce reason is "toomanyconn" or not. This class is
4
+ # called only Sisimai::Reason class.
5
5
  #
6
- # This is the error that SMTP connection was rejected temporarily due to too
7
- # many concurrency connections to the remote server. This reason has added
8
- # in Sisimai 4.1.26 and does not exist in any version of bounceHammer.
6
+ # This is the error that SMTP connection was rejected temporarily due to too many concurrency
7
+ # connections to the remote server. This reason has added in Sisimai 4.1.26.
9
8
  #
10
9
  # <kijitora@example.ne.jp>: host mx02.example.ne.jp[192.0.1.20] said:
11
10
  # 452 4.3.2 Connection rate limit exceeded. (in reply to MAIL FROM command)
12
11
  module TooManyConn
13
- # Imported from p5-Sisimail/lib/Sisimai/Reason/TooManyConn.pm
14
12
  class << self
15
13
  Index = [
16
14
  'all available ips are at maximum connection limit', # SendGrid
@@ -27,7 +25,7 @@ module Sisimai
27
25
  'too many smtp sessions for this host', # Sendmail(daemon.c)
28
26
  'trop de connexions, ',
29
27
  'we have already made numerous attempts to deliver this message',
30
- ]
28
+ ].freeze
31
29
 
32
30
  def text; return 'toomanyconn'; end
33
31
  def description; return 'SMTP connection rejected temporarily due to too many concurrency connections to the remote host'; end
@@ -43,14 +41,14 @@ module Sisimai
43
41
  end
44
42
 
45
43
  # Rejected by domain or address filter ?
46
- # @param [Sisimai::Data] argvs Object to be detected the reason
44
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
47
45
  # @return [True,False] true: is filtered
48
46
  # false: is not filtered
49
47
  # @see http://www.ietf.org/rfc/rfc2822.txt
50
48
  def true(argvs)
51
- return true if argvs.reason == 'toomanyconn'
52
- return true if Sisimai::SMTP::Status.name(argvs.deliverystatus).to_s == 'toomanyconn'
53
- return true if match(argvs.diagnosticcode.downcase)
49
+ return true if argvs['reason'] == 'toomanyconn'
50
+ return true if Sisimai::SMTP::Status.name(argvs['deliverystatus']).to_s == 'toomanyconn'
51
+ return true if match(argvs['diagnosticcode'].downcase)
54
52
  return false
55
53
  end
56
54
 
@@ -1,9 +1,8 @@
1
1
  module Sisimai
2
2
  module Reason
3
- # Sisimai::Reason::Undefined is for only returning text and description.
4
- # This class is called only from Sisimai.reason method.
3
+ # Sisimai::Reason::Undefined is for only returning text and description. This class is called only
4
+ # from Sisimai.reason method.
5
5
  module Undefined
6
- # Imported from p5-Sisimail/lib/Sisimai/Reason/Undefined.pm
7
6
  class << self
8
7
  def text; return 'undefined'; end
9
8
  def description; return 'Sisimai could not detect an error reason'; end