sisimai 4.24.1-java → 4.25.0-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sisimai might be problematic. Click here for more details.

Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -2
  3. data/ANALYTICAL-PRECISION +16 -25
  4. data/ChangeLog.md +41 -0
  5. data/Developers.mk +2 -2
  6. data/README-JA.md +13 -13
  7. data/README.md +13 -13
  8. data/lib/sisimai.rb +3 -7
  9. data/lib/sisimai/address.rb +25 -41
  10. data/lib/sisimai/arf.rb +58 -59
  11. data/lib/sisimai/bite.rb +0 -1
  12. data/lib/sisimai/bite/email.rb +7 -7
  13. data/lib/sisimai/bite/email/activehunter.rb +4 -3
  14. data/lib/sisimai/bite/email/amavis.rb +133 -0
  15. data/lib/sisimai/bite/email/amazonses.rb +53 -87
  16. data/lib/sisimai/bite/email/amazonworkmail.rb +51 -57
  17. data/lib/sisimai/bite/email/aol.rb +50 -76
  18. data/lib/sisimai/bite/email/apachejames.rb +2 -2
  19. data/lib/sisimai/bite/email/bigfoot.rb +47 -74
  20. data/lib/sisimai/bite/email/biglobe.rb +8 -9
  21. data/lib/sisimai/bite/email/courier.rb +56 -101
  22. data/lib/sisimai/bite/email/domino.rb +7 -8
  23. data/lib/sisimai/bite/email/einsundeins.rb +4 -5
  24. data/lib/sisimai/bite/email/exchange2003.rb +21 -22
  25. data/lib/sisimai/bite/email/exchange2007.rb +26 -28
  26. data/lib/sisimai/bite/email/exim.rb +48 -47
  27. data/lib/sisimai/bite/email/ezweb.rb +24 -36
  28. data/lib/sisimai/bite/email/facebook.rb +54 -79
  29. data/lib/sisimai/bite/email/fml.rb +10 -10
  30. data/lib/sisimai/bite/email/gmx.rb +6 -6
  31. data/lib/sisimai/bite/email/google.rb +12 -13
  32. data/lib/sisimai/bite/email/gsuite.rb +80 -108
  33. data/lib/sisimai/bite/email/imailserver.rb +16 -16
  34. data/lib/sisimai/bite/email/interscanmss.rb +4 -6
  35. data/lib/sisimai/bite/email/kddi.rb +9 -11
  36. data/lib/sisimai/bite/email/mailfoundry.rb +2 -2
  37. data/lib/sisimai/bite/email/mailmarshalsmtp.rb +2 -2
  38. data/lib/sisimai/bite/email/mailru.rb +12 -13
  39. data/lib/sisimai/bite/email/mcafee.rb +31 -25
  40. data/lib/sisimai/bite/email/messagelabs.rb +48 -87
  41. data/lib/sisimai/bite/email/messagingserver.rb +9 -10
  42. data/lib/sisimai/bite/email/mfilter.rb +16 -16
  43. data/lib/sisimai/bite/email/mxlogic.rb +11 -11
  44. data/lib/sisimai/bite/email/notes.rb +5 -6
  45. data/lib/sisimai/bite/email/office365.rb +25 -42
  46. data/lib/sisimai/bite/email/opensmtpd.rb +8 -8
  47. data/lib/sisimai/bite/email/outlook.rb +49 -67
  48. data/lib/sisimai/bite/email/postfix.rb +78 -112
  49. data/lib/sisimai/bite/email/qmail.rb +23 -23
  50. data/lib/sisimai/bite/email/receivingses.rb +53 -86
  51. data/lib/sisimai/bite/email/sendgrid.rb +65 -84
  52. data/lib/sisimai/bite/email/sendmail.rb +89 -117
  53. data/lib/sisimai/bite/email/surfcontrol.rb +15 -18
  54. data/lib/sisimai/bite/email/userdefined.rb +1 -1
  55. data/lib/sisimai/bite/email/v5sendmail.rb +3 -4
  56. data/lib/sisimai/bite/email/verizon.rb +7 -8
  57. data/lib/sisimai/bite/email/x1.rb +2 -2
  58. data/lib/sisimai/bite/email/x2.rb +2 -2
  59. data/lib/sisimai/bite/email/x3.rb +3 -3
  60. data/lib/sisimai/bite/email/x4.rb +22 -22
  61. data/lib/sisimai/bite/email/x5.rb +40 -49
  62. data/lib/sisimai/bite/email/yahoo.rb +3 -3
  63. data/lib/sisimai/bite/email/yandex.rb +54 -82
  64. data/lib/sisimai/bite/email/zoho.rb +6 -6
  65. data/lib/sisimai/bite/json/amazonses.rb +20 -20
  66. data/lib/sisimai/bite/json/sendgrid.rb +2 -2
  67. data/lib/sisimai/data.rb +27 -40
  68. data/lib/sisimai/datetime.rb +146 -162
  69. data/lib/sisimai/mda.rb +30 -31
  70. data/lib/sisimai/message/email.rb +83 -123
  71. data/lib/sisimai/message/json.rb +2 -4
  72. data/lib/sisimai/mime.rb +31 -34
  73. data/lib/sisimai/order/email.rb +23 -22
  74. data/lib/sisimai/reason.rb +61 -61
  75. data/lib/sisimai/reason/blocked.rb +139 -135
  76. data/lib/sisimai/reason/contenterror.rb +11 -10
  77. data/lib/sisimai/reason/exceedlimit.rb +4 -4
  78. data/lib/sisimai/reason/expired.rb +20 -20
  79. data/lib/sisimai/reason/filtered.rb +19 -18
  80. data/lib/sisimai/reason/hasmoved.rb +3 -3
  81. data/lib/sisimai/reason/hostunknown.rb +19 -19
  82. data/lib/sisimai/reason/mailboxfull.rb +49 -49
  83. data/lib/sisimai/reason/mailererror.rb +16 -16
  84. data/lib/sisimai/reason/mesgtoobig.rb +17 -17
  85. data/lib/sisimai/reason/networkerror.rb +19 -19
  86. data/lib/sisimai/reason/norelaying.rb +16 -16
  87. data/lib/sisimai/reason/notaccept.rb +9 -10
  88. data/lib/sisimai/reason/onhold.rb +1 -1
  89. data/lib/sisimai/reason/policyviolation.rb +21 -20
  90. data/lib/sisimai/reason/rejected.rb +53 -53
  91. data/lib/sisimai/reason/securityerror.rb +29 -29
  92. data/lib/sisimai/reason/spamdetected.rb +127 -127
  93. data/lib/sisimai/reason/suspend.rb +17 -17
  94. data/lib/sisimai/reason/systemerror.rb +22 -21
  95. data/lib/sisimai/reason/systemfull.rb +6 -6
  96. data/lib/sisimai/reason/toomanyconn.rb +19 -18
  97. data/lib/sisimai/reason/userunknown.rb +122 -121
  98. data/lib/sisimai/reason/vacation.rb +8 -8
  99. data/lib/sisimai/reason/virusdetected.rb +8 -8
  100. data/lib/sisimai/rfc1894.rb +142 -0
  101. data/lib/sisimai/rfc3464.rb +70 -70
  102. data/lib/sisimai/rfc3834.rb +15 -15
  103. data/lib/sisimai/rfc5322.rb +20 -36
  104. data/lib/sisimai/rhost.rb +1 -0
  105. data/lib/sisimai/rhost/exchangeonline.rb +31 -33
  106. data/lib/sisimai/rhost/franceptt.rb +23 -23
  107. data/lib/sisimai/rhost/godaddy.rb +28 -28
  108. data/lib/sisimai/rhost/googleapps.rb +39 -41
  109. data/lib/sisimai/rhost/kddi.rb +3 -3
  110. data/lib/sisimai/rhost/tencentqq.rb +51 -0
  111. data/lib/sisimai/smtp/error.rb +14 -21
  112. data/lib/sisimai/smtp/reply.rb +14 -13
  113. data/lib/sisimai/smtp/status.rb +178 -179
  114. data/lib/sisimai/string.rb +13 -12
  115. data/lib/sisimai/version.rb +1 -1
  116. data/set-of-emails/README.md +1 -5
  117. data/set-of-emails/maildir/bsd/arf-23.eml +49 -0
  118. data/set-of-emails/maildir/bsd/email-amavis-01.eml +78 -0
  119. data/set-of-emails/maildir/bsd/email-amavis-02.eml +78 -0
  120. data/set-of-emails/maildir/bsd/email-exchange2007-04.eml +146 -0
  121. data/set-of-emails/maildir/bsd/email-exim-60.eml +94 -0
  122. data/set-of-emails/maildir/bsd/email-ezweb-08.eml +49 -0
  123. data/set-of-emails/maildir/bsd/email-google-19.eml +67 -0
  124. data/set-of-emails/maildir/bsd/email-mcafee-05.eml +74 -0
  125. data/set-of-emails/maildir/bsd/email-messagingserver-12.eml +99 -0
  126. data/set-of-emails/maildir/bsd/email-postfix-46.eml +81 -0
  127. data/set-of-emails/maildir/bsd/email-postfix-47.eml +79 -0
  128. data/set-of-emails/maildir/bsd/email-postfix-48.eml +79 -0
  129. data/set-of-emails/maildir/bsd/email-postfix-49.eml +141 -0
  130. data/set-of-emails/maildir/bsd/email-postfix-50.eml +143 -0
  131. data/set-of-emails/maildir/bsd/email-postfix-51.eml +73 -0
  132. data/set-of-emails/maildir/bsd/email-postfix-52.eml +79 -0
  133. data/set-of-emails/maildir/bsd/email-postfix-53.eml +76 -0
  134. data/set-of-emails/maildir/bsd/email-postfix-54.eml +73 -0
  135. data/set-of-emails/maildir/bsd/email-postfix-55.eml +74 -0
  136. data/set-of-emails/maildir/bsd/email-postfix-56.eml +78 -0
  137. data/set-of-emails/maildir/bsd/email-qmail-10.eml +50 -0
  138. data/set-of-emails/maildir/bsd/email-x2-05.eml +38 -0
  139. data/set-of-emails/maildir/bsd/rhost-google-apps-02.eml +88 -0
  140. data/set-of-emails/maildir/bsd/rhost-tencentqq-01.eml +84 -0
  141. data/set-of-emails/maildir/bsd/rhost-tencentqq-02.eml +84 -0
  142. data/set-of-emails/maildir/bsd/rhost-tencentqq-03.eml +81 -0
  143. data/set-of-emails/maildir/dos/email-amavis-01.eml +78 -0
  144. data/set-of-emails/maildir/dos/email-apachejames-01.eml +1 -2
  145. data/set-of-emails/maildir/dos/email-messagelabs-01.eml +67 -50
  146. data/set-of-emails/maildir/dos/email-x4-01.eml +31 -76
  147. data/set-of-emails/maildir/dos/rhost-tencentqq-01.eml +84 -0
  148. data/set-of-emails/maildir/mac/email-amavis-01.eml +1 -4
  149. data/set-of-emails/maildir/mac/email-apachejames-01.eml +1 -9
  150. data/set-of-emails/maildir/mac/email-messagelabs-01.eml +1 -9
  151. data/set-of-emails/maildir/mac/email-x4-01.eml +1 -5
  152. data/set-of-emails/maildir/mac/rhost-tencentqq-01.eml +1 -4
  153. metadata +35 -4
  154. data/set-of-emails/logo/horizontalversions.png +0 -0
  155. data/set-of-emails/logo/icon.png +0 -0
@@ -13,6 +13,24 @@ module Sisimai
13
13
  module NetworkError
14
14
  # Imported from p5-Sisimail/lib/Sisimai/Reason/NetworkError.pm
15
15
  class << self
16
+ Index = [
17
+ 'could not connect and send the mail to',
18
+ 'dns records for the destination computer could not be found',
19
+ 'hop count exceeded - possible mail loop',
20
+ 'host is unreachable',
21
+ 'host not found, try again',
22
+ 'mail forwarding loop for ',
23
+ 'malformed name server reply',
24
+ 'malformed or unexpected name server reply',
25
+ 'maximum forwarding loop count exceeded',
26
+ 'message looping',
27
+ 'message probably in a routing loop',
28
+ 'no route to host',
29
+ 'too many hops',
30
+ 'unable to resolve route ',
31
+ 'unrouteable mail domain',
32
+ ]
33
+
16
34
  def text; return 'networkerror'; end
17
35
  def description; return 'SMTP connection failed due to DNS look up failure or other network problems'; end
18
36
 
@@ -22,25 +40,7 @@ module Sisimai
22
40
  # true: Matched
23
41
  def match(argv1)
24
42
  return nil unless argv1
25
- index = [
26
- 'could not connect and send the mail to',
27
- 'dns records for the destination computer could not be found',
28
- 'hop count exceeded - possible mail loop',
29
- 'host is unreachable',
30
- 'host not found, try again',
31
- 'mail forwarding loop for ',
32
- 'malformed name server reply',
33
- 'malformed or unexpected name server reply',
34
- 'maximum forwarding loop count exceeded',
35
- 'message looping',
36
- 'message probably in a routing loop',
37
- 'no route to host',
38
- 'too many hops',
39
- 'unable to resolve route ',
40
- 'unrouteable mail domain',
41
- ]
42
-
43
- return true if index.any? { |a| argv1.include?(a) }
43
+ return true if Index.any? { |a| argv1.include?(a) }
44
44
  return false
45
45
  end
46
46
 
@@ -13,6 +13,21 @@ module Sisimai
13
13
  module NoRelaying
14
14
  # Imported from p5-Sisimail/lib/Sisimai/Reason/NoRelaying.pm
15
15
  class << self
16
+ Index = [
17
+ 'as a relay',
18
+ 'insecure mail relay',
19
+ 'mail server requires authentication when attempting to send to a non-local e-mail address', # MailEnable
20
+ 'not allowed to relay through this machine',
21
+ 'not an open relay, so get lost',
22
+ 'relay access denied',
23
+ 'relay denied',
24
+ 'relay not permitted',
25
+ 'relaying denied', # Sendmail
26
+ "that domain isn't in my list of allowed rcpthost",
27
+ 'this system is not configured to relay mail',
28
+ 'unable to relay for',
29
+ ]
30
+
16
31
  def text; return 'norelaying'; end
17
32
  def description; return 'Email rejected with error message "Relaying Denied"'; end
18
33
 
@@ -22,22 +37,7 @@ module Sisimai
22
37
  # true: Matched
23
38
  def match(argv1)
24
39
  return nil unless argv1
25
- index = [
26
- 'as a relay',
27
- 'insecure mail relay',
28
- 'mail server requires authentication when attempting to send to a non-local e-mail address', # MailEnable
29
- 'not allowed to relay through this machine',
30
- 'not an open relay, so get lost',
31
- 'relay access denied',
32
- 'relay denied',
33
- 'relay not permitted',
34
- 'relaying denied', # Sendmail
35
- "that domain isn't in my list of allowed rcpthost",
36
- 'this system is not configured to relay mail',
37
- 'unable to relay for',
38
- ]
39
-
40
- return true if index.any? { |a| argv1.include?(a) }
40
+ return true if Index.any? { |a| argv1.include?(a) }
41
41
  return false
42
42
  end
43
43
 
@@ -11,6 +11,14 @@ module Sisimai
11
11
  module NotAccept
12
12
  # Imported from p5-Sisimail/lib/Sisimai/Reason/NotAccept.pm
13
13
  class << self
14
+ # Destination mail server does not accept any message
15
+ Index = [
16
+ 'host/domain does not accept mail', # iCloud
17
+ 'name server: .: host not found', # Sendmail
18
+ 'no mx record found for domain=', # Oath(Yahoo!)
19
+ 'smtp protocol returned a permanent error',
20
+ ]
21
+
14
22
  def text; return 'notaccept'; end
15
23
  def description; return 'Delivery failed due to a destination mail server does not accept any email'; end
16
24
 
@@ -20,16 +28,7 @@ module Sisimai
20
28
  # true: Matched
21
29
  def match(argv1)
22
30
  return nil unless argv1
23
-
24
- # Destination mail server does not accept any message
25
- index = [
26
- 'host/domain does not accept mail', # iCloud
27
- 'name server: .: host not found', # Sendmail
28
- 'no mx record found for domain=', # Oath(Yahoo!)
29
- 'smtp protocol returned a permanent error',
30
- ]
31
-
32
- return true if index.any? { |a| argv1.include?(a) }
31
+ return true if Index.any? { |a| argv1.include?(a) }
33
32
  return false
34
33
  end
35
34
 
@@ -27,7 +27,7 @@ module Sisimai
27
27
  def true(argvs)
28
28
  return nil if argvs.deliverystatus.empty?
29
29
  return true if argvs.reason == 'onhold'
30
- return true if Sisimai::SMTP::Status.name(argvs.deliverystatus) == 'onhold'
30
+ return true if Sisimai::SMTP::Status.name(argvs.deliverystatus).to_s == 'onhold'
31
31
  return false
32
32
  end
33
33
  end
@@ -16,6 +16,26 @@ module Sisimai
16
16
  module PolicyViolation
17
17
  # Imported from p5-Sisimail/lib/Sisimai/Reason/PolicyViolation.pm
18
18
  class << self
19
+ Index = [
20
+ 'because the recipient is not accepting mail with ', # AOL Phoenix
21
+ 'closed mailing list',
22
+ 'denied by policy',
23
+ 'email not accepted for policy reasons',
24
+ # http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#554
25
+ 'email rejected due to security policies',
26
+ 'header are not accepted',
27
+ 'header error',
28
+ 'local policy violation',
29
+ 'message given low priority',
30
+ 'message not accepted for policy reasons',
31
+ 'messages with multiple addresses',
32
+ 'rejected for policy reasons',
33
+ 'protocol violation',
34
+ 'the email address used to send your message is not subscribed to this group',
35
+ 'you have exceeded the allowable number of posts without solving a captcha',
36
+ 'you have exceeded the the allowable number of posts without solving a captcha',
37
+ ]
38
+
19
39
  def text; return 'policyviolation'; end
20
40
  def description; return 'Email rejected due to policy violation on a destination host'; end
21
41
 
@@ -26,26 +46,7 @@ module Sisimai
26
46
  # @since 4.22.0
27
47
  def match(argv1)
28
48
  return nil unless argv1
29
- index = [
30
- 'because the recipient is not accepting mail with ', # AOL Phoenix
31
- 'closed mailing list',
32
- 'denied by policy',
33
- 'email not accepted for policy reasons',
34
- # http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#554
35
- 'email rejected due to security policies',
36
- 'header are not accepted',
37
- 'header error',
38
- 'message given low priority',
39
- 'message not accepted for policy reasons',
40
- 'messages with multiple addresses',
41
- 'rejected for policy reasons',
42
- 'protocol violation',
43
- 'the email address used to send your message is not subscribed to this group',
44
- 'you have exceeded the allowable number of posts without solving a captcha',
45
- 'you have exceeded the the allowable number of posts without solving a captcha',
46
- ]
47
-
48
- return true if index.any? { |a| argv1.include?(a) }
49
+ return true if Index.any? { |a| argv1.include?(a) }
49
50
  return false
50
51
  end
51
52
 
@@ -15,6 +15,52 @@ module Sisimai
15
15
  module Rejected
16
16
  # Imported from p5-Sisimail/lib/Sisimai/Reason/Rejected.pm
17
17
  class << self
18
+ IsNot = [
19
+ '5.1.0 address rejected',
20
+ 'recipient address rejected',
21
+ 'sender ip address rejected',
22
+ ]
23
+ Index = [
24
+ '<> invalid sender',
25
+ 'access denied (in reply to mail from command)',
26
+ 'address rejected',
27
+ 'administrative prohibition',
28
+ 'batv failed to verify', # SoniWall
29
+ 'batv validation failure', # SoniWall
30
+ 'backscatter protection detected an invalid or expired email address', # MDaemon
31
+ 'bogus mail from', # IMail - block empty sender
32
+ 'connections not accepted from servers without a valid sender domain',
33
+ 'denied [bouncedeny]', # McAfee
34
+ 'delivery not authorized, message refused',
35
+ 'does not exist e2110',
36
+ 'domain of sender address ',
37
+ 'emetteur invalide',
38
+ 'empty envelope senders not allowed',
39
+ 'error: no third-party dsns', # SpamWall - block empty sender
40
+ 'from: domain is invalid. please provide a valid from:',
41
+ 'fully qualified email address required', # McAfee
42
+ 'invalid domain, see <url:',
43
+ 'mail from not owned by user',
44
+ 'message rejected: email address is not verified',
45
+ 'mx records for ',
46
+ 'null sender is not allowed',
47
+ 'recipient not accepted. (batv: no tag',
48
+ 'returned mail not accepted here',
49
+ 'rfc 1035 violation: recursive cname records for',
50
+ 'rule imposed mailbox access for', # MailMarshal
51
+ 'sender email address rejected',
52
+ 'sender is spammer',
53
+ 'sender not pre-approved',
54
+ 'sender rejected',
55
+ 'sender domain is empty',
56
+ 'sender verify failed', # Exim callout
57
+ 'syntax error: empty email address',
58
+ 'the message has been rejected by batv defense',
59
+ 'transaction failed unsigned dsn for',
60
+ 'unroutable sender address',
61
+ 'you are sending to/from an address that has been blacklisted',
62
+ ]
63
+
18
64
  def text; return 'rejected'; end
19
65
  def description; return "Email rejected due to a sender's email address (envelope from)"; end
20
66
 
@@ -24,53 +70,8 @@ module Sisimai
24
70
  # true: Matched
25
71
  def match(argv1)
26
72
  return nil unless argv1
27
- isnot = [
28
- '5.1.0 address rejected',
29
- 'recipient address rejected',
30
- 'sender ip address rejected',
31
- ]
32
- index = [
33
- '<> invalid sender',
34
- 'address rejected',
35
- 'administrative prohibition',
36
- 'batv failed to verify', # SoniWall
37
- 'batv validation failure', # SoniWall
38
- 'backscatter protection detected an invalid or expired email address', # MDaemon
39
- 'bogus mail from', # IMail - block empty sender
40
- 'connections not accepted from servers without a valid sender domain',
41
- 'denied [bouncedeny]', # McAfee
42
- 'delivery not authorized, message refused',
43
- 'does not exist e2110',
44
- 'domain of sender address ',
45
- 'emetteur invalide',
46
- 'empty envelope senders not allowed',
47
- 'error: no third-party dsns', # SpamWall - block empty sender
48
- 'from: domain is invalid. please provide a valid from:',
49
- 'fully qualified email address required', # McAfee
50
- 'invalid domain, see <url:',
51
- 'mail from not owned by user',
52
- 'message rejected: email address is not verified',
53
- 'mx records for ',
54
- 'null sender is not allowed',
55
- 'recipient not accepted. (batv: no tag',
56
- 'returned mail not accepted here',
57
- 'rfc 1035 violation: recursive cname records for',
58
- 'rule imposed mailbox access for', # MailMarshal
59
- 'sender email address rejected',
60
- 'sender is spammer',
61
- 'sender not pre-approved',
62
- 'sender rejected',
63
- 'sender domain is empty',
64
- 'sender verify failed', # Exim callout
65
- 'syntax error: empty email address',
66
- 'the message has been rejected by batv defense',
67
- 'transaction failed unsigned dsn for',
68
- 'unroutable sender address',
69
- 'you are sending to/from an address that has been blacklisted',
70
- ]
71
-
72
- return false if isnot.any? { |a| argv1.include?(a) }
73
- return true if index.any? { |a| argv1.include?(a) }
73
+ return false if IsNot.any? { |a| argv1.include?(a) }
74
+ return true if Index.any? { |a| argv1.include?(a) }
74
75
  return false
75
76
  end
76
77
 
@@ -80,19 +81,18 @@ module Sisimai
80
81
  # false: is not rejected by the sender
81
82
  # @see http://www.ietf.org/rfc/rfc2822.txt
82
83
  def true(argvs)
83
- tempreason = Sisimai::SMTP::Status.name(argvs.deliverystatus)
84
- tempreason = 'undefined' if tempreason.empty?
85
- diagnostic = argvs.diagnosticcode.downcase
86
-
87
84
  return true if argvs.reason == 'rejected'
85
+ tempreason = Sisimai::SMTP::Status.name(argvs.deliverystatus) || 'undefined'
88
86
  return true if tempreason == 'rejected' # Delivery status code points "rejected".
89
87
 
90
88
  # Check the value of Diagnosic-Code: header with patterns
91
- if argvs.smtpcommand == 'MAIL'
89
+ diagnostic = argvs.diagnosticcode.downcase
90
+ commandtxt = argvs.smtpcommand
91
+ if commandtxt == 'MAIL'
92
92
  # The session was rejected at 'MAIL FROM' command
93
93
  return true if match(diagnostic)
94
94
 
95
- elsif argvs.smtpcommand == 'DATA'
95
+ elsif commandtxt == 'DATA'
96
96
  # The session was rejected at 'DATA' command
97
97
  if tempreason != 'userunknown'
98
98
  # Except "userunknown"
@@ -19,6 +19,34 @@ module Sisimai
19
19
  module SecurityError
20
20
  # Imported from p5-Sisimail/lib/Sisimai/Reason/SecurityError.pm
21
21
  class << self
22
+ Regex = %r{(?>
23
+ account[ ]not[ ]subscribed[ ]to[ ]ses
24
+ |authentification[ ]requise.+[a-z]{3}.+402
25
+ |authentication[ ](?:
26
+ credentials invalid
27
+ |failure
28
+ |failed;[ ]server[ ].+[ ]said: # Postfix
29
+ |required
30
+ |turned[ ]on[ ]in[ ]your[ ]email[ ]client
31
+ )
32
+ |\d+[ ]denied[ ]\[[a-z]+\][ ].+[(]mode:[ ].+[)]
33
+ |codes?[ ]d'?[ ]*authentification[ ]invalide.+[a-z]{3}.+305
34
+ |domain[ ].+[ ]is[ ]a[ ]dead[ ]domain
35
+ |executable[ ]files[ ]are[ ]not[ ]allowed[ ]in[ ]compressed[ ]files
36
+ |insecure[ ]mail[ ]relay
37
+ |recipient[ ]address[ ]rejected:[ ]access[ ]denied
38
+ |sorry,[ ]you[ ]don'?t[ ]authenticate[ ]or[ ]the[ ]domain[ ]isn'?t[ ]in[ ]
39
+ my[ ]list[ ]of[ ]allowed[ ]rcpthosts
40
+ |tls[ ]required[ ]but[ ]not[ ]supported # SendGrid:the recipient mailserver does not support TLS or have a valid certificate
41
+ |user[ ].+[ ]is[ ]not[ ]authorized[ ]to[ ]perform[ ]ses:sendrawemail[ ]on[ ]resource
42
+ |tls[ ]required[ ]but[ ]not[ ]supported # SendGrid:the recipient mailserver does not support TLS or have a valid certificate
43
+ |unauthenticated[ ]senders[ ]not[ ]allowed
44
+ |user[ ].+[ ]is[ ]not[ ]authorized[ ]to[ ]perform[ ]ses:sendrawemail[ ]on[ ]resource
45
+ |you[ ]are[ ]not[ ]authorized[ ]to[ ]send[ ]mail,[ ]authentication[ ]is[ ]required
46
+ |verification[ ]failure
47
+ )
48
+ }x
49
+
22
50
  def text; return 'securityerror'; end
23
51
  def description; return 'Email rejected due to security violation was detected on a destination host'; end
24
52
 
@@ -28,35 +56,7 @@ module Sisimai
28
56
  # true: Matched
29
57
  def match(argv1)
30
58
  return nil unless argv1
31
- regex = %r{(?>
32
- account[ ]not[ ]subscribed[ ]to[ ]ses
33
- |authentification[ ]requise.+[a-z]{3}.+402
34
- |authentication[ ](?:
35
- credentials invalid
36
- |failure
37
- |failed;[ ]server[ ].+[ ]said: # Postfix
38
- |required
39
- |turned[ ]on[ ]in[ ]your[ ]email[ ]client
40
- )
41
- |\d+[ ]denied[ ]\[[a-z]+\][ ].+[(]mode:[ ].+[)]
42
- |codes?[ ]d'?[ ]*authentification[ ]invalide.+[a-z]{3}.+305
43
- |domain[ ].+[ ]is[ ]a[ ]dead[ ]domain
44
- |executable[ ]files[ ]are[ ]not[ ]allowed[ ]in[ ]compressed[ ]files
45
- |insecure[ ]mail[ ]relay
46
- |recipient[ ]address[ ]rejected:[ ]access[ ]denied
47
- |sorry,[ ]you[ ]don'?t[ ]authenticate[ ]or[ ]the[ ]domain[ ]isn'?t[ ]in[ ]
48
- my[ ]list[ ]of[ ]allowed[ ]rcpthosts
49
- |tls[ ]required[ ]but[ ]not[ ]supported # SendGrid:the recipient mailserver does not support TLS or have a valid certificate
50
- |user[ ].+[ ]is[ ]not[ ]authorized[ ]to[ ]perform[ ]ses:sendrawemail[ ]on[ ]resource
51
- |tls[ ]required[ ]but[ ]not[ ]supported # SendGrid:the recipient mailserver does not support TLS or have a valid certificate
52
- |unauthenticated[ ]senders[ ]not[ ]allowed
53
- |user[ ].+[ ]is[ ]not[ ]authorized[ ]to[ ]perform[ ]ses:sendrawemail[ ]on[ ]resource
54
- |you[ ]are[ ]not[ ]authorized[ ]to[ ]send[ ]mail,[ ]authentication[ ]is[ ]required
55
- |verification[ ]failure
56
- )
57
- }x
58
-
59
- return true if argv1 =~ regex
59
+ return true if argv1 =~ Regex
60
60
  return false
61
61
  end
62
62
 
@@ -16,141 +16,141 @@ module Sisimai
16
16
  module SpamDetected
17
17
  # Imported from p5-Sisimail/lib/Sisimai/Reason/SpamDetected.pm
18
18
  class << self
19
- def text; return 'spamdetected'; end
20
- def description; return 'Email rejected by spam filter running on the remote host'; end
21
-
22
- # Try to match that the given text and regular expressions
23
- # @param [String] argv1 String to be matched with regular expressions
24
- # @return [True,False] false: Did not match
25
- # true: Matched
26
- def match(argv1)
27
- return nil unless argv1
28
- regex = %r{(?>
29
- ["]the[ ]mail[ ]server[ ]detected[ ]your[ ]message[ ]as[ ]spam[ ]and[ ]
30
- has[ ]prevented[ ]delivery[.]["] # CPanel/Exim with SA rejections on
31
- |(?:\d[.]\d[.]\d|\d{3})[ ]spam\z
32
- |appears[ ]to[ ]be[ ]unsolicited
33
- |blacklisted[ ]url[ ]in[ ]message
34
- |block[ ]for[ ]spam
35
- |blocked[ ]by[ ](?:
36
- policy:[ ]no[ ]spam[ ]please
37
- |spamassassin # rejected by SpamAssassin
38
- )
39
- |blocked[ ]for[ ]abuse[.][ ]see[ ]http://att[.]net/blocks # AT&T
40
- |bulk[ ]email
41
- |content[ ]filter[ ]rejection
42
- |cyberoam[ ]anti[ ]spam[ ]engine[ ]has[ ]identified[ ]this[ ]email[ ]as[ ]a[ ]bulk[ ]email
43
- |denied[ ]due[ ]to[ ]spam[ ]list
44
- |dt:spm[ ]mx.+[ ]http://mail[.]163[.]com/help/help_spam_16[.]htm
45
- |greylisted.?.[ ]please[ ]try[ ]again[ ]in
46
- |http://(?:www[.]spamhaus[.]org|dsbl[.]org)
47
- |listed[ ]in[ ]work[.]drbl[.]imedia[.]ru
48
- |mail[ ](?:
49
- appears[ ]to[ ]be[ ]unsolicited # rejected due to spam
50
- |content[ ]denied # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726
51
- |rejete.+[a-z]{3}.+506
52
- )
53
- |may[ ]consider[ ]spam
54
- |message[ ](?:
55
- considered[ ]as[ ]spam[ ]or[ ]virus
56
- |content[ ]rejected
57
- |filtered
58
- |filtered[.][ ](?:
59
- please[ ]see[ ]the[ ]faqs[ ]section[ ]on[ ]spam
60
- |refer[ ]to[ ]the[ ]troubleshooting[ ]page[ ]at[ ]
61
- )
62
- |looks[ ]like[ ]spam
63
- |not[ ]accepted[ ]for[ ]policy[ ]reasons[.][ ]see[ ]http: # Yahoo!
64
- |refused[ ]by[ ]mailmarshal[ ]spamprofiler
65
- |rejected[ ](?:
66
- as[ ]spam
67
- |because[ ]of[ ]unacceptable[ ]content
68
- |due[ ]to[ ]suspected[ ]spam[ ]content
69
- |for[ ]policy[ ]reasons
70
- )
71
- )
72
- |our[ ](?:
73
- email[ ]server[ ]thinks[ ]this[ ]email[ ]is[ ]spam
74
- |filters[ ]rate[ ]at[ ]and[ ]above[ ].+[ ]percent[ ]probability[ ]of[ ]being[ ]spam
75
- |system[ ]has[ ]detected[ ]that[ ]this[ ]message[ ]is
76
- )
77
- |permanent[ ]failure[ ]for[ ]one[ ]or[ ]more[ ]recipients[ ][(].+:blocked[)]
78
- |probable[ ]spam
79
- |reject[ ]bulk[.]advertising
80
- |reject,.+[ ][-][ ]spam[.][ ]
81
- |rejected(?:
82
- :[ ]spamassassin[ ]score[ ]
83
- |[ ]by[ ].+[ ][(]spam[)]
84
- |[ ]due[ ]to[ ]spam[ ](?:classification|content)
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
+ |appears[ ]to[ ]be[ ]unsolicited
24
+ |blacklisted[ ]url[ ]in[ ]message
25
+ |block[ ]for[ ]spam
26
+ |blocked[ ]by[ ](?:
27
+ policy:[ ]no[ ]spam[ ]please
28
+ |spamassassin # rejected by SpamAssassin
29
+ )
30
+ |blocked[ ]for[ ]abuse[.][ ]see[ ]http://att[.]net/blocks # AT&T
31
+ |bulk[ ]email
32
+ |content[ ]filter[ ]rejection
33
+ |cyberoam[ ]anti[ ]spam[ ]engine[ ]has[ ]identified[ ]this[ ]email[ ]as[ ]a[ ]bulk[ ]email
34
+ |denied[ ]due[ ]to[ ]spam[ ]list
35
+ |dt:spm[ ]mx.+[ ]http://mail[.]163[.]com/help/help_spam_16[.]htm
36
+ |greylisted.?.[ ]please[ ]try[ ]again[ ]in
37
+ |http://(?:www[.]spamhaus[.]org|dsbl[.]org)
38
+ |listed[ ]in[ ]work[.]drbl[.]imedia[.]ru
39
+ |mail[ ](?:
40
+ appears[ ]to[ ]be[ ]unsolicited # rejected due to spam
41
+ |content[ ]denied # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726
42
+ |rejete.+[a-z]{3}.+506
43
+ )
44
+ |may[ ]consider[ ]spam
45
+ |message[ ](?:
46
+ considered[ ]as[ ]spam[ ]or[ ]virus
47
+ |content[ ]rejected
48
+ |filtered
49
+ |filtered[.][ ](?:
50
+ please[ ]see[ ]the[ ]faqs[ ]section[ ]on[ ]spam
51
+ |refer[ ]to[ ]the[ ]troubleshooting[ ]page[ ]at[ ]
85
52
  )
86
- |rejecting[ ]banned[ ]content
87
- |related[ ]to[ ]content[ ]with[ ]spam[-]like[ ]characteristics
88
- |rule[ ]imposed[ ]as[ ].+is[ ]blacklisted[ ]on # Mailmarshal RBLs
89
- |sender[ ]domain[ ]listed[ ]at[ ].+
90
- |sending[ ]address[ ]not[ ]accepted[ ]due[ ]to[ ]spam[ ]filter
91
- |spam[ ](?:
92
- .+[ ]exceeded
93
- |blocked
94
- |check
95
- |content[ ]matched
96
- |detected
97
- |email
98
- |email[ ]not[ ]accepted
99
- |message[ ]rejected[.] # mail.ru
100
- |not[ ]accepted
101
- |refused
102
- |rejection
103
- |reporting[ ]address # SendGrid: a message to an address has previously been marked as Spam by the recipient.
104
- |score[ ]
53
+ |looks[ ]like[ ]spam
54
+ |not[ ]accepted[ ]for[ ]policy[ ]reasons[.][ ]see[ ]http: # Yahoo!
55
+ |refused[ ]by[ ]mailmarshal[ ]spamprofiler
56
+ |rejected[ ](?:
57
+ as[ ]spam
58
+ |because[ ]of[ ]unacceptable[ ]content
59
+ |due[ ]to[ ]suspected[ ]spam[ ]content
60
+ |for[ ]policy[ ]reasons
105
61
  )
106
- |spambouncer[ ]identified[ ]spam # SpamBouncer identified SPAM
107
- |spamming[ ]not[ ]allowed
108
- |too[ ]much[ ]spam[.] # Earthlink
109
- |the[ ]message[ ](?:
110
- has[ ]been[ ]rejected[ ]by[ ]spam[ ]filtering[ ]engine
111
- |was[ ]rejected[ ]due[ ]to[ ]classification[ ]as[ ]bulk[ ]mail
62
+ )
63
+ |our[ ](?:
64
+ email[ ]server[ ]thinks[ ]this[ ]email[ ]is[ ]spam
65
+ |filters[ ]rate[ ]at[ ]and[ ]above[ ].+[ ]percent[ ]probability[ ]of[ ]being[ ]spam
66
+ |system[ ]has[ ]detected[ ]that[ ]this[ ]message[ ]is
67
+ )
68
+ |permanent[ ]failure[ ]for[ ]one[ ]or[ ]more[ ]recipients[ ][(].+:blocked[)]
69
+ |probable[ ]spam
70
+ |reject[ ]bulk[.]advertising
71
+ |reject,.+[ ][-][ ]spam[.][ ]
72
+ |rejected(?:
73
+ :[ ]spamassassin[ ]score[ ]
74
+ |[ ]by[ ].+[ ][(]spam[)]
75
+ |[ ]due[ ]to[ ]spam[ ](?:classification|content)
76
+ )
77
+ |rejecting[ ]banned[ ]content
78
+ |related[ ]to[ ]content[ ]with[ ]spam[-]like[ ]characteristics
79
+ |rule[ ]imposed[ ]as[ ].+is[ ]blacklisted[ ]on # Mailmarshal RBLs
80
+ |sender[ ]domain[ ]listed[ ]at[ ].+
81
+ |sending[ ]address[ ]not[ ]accepted[ ]due[ ]to[ ]spam[ ]filter
82
+ |spam[ ](?:
83
+ .+[ ]exceeded
84
+ |blocked
85
+ |check
86
+ |content[ ]matched
87
+ |detected
88
+ |email
89
+ |email[ ]not[ ]accepted
90
+ |message[ ]rejected[.] # mail.ru
91
+ |not[ ]accepted
92
+ |refused
93
+ |rejection
94
+ |reporting[ ]address # SendGrid: a message to an address has previously been marked as Spam by the recipient.
95
+ |score[ ]
96
+ )
97
+ |spambouncer[ ]identified[ ]spam # SpamBouncer identified SPAM
98
+ |spamming[ ]not[ ]allowed
99
+ |too[ ]much[ ]spam[.] # Earthlink
100
+ |the[ ]message[ ](?:
101
+ has[ ]been[ ]rejected[ ]by[ ]spam[ ]filtering[ ]engine
102
+ |was[ ]rejected[ ]due[ ]to[ ]classification[ ]as[ ]bulk[ ]mail
103
+ )
104
+ |the[ ]content[ ]of[ ]this[ ]message[ ]looked[ ]like[ ]spam # SendGrid
105
+ |this[ ](?:e-mail|mail)[ ](?:
106
+ cannot[ ]be[ ]forwarded[ ]because[ ]it[ ]was[ ]detected[ ]as[ ]spam
107
+ |is[ ]classified[ ]as[ ]spam[ ]and[ ]is[ ]rejected
108
+ )
109
+ |this[ ]message[ ](?:
110
+ appears[ ]to[ ]be[ ]spam
111
+ |has[ ]been[ ](?:
112
+ identified[ ]as[ ]spam
113
+ |scored[ ]as[ ]spam[ ]with[ ]a[ ]probability
112
114
  )
113
- |the[ ]content[ ]of[ ]this[ ]message[ ]looked[ ]like[ ]spam # SendGrid
114
- |this[ ](?:e-mail|mail)[ ](?:
115
- cannot[ ]be[ ]forwarded[ ]because[ ]it[ ]was[ ]detected[ ]as[ ]spam
116
- |is[ ]classified[ ]as[ ]spam[ ]and[ ]is[ ]rejected
115
+ |scored[ ].+[ ]spam[ ]points
116
+ |was[ ]classified[ ]as[ ]spam
117
+ |was[ ]rejected[ ]by[ ]recurrent[ ]pattern[ ]detection[ ]system
118
+ )
119
+ |transaction[ ]failed[ ]spam[ ]message[ ]not[ ]queued # SendGrid
120
+ |we[ ]dont[ ]accept[ ]spam
121
+ |you're[ ]using[ ]a[ ]mass[ ]mailer
122
+ |your[ ](?:
123
+ email[ ](?:
124
+ appears[ ]similar[ ]to[ ]spam[ ]we[ ]have[ ]received[ ]before
125
+ |breaches[ ]local[ ]uribl[ ]policy
126
+ |had[ ]spam[-]like[ ]
127
+ |is[ ](?:considered|probably)[ ]spam
128
+ |was[ ]detected[ ]as[ ]spam
117
129
  )
118
- |this[ ]message[ ](?:
119
- appears[ ]to[ ]be[ ]spam
130
+ |message[ ](?:
131
+ as[ ]spam[ ]and[ ]has[ ]prevented[ ]delivery
120
132
  |has[ ]been[ ](?:
121
- identified[ ]as[ ]spam
122
- |scored[ ]as[ ]spam[ ]with[ ]a[ ]probability
123
- )
124
- |scored[ ].+[ ]spam[ ]points
125
- |was[ ]classified[ ]as[ ]spam
126
- |was[ ]rejected[ ]by[ ]recurrent[ ]pattern[ ]detection[ ]system
127
- )
128
- |transaction[ ]failed[ ]spam[ ]message[ ]not[ ]queued # SendGrid
129
- |we[ ]dont[ ]accept[ ]spam
130
- |you're[ ]using[ ]a[ ]mass[ ]mailer
131
- |your[ ](?:
132
- email[ ](?:
133
- appears[ ]similar[ ]to[ ]spam[ ]we[ ]have[ ]received[ ]before
134
- |breaches[ ]local[ ]uribl[ ]policy
135
- |had[ ]spam[-]like[ ]
136
- |is[ ](?:considered|probably)[ ]spam
137
- |was[ ]detected[ ]as[ ]spam
138
- )
139
- |message[ ](?:
140
- as[ ]spam[ ]and[ ]has[ ]prevented[ ]delivery
141
- |has[ ]been[ ](?:
142
- temporarily[ ]blocked[ ]by[ ]our[ ]filter
143
- |rejected[ ]because[ ]it[ ]appears[ ]to[ ]be[ ]spam
144
- )
145
- |has[ ]triggered[ ]a[ ]spam[ ]block
146
- |may[ ]contain[ ]the[ ]spam[ ]contents
147
- |failed[ ]several[ ]antispam[ ]checks
133
+ temporarily[ ]blocked[ ]by[ ]our[ ]filter
134
+ |rejected[ ]because[ ]it[ ]appears[ ]to[ ]be[ ]spam
148
135
  )
136
+ |has[ ]triggered[ ]a[ ]spam[ ]block
137
+ |may[ ]contain[ ]the[ ]spam[ ]contents
138
+ |failed[ ]several[ ]antispam[ ]checks
149
139
  )
150
140
  )
151
- }x
141
+ )
142
+ }x
152
143
 
153
- return true if argv1 =~ regex
144
+ def text; return 'spamdetected'; end
145
+ def description; return 'Email rejected by spam filter running on the remote host'; end
146
+
147
+ # Try to match that the given text and regular expressions
148
+ # @param [String] argv1 String to be matched with regular expressions
149
+ # @return [True,False] false: Did not match
150
+ # true: Matched
151
+ def match(argv1)
152
+ return nil unless argv1
153
+ return true if argv1 =~ Regex
154
154
  return false
155
155
  end
156
156
 
@@ -162,7 +162,7 @@ module Sisimai
162
162
  def true(argvs)
163
163
  return nil if argvs.deliverystatus.empty?
164
164
  return true if argvs.reason == 'spamdetected'
165
- return true if Sisimai::SMTP::Status.name(argvs.deliverystatus) == 'spamdetected'
165
+ return true if Sisimai::SMTP::Status.name(argvs.deliverystatus).to_s == 'spamdetected'
166
166
  return true if match(argvs.diagnosticcode.downcase)
167
167
  return false
168
168
  end