sisimai 5.5.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake-test.yml +0 -4
  3. data/ChangeLog.md +53 -0
  4. data/LICENSE +1 -1
  5. data/README-JA.md +26 -20
  6. data/README.md +30 -25
  7. data/lib/sisimai/address.rb +8 -31
  8. data/lib/sisimai/arf.rb +3 -5
  9. data/lib/sisimai/fact.rb +26 -36
  10. data/lib/sisimai/lhost/activehunter.rb +0 -2
  11. data/lib/sisimai/lhost/amazonses.rb +7 -9
  12. data/lib/sisimai/lhost/apachejames.rb +0 -1
  13. data/lib/sisimai/lhost/biglobe.rb +0 -16
  14. data/lib/sisimai/lhost/courier.rb +5 -4
  15. data/lib/sisimai/lhost/deutschetelekom.rb +120 -0
  16. data/lib/sisimai/lhost/domino.rb +0 -3
  17. data/lib/sisimai/lhost/dragonfly.rb +0 -27
  18. data/lib/sisimai/lhost/einsundeins.rb +1 -10
  19. data/lib/sisimai/lhost/exchange2003.rb +4 -4
  20. data/lib/sisimai/lhost/exchange2007.rb +5 -6
  21. data/lib/sisimai/lhost/exim.rb +35 -85
  22. data/lib/sisimai/lhost/ezweb.rb +12 -49
  23. data/lib/sisimai/lhost/fml.rb +4 -29
  24. data/lib/sisimai/lhost/gmail.rb +0 -23
  25. data/lib/sisimai/lhost/gmx.rb +7 -24
  26. data/lib/sisimai/lhost/googlegroups.rb +3 -3
  27. data/lib/sisimai/lhost/googleworkspace.rb +0 -4
  28. data/lib/sisimai/lhost/imailserver.rb +3 -9
  29. data/lib/sisimai/lhost/kddi.rb +6 -20
  30. data/lib/sisimai/lhost/mailfoundry.rb +0 -2
  31. data/lib/sisimai/lhost/mailmarshal.rb +1 -3
  32. data/lib/sisimai/lhost/messagingserver.rb +4 -15
  33. data/lib/sisimai/lhost/mfilter.rb +0 -1
  34. data/lib/sisimai/lhost/mimecast.rb +0 -1
  35. data/lib/sisimai/lhost/notes.rb +1 -2
  36. data/lib/sisimai/lhost/opensmtpd.rb +0 -40
  37. data/lib/sisimai/lhost/postfix.rb +10 -11
  38. data/lib/sisimai/lhost/qmail.rb +14 -81
  39. data/lib/sisimai/lhost/sendmail.rb +4 -4
  40. data/lib/sisimai/lhost/trendmicro.rb +3 -3
  41. data/lib/sisimai/lhost/v5sendmail.rb +0 -1
  42. data/lib/sisimai/lhost/verizon.rb +1 -2
  43. data/lib/sisimai/lhost/x1.rb +1 -2
  44. data/lib/sisimai/lhost/x2.rb +0 -2
  45. data/lib/sisimai/lhost/x3.rb +4 -9
  46. data/lib/sisimai/lhost/x6.rb +0 -1
  47. data/lib/sisimai/lhost/zoho.rb +0 -12
  48. data/lib/sisimai/lhost.rb +38 -19
  49. data/lib/sisimai/message.rb +3 -1
  50. data/lib/sisimai/order.rb +4 -1
  51. data/lib/sisimai/reason/authfailure.rb +9 -13
  52. data/lib/sisimai/reason/badreputation.rb +7 -7
  53. data/lib/sisimai/reason/blocked.rb +57 -83
  54. data/lib/sisimai/reason/contenterror.rb +16 -8
  55. data/lib/sisimai/reason/{mesgtoobig.rb → emailtoolarge.rb} +22 -25
  56. data/lib/sisimai/reason/expired.rb +27 -23
  57. data/lib/sisimai/reason/filtered.rb +13 -17
  58. data/lib/sisimai/reason/hasmoved.rb +2 -1
  59. data/lib/sisimai/reason/hostunknown.rb +25 -19
  60. data/lib/sisimai/reason/mailboxfull.rb +28 -49
  61. data/lib/sisimai/reason/networkerror.rb +28 -16
  62. data/lib/sisimai/reason/norelaying.rb +21 -20
  63. data/lib/sisimai/reason/notaccept.rb +13 -8
  64. data/lib/sisimai/reason/notcompliantrfc.rb +6 -9
  65. data/lib/sisimai/reason/policyviolation.rb +17 -26
  66. data/lib/sisimai/reason/ratelimited.rb +62 -0
  67. data/lib/sisimai/reason/rejected.rb +51 -59
  68. data/lib/sisimai/reason/requireptr.rb +13 -25
  69. data/lib/sisimai/reason/securityerror.rb +14 -19
  70. data/lib/sisimai/reason/spamdetected.rb +51 -101
  71. data/lib/sisimai/reason/suspend.rb +30 -24
  72. data/lib/sisimai/reason/syntaxerror.rb +1 -8
  73. data/lib/sisimai/reason/systemerror.rb +37 -23
  74. data/lib/sisimai/reason/systemfull.rb +1 -1
  75. data/lib/sisimai/reason/userunknown.rb +81 -112
  76. data/lib/sisimai/reason/virusdetected.rb +6 -8
  77. data/lib/sisimai/reason.rb +15 -15
  78. data/lib/sisimai/rfc1123.rb +1 -1
  79. data/lib/sisimai/rfc1894.rb +7 -6
  80. data/lib/sisimai/rfc2045.rb +2 -2
  81. data/lib/sisimai/rfc3464/thirdparty.rb +1 -1
  82. data/lib/sisimai/rfc3464.rb +10 -14
  83. data/lib/sisimai/rfc3834.rb +3 -4
  84. data/lib/sisimai/rfc791.rb +3 -38
  85. data/lib/sisimai/rhost/apple.rb +5 -5
  86. data/lib/sisimai/rhost/cloudflare.rb +2 -0
  87. data/lib/sisimai/rhost/cox.rb +22 -20
  88. data/lib/sisimai/rhost/facebook.rb +16 -16
  89. data/lib/sisimai/rhost/franceptt.rb +8 -3
  90. data/lib/sisimai/rhost/godaddy.rb +33 -15
  91. data/lib/sisimai/rhost/google.rb +63 -64
  92. data/lib/sisimai/rhost/iua.rb +1 -1
  93. data/lib/sisimai/rhost/messagelabs.rb +12 -12
  94. data/lib/sisimai/rhost/microsoft.rb +86 -86
  95. data/lib/sisimai/rhost/mimecast.rb +34 -34
  96. data/lib/sisimai/rhost/nttdocomo.rb +2 -2
  97. data/lib/sisimai/rhost/spectrum.rb +7 -7
  98. data/lib/sisimai/rhost/tencent.rb +9 -11
  99. data/lib/sisimai/rhost/yahooinc.rb +7 -8
  100. data/lib/sisimai/rhost.rb +1 -1
  101. data/lib/sisimai/smtp/command.rb +2 -0
  102. data/lib/sisimai/smtp/status.rb +73 -109
  103. data/lib/sisimai/string.rb +0 -27
  104. data/lib/sisimai/version.rb +1 -1
  105. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-01.eml +66 -0
  106. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-02.eml +68 -0
  107. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-03.eml +50 -0
  108. data/set-of-emails/should-not-crash/p5-664-iomart-mail-filter.eml +258 -0
  109. data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/.gitkeep +0 -0
  110. metadata +10 -6
  111. data/lib/sisimai/reason/exceedlimit.rb +0 -47
  112. data/lib/sisimai/reason/speeding.rb +0 -47
  113. data/lib/sisimai/reason/toomanyconn.rb +0 -59
@@ -10,27 +10,27 @@ module Sisimai
10
10
  module NoRelaying
11
11
  class << self
12
12
  Index = [
13
- 'as a relay',
14
- 'email address is not verified.',
15
- 'insecure mail relay',
16
- 'is not permitted to relay through this server without authentication',
17
- 'mail server requires authentication when attempting to send to a non-local e-mail address', # MailEnable
18
- 'no relaying',
19
- 'not a gateway',
20
- 'not allowed to relay through this machine',
21
- 'not an open relay, so get lost',
22
- 'not local host',
23
- 'relay access denied',
24
- 'relay denied',
25
- 'relay not permitted',
26
- 'relaying denied', # Sendmail
27
- 'relaying mail to ',
28
- 'specified domain is not allowed',
29
- "that domain isn't in my list of allowed rcpthost",
30
- 'this system is not configured to relay mail',
31
- 'unable to relay ',
13
+ "as a relay",
14
+ "domain isn't in my list of allowed rcpthost",
15
+ "email address is not verified.",
16
+ "insecure mail relay",
17
+ "no relaying",
18
+ "not a gateway",
19
+ "not local host",
20
+ "open relay",
21
+ "relay not permitted",
22
+ "relay prohibition",
23
+ "relaying denied", # Sendmail
24
+ "relaying mail to ",
25
+ "send to a non-local e-mail address", # MailEnable
26
+ "specified domain is not allowed",
27
+ "unable to relay ",
32
28
  "we don't handle mail for",
33
29
  ].freeze
30
+ Pairs = [
31
+ ["relay ", "denied"],
32
+ ["n", "t ", "to relay"],
33
+ ].freeze
34
34
 
35
35
  def text; return 'norelaying'; end
36
36
  def description; return 'Email rejected with error message "Relaying Denied"'; end
@@ -41,6 +41,7 @@ module Sisimai
41
41
  def match(argv1)
42
42
  return false if argv1.nil? || argv1.empty?
43
43
  return true if Index.any? { |a| argv1.include?(a) }
44
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
44
45
  return false
45
46
  end
46
47
 
@@ -51,8 +52,8 @@ module Sisimai
51
52
  # @see http://www.ietf.org/rfc/rfc2822.txt
52
53
  def true(argvs)
53
54
  r = argvs['reason'] || ''
55
+ return false if Sisimai::SMTP::Command::BeforeRCPT.include?(argvs['command'])
54
56
  return false if r.start_with?('securityerror', 'systemerror', 'undefined')
55
- return false if %w[CONN EHLO HELO].include?(argvs['command'])
56
57
  return match(argvs['diagnosticcode'].downcase)
57
58
  end
58
59
 
@@ -11,13 +11,17 @@ module Sisimai
11
11
  class << self
12
12
  # Destination mail server does not accept any message
13
13
  Index = [
14
- 'does not accept mail', # Sendmail
15
- 'host/domain does not accept mail', # iCloud
16
- 'mail receiving disabled',
17
- 'name server: .: host not found', # Sendmail
18
- 'no mx record found for domain=', # Oath(Yahoo!)
19
- 'no route for current request',
20
- 'smtp protocol returned a permanent error',
14
+ "destination seem to reject all mails", # OpenSMTPD/smtp/mta.c
15
+ "does not accept mail", # Sendmail, iCloud
16
+ "mail receiving disabled",
17
+ "mx or srv record indicated no smtp ", # Exim/routers/dnslookup.c:328
18
+ "name server: .: host not found", # Sendmail
19
+ "no host found for existing smtp ", # Exim/transports/smtp.c:3502
20
+ "no route for current request",
21
+ "null mx",
22
+ ].freeze
23
+ Pairs = [
24
+ ["no mx ", "found for "], # OpenSMTPD/smtp/mta.c
21
25
  ].freeze
22
26
 
23
27
  def text; return 'notaccept'; end
@@ -29,6 +33,7 @@ module Sisimai
29
33
  def match(argv1)
30
34
  return false if argv1.nil? || argv1.empty?
31
35
  return true if Index.any? { |a| argv1.include?(a) }
36
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
32
37
  return false
33
38
  end
34
39
 
@@ -40,7 +45,7 @@ module Sisimai
40
45
  def true(argvs)
41
46
  return true if argvs['reason'] == 'notaccept'
42
47
  return true if [521, 556].index(argvs['replycode'].to_i) # SMTP Reply Code is 554 or 556
43
- return false if argvs['command'] != 'MAIL'
48
+ return false if Sisimai::SMTP::Command::BeforeRCPT.include?(argvs['command'])
44
49
  return match(argvs['diagnosticcode'].downcase)
45
50
  end
46
51
 
@@ -7,16 +7,14 @@ module Sisimai
7
7
  # example, there are multiple "Subject" headers in the email.
8
8
  module NotCompliantRFC
9
9
  class << self
10
- require 'sisimai/string'
11
10
  Index = [
12
- 'duplicate header',
13
- 'this message is not rfc 5322 compliant',
14
- 'https://support.google.com/mail/?p=rfcmessagenoncompliant',
11
+ "duplicate header",
12
+ "duplicated message-id",
13
+ "message is not rfc 5322 compliant",
14
+ "multiple addresses in from: header are not accepted",
15
+ "rfc 1035 violation",
16
+ "https://support.google.com/mail/?p=rfcmessagenoncompliant",
15
17
  ].freeze
16
- Pairs = [
17
- [' multiple ', ' header'],
18
- ].freeze
19
-
20
18
 
21
19
  def text; return 'notcompliantrfc'; end
22
20
  def description; return 'Email rejected due to non-compliance with RFC'; end
@@ -27,7 +25,6 @@ module Sisimai
27
25
  def match(argv1)
28
26
  return false if argv1.nil? || argv1.empty?
29
27
  return true if Index.any? { |a| argv1.include?(a) }
30
- return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
31
28
  return false
32
29
  end
33
30
 
@@ -14,34 +14,22 @@ module Sisimai
14
14
  #
15
15
  module PolicyViolation
16
16
  class << self
17
- require 'sisimai/string'
18
-
19
17
  Index = [
20
- 'an illegal attachment on your message',
21
- 'because the recipient is not accepting mail with ', # AOL Phoenix
22
- 'closed mailing list',
23
- 'denied by policy',
24
- 'email not accepted for policy reasons',
18
+ "because the recipient is not accepting mail with ", # AOL Phoenix
19
+ "closed mailing list",
20
+ "delivery not authorized, message refused",
21
+ "denied by policy",
25
22
  # http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#554
26
- 'email rejected due to security policies',
27
- 'header are not accepted',
28
- 'header error',
29
- 'local policy violation',
30
- 'message bounced due to organizational settings',
31
- 'message given low priority',
32
- 'message not accepted for policy reasons',
33
- 'message rejected due to local policy',
34
- 'messages with multiple addresses',
35
- 'rejected for policy reasons',
36
- 'protocol violation',
37
- 'the message was rejected by organization policy',
38
- 'this message was blocked because its content presents a potential', # https://support.google.com/mail/answer/6590
39
- 'we do not accept messages containing images or other attachments',
23
+ "email rejected due to security policies",
24
+ "for policy reasons",
25
+ "local policy violation",
26
+ "message bounced due to organizational settings",
27
+ "message given low priority",
28
+ "message was rejected by organization policy",
29
+ "protocol violation",
30
+ "support.google.com/a/answer/172179",
40
31
  "you're using a mass mailer",
41
32
  ].freeze
42
- Pairs = [
43
- ['you have exceeded the', 'allowable number of posts without solving a captcha'],
44
- ].freeze
45
33
 
46
34
  def text; return 'policyviolation'; end
47
35
  def description; return 'Email rejected due to policy violation on a destination host'; end
@@ -53,7 +41,6 @@ module Sisimai
53
41
  def match(argv1)
54
42
  return false if argv1.nil? || argv1.empty?
55
43
  return true if Index.any? { |a| argv1.include?(a) }
56
- return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
57
44
  return false
58
45
  end
59
46
 
@@ -63,7 +50,11 @@ module Sisimai
63
50
  # false: is not policy violation
64
51
  # @since 4.22.0
65
52
  # @see http://www.ietf.org/rfc/rfc2822.txt
66
- def true(_argvs); return false; end
53
+ def true(argvs)
54
+ return true if argvs['reason'] == 'policyviolation'
55
+ return false if argvs['command'] != '' && argvs['command'] != 'DATA'
56
+ return match(argvs['diagnosticcode'].downcase)
57
+ end
67
58
 
68
59
  end
69
60
  end
@@ -0,0 +1,62 @@
1
+ module Sisimai
2
+ module Reason
3
+ # Sisimai::Reason::RateLimited checks the bounce reason is "ratelimited" or not. This class is
4
+ # called only Sisimai::Reason class.
5
+ #
6
+ # This is the error that SMTP connection was rejected temporarily due to too many recipients or
7
+ # too many concurrency connections to the remote server. This reason has added in Sisimai 4.1.26.
8
+ #
9
+ # <kijitora@example.ne.jp>: host mx02.example.ne.jp[192.0.1.20] said:
10
+ # 452 4.3.2 Connection rate limit exceeded. (in reply to MAIL FROM command)
11
+ module RateLimited
12
+ class << self
13
+ Index = [
14
+ "has exceeded the max emails per hour ",
15
+ "please try again slower",
16
+ "receiving mail at a rate that prevents additional messages from being delivered",
17
+ "temporarily deferred due to unexpected volume or user complaints",
18
+ "throttling failure: ",
19
+ "too many errors from your ip", # Free.fr
20
+ "too many recipients", # ntt docomo
21
+ "too many smtp sessions for this host", # Sendmail(daemon.c)
22
+ "trop de connexions, ",
23
+ "we have already made numerous attempts to deliver this message",
24
+ ].freeze
25
+ Pairs = [
26
+ ["exceeded ", "allowable number of posts without solving a captcha"],
27
+ ["connection ", "limit"],
28
+ ["temporarily", "rate limited"],
29
+ ["too many con", "s"],
30
+ ].freeze
31
+
32
+ def text; return 'ratelimited'; end
33
+ def description; return 'SMTP connection rejected temporarily due to too many concurrency connections to the remote host'; end
34
+
35
+ # Try to match that the given text and regular expressions
36
+ # @param [String] argv1 String to be matched with regular expressions
37
+ # @return [Boolean] false: Did not match, true: Matched
38
+ def match(argv1)
39
+ return false if argv1.nil? || argv1.empty?
40
+ return true if Index.any? { |a| argv1.include?(a) }
41
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
42
+ return false
43
+ end
44
+
45
+ # Rejected by domain or address filter ?
46
+ # @param [Sisimai::Fact] argvs Object to be detected the reason
47
+ # @return [Boolean] true: is rate limited
48
+ # false: is not rate limited
49
+ # @see http://www.ietf.org/rfc/rfc2822.txt
50
+ def true(argvs)
51
+ return true if argvs['reason'] == 'ratelimited'
52
+ return true if Sisimai::SMTP::Status.name(argvs['deliverystatus']) == 'ratelimited'
53
+ return match(argvs['diagnosticcode'].downcase)
54
+ end
55
+
56
+ end
57
+ end
58
+ end
59
+ end
60
+
61
+
62
+
@@ -14,68 +14,59 @@ module Sisimai
14
14
  module Rejected
15
15
  class << self
16
16
  IsNot = [
17
- '5.1.0 address rejected',
18
- 'recipient address rejected',
19
- 'sender ip address rejected',
17
+ "5.1.0 address rejected",
18
+ "ip address ",
19
+ "recipient address rejected",
20
20
  ].freeze
21
21
  Index = [
22
- 'access denied (in reply to mail from command)',
23
- 'access denied (sender blacklisted)',
24
- 'address rejected',
25
- 'administrative prohibition',
26
- 'batv failed to verify', # SonicWall
27
- 'batv validation failure', # SonicWall
28
- 'backscatter protection detected an invalid or expired email address', # MDaemon
29
- "because the sender isn't on the recipient's list of senders to accept mail from",
30
- 'bogus mail from', # IMail - block empty sender
31
- 'by non-member to a members-only list',
22
+ "access denied (in reply to mail from command)",
23
+ "administrative prohibition",
24
+ "all recipient addresses rejected : access denied",
25
+ "badsendermx", # BadSenderMX
26
+ "backscatter protection detected an invalid or expired email address", # MDaemon
27
+ "by non-member to a members-only list",
32
28
  "can't determine purported responsible address",
33
- 'connections not accepted from servers without a valid sender domain',
34
- 'denied [bouncedeny]', # McAfee
35
- 'denied by secumail valid-address-filter',
36
- 'delivery not authorized, message refused',
37
- 'does not exist e2110',
38
- 'domain of sender address ',
39
- 'email address is on senderfilterconfig list',
40
- 'emetteur invalide',
41
- 'empty envelope senders not allowed',
42
- 'envelope blocked - ',
43
- 'error: no third-party dsns', # SpamWall - block empty sender
44
- 'from: domain is invalid. please provide a valid from:',
45
- 'fully qualified email address required', # McAfee
46
- 'invalid domain, see <url:',
47
- 'invalid sender',
48
- 'is not a registered gateway user',
49
- 'mail from not owned by user',
50
- 'message rejected: email address is not verified',
51
- 'mx records for ',
52
- 'null sender is not allowed',
53
- 'recipient addresses rejected : access denied',
54
- 'recipient not accepted. (batv: no tag',
55
- 'returned mail not accepted here',
56
- 'rfc 1035 violation: recursive cname records for',
57
- 'rule imposed mailbox access for', # MailMarshal
58
- 'sending this from a different address or alias using the ',
59
- 'sender address has been blacklisted',
60
- 'sender email address rejected',
61
- 'sender is in my black list',
62
- 'sender is spammer',
63
- 'sender not pre-approved',
64
- 'sender rejected',
65
- 'sender domain is empty',
66
- 'sender verify failed', # Exim callout
67
- 'sender was rejected', # qmail
68
- 'spam reporting address', # SendGrid|a message to an address has previously been marked as Spam by the recipient.
69
- 'syntax error: empty email address',
70
- 'the email address used to send your message is not subscribed to this group',
71
- 'the message has been rejected by batv defense',
72
- 'this server does not accept mail from',
73
- 'transaction failed unsigned dsn for',
74
- 'unroutable sender address',
75
- 'you are not allowed to post to this mailing list',
76
- 'you are sending to/from an address that has been blacklisted',
77
- 'your access to submit messages to this e-mail system has been rejected',
78
- 'your email address has been blacklisted', # MessageLabs
29
+ "connections not accepted from servers without a valid sender domain",
30
+ "denied by secumail valid-address-filter", # SecuMail
31
+ "domain of sender address ",
32
+ "email address is on senderfilterconfig list",
33
+ "emetteur invalide",
34
+ "empty email address",
35
+ "empty envelope senders not allowed",
36
+ "from: domain is invalid. please provide a valid from:",
37
+ "fully qualified email address required", # McAfee
38
+ "has an outgoing mail suspension",
39
+ "invalid sender",
40
+ "is not a registered gateway user",
41
+ "mail from not owned by user",
42
+ "mailfrom domain is listed in spamhaus",
43
+ "not member article from ", # FML
44
+ "null sender is not allowed",
45
+ "returned mail not accepted here",
46
+ "sending this from a different address or alias using the ",
47
+ "sender is spammer",
48
+ "sender not pre-approved",
49
+ "sender domain is empty",
50
+ "sender domain listed at ",
51
+ "sender verify failed", # Exim callout
52
+ "sendernoa", # SenderNoA
53
+ "server does not accept mail from",
54
+ "spam reporting address", # SendGrid|a message to an address has previously been marked as Spam by the recipient.
55
+ "too many spam complaints",
56
+ "unroutable sender address",
57
+ "you are not allowed to post to this mailing list",
58
+ "your access to submit messages to this e-mail system has been rejected",
59
+ "your email address has been blacklisted", # MessageLabs
60
+ ].freeze
61
+ Pairs = [
62
+ ["after end of data:", ".", " does not exist"],
63
+ ["after mail from:", ".", " does not exist"],
64
+ ["domain ", " is a dead domain"],
65
+ ["email address ", "is not "],
66
+ ["reject mail from ", "@"], # FML
67
+ ["send", "blacklisted"],
68
+ ["sender", " rejected"],
69
+ ["sender is", " list"],
79
70
  ].freeze
80
71
 
81
72
  def text; return 'rejected'; end
@@ -88,6 +79,7 @@ module Sisimai
88
79
  return false if argv1.nil? || argv1.empty?
89
80
  return false if IsNot.any? { |a| argv1.include?(a) }
90
81
  return true if Index.any? { |a| argv1.include?(a) }
82
+ return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
91
83
  return false
92
84
  end
93
85
 
@@ -6,35 +6,23 @@ module Sisimai
6
6
  # SMTP connection.
7
7
  module RequirePTR
8
8
  class << self
9
- require 'sisimai/string'
10
-
11
9
  Index = [
12
- 'access denied. ip name lookup failed',
13
- 'all mail servers must have a ptr record with a valid reverse dns entry',
14
- 'bad dns ptr resource record',
15
- 'cannot find your hostname',
10
+ "cannot find your hostname",
16
11
  "cannot resolve your address.",
17
- 'client host rejected: cannot find your hostname', # Yahoo!
18
- 'fix reverse dns for ',
19
- 'ips with missing ptr records',
20
- 'no ptr record found.',
21
- 'please get a custom reverse dns name from your isp for your host',
22
- 'ptr record setup',
23
- 'reverse dns failed',
24
- 'reverse dns required',
25
- 'sender ip reverse lookup rejected',
26
- 'the ip address sending this message does not have a ptr record setup', # Google
27
- 'the corresponding forward dns entry does not point to the sending ip', # Google
28
- 'this system will not accept messages from servers/devices with no reverse dns',
29
- 'unresolvable relay host name',
30
- 'we do not accept mail from hosts with dynamic ip or generic dns ptr-records',
12
+ "corresponding forward dns entry does not point to the sending ip", # Google
13
+ "ip name lookup failed",
14
+ "no matches to nameserver query",
15
+ "sender ip reverse lookup rejected",
16
+ "unresolvable relay host name",
31
17
  ].freeze
32
18
  Pairs = [
33
- ['domain ',' mismatches client ip'],
34
- ['dns lookup failure: ', ' try again later'],
35
- ['reverse dns lookup for host ', ' failed permanently'],
36
- ['server access ', ' forbidden by invalid rdns record of your mail server'],
37
- ['service permits ', ' unverifyable sending ips'],
19
+ ["domain "," mismatches client ip"],
20
+ ["domain name verification on your ip address ", "failed"],
21
+ ["dns lookup failure: ", " try again later"],
22
+ ["ptr", "record"],
23
+ ["reverse", " dns"],
24
+ ["server access ", " forbidden by invalid rdns record of your mail server"],
25
+ ["service permits ", " unverifyable sending ips"],
38
26
  ].freeze
39
27
 
40
28
  def text; return 'requireptr'; end
@@ -17,28 +17,23 @@ 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
+ "could not retrieve credentials", # OpenSMTPD/smtpd/mta.c
27
+ "unauthenticated senders not allowed",
28
+ "verification failure",
29
+ "you are not authorized to send mail, authentication is required",
30
+ "you don't authenticate or the domain isn't in my list of allowed rcpthosts",
35
31
  ].freeze
36
32
  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'],
33
+ ["authentication failed; server ", " said: "], # Postfix
34
+ ["authentification invalide", "305"],
35
+ ["authentification requise", "402"],
36
+ ["user ", " is not authorized to perform ses:sendrawemail on resource"],
42
37
  ].freeze
43
38
 
44
39
  def text; return 'securityerror'; end