sisimai 5.0.2-java → 5.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codecovio.yml +35 -0
  3. data/.github/workflows/rake-test.yml +27 -24
  4. data/ChangeLog.md +62 -0
  5. data/Gemfile +2 -0
  6. data/README-JA.md +21 -18
  7. data/README.md +23 -20
  8. data/lib/sisimai/arf.rb +27 -8
  9. data/lib/sisimai/fact/json.rb +2 -2
  10. data/lib/sisimai/fact/yaml.rb +2 -2
  11. data/lib/sisimai/fact.rb +4 -19
  12. data/lib/sisimai/lhost/activehunter.rb +4 -3
  13. data/lib/sisimai/lhost/amavis.rb +4 -4
  14. data/lib/sisimai/lhost/amazonses.rb +6 -6
  15. data/lib/sisimai/lhost/amazonworkmail.rb +4 -4
  16. data/lib/sisimai/lhost/aol.rb +4 -4
  17. data/lib/sisimai/lhost/apachejames.rb +4 -4
  18. data/lib/sisimai/lhost/barracuda.rb +4 -4
  19. data/lib/sisimai/lhost/bigfoot.rb +4 -4
  20. data/lib/sisimai/lhost/biglobe.rb +4 -4
  21. data/lib/sisimai/lhost/courier.rb +4 -4
  22. data/lib/sisimai/lhost/domino.rb +4 -4
  23. data/lib/sisimai/lhost/dragonfly.rb +114 -0
  24. data/lib/sisimai/lhost/einsundeins.rb +4 -4
  25. data/lib/sisimai/lhost/exchange2003.rb +4 -3
  26. data/lib/sisimai/lhost/exchange2007.rb +4 -3
  27. data/lib/sisimai/lhost/exim.rb +4 -4
  28. data/lib/sisimai/lhost/ezweb.rb +4 -4
  29. data/lib/sisimai/lhost/facebook.rb +4 -4
  30. data/lib/sisimai/lhost/fml.rb +4 -4
  31. data/lib/sisimai/lhost/gmail.rb +4 -4
  32. data/lib/sisimai/lhost/gmx.rb +4 -4
  33. data/lib/sisimai/lhost/googlegroups.rb +4 -4
  34. data/lib/sisimai/lhost/gsuite.rb +4 -4
  35. data/lib/sisimai/lhost/imailserver.rb +4 -3
  36. data/lib/sisimai/lhost/interscanmss.rb +5 -4
  37. data/lib/sisimai/lhost/kddi.rb +4 -4
  38. data/lib/sisimai/lhost/mailfoundry.rb +4 -4
  39. data/lib/sisimai/lhost/mailmarshalsmtp.rb +6 -5
  40. data/lib/sisimai/lhost/mailru.rb +4 -4
  41. data/lib/sisimai/lhost/mcafee.rb +4 -4
  42. data/lib/sisimai/lhost/messagelabs.rb +4 -3
  43. data/lib/sisimai/lhost/messagingserver.rb +5 -4
  44. data/lib/sisimai/lhost/mfilter.rb +4 -4
  45. data/lib/sisimai/lhost/mxlogic.rb +3 -3
  46. data/lib/sisimai/lhost/notes.rb +4 -4
  47. data/lib/sisimai/lhost/office365.rb +4 -4
  48. data/lib/sisimai/lhost/opensmtpd.rb +9 -7
  49. data/lib/sisimai/lhost/outlook.rb +4 -4
  50. data/lib/sisimai/lhost/postfix.rb +4 -4
  51. data/lib/sisimai/lhost/powermta.rb +4 -4
  52. data/lib/sisimai/lhost/qmail.rb +10 -10
  53. data/lib/sisimai/lhost/receivingses.rb +4 -4
  54. data/lib/sisimai/lhost/sendgrid.rb +4 -4
  55. data/lib/sisimai/lhost/sendmail.rb +4 -4
  56. data/lib/sisimai/lhost/surfcontrol.rb +4 -4
  57. data/lib/sisimai/lhost/v5sendmail.rb +5 -4
  58. data/lib/sisimai/lhost/verizon.rb +4 -4
  59. data/lib/sisimai/lhost/x1.rb +3 -3
  60. data/lib/sisimai/lhost/x2.rb +3 -3
  61. data/lib/sisimai/lhost/x3.rb +3 -3
  62. data/lib/sisimai/lhost/x4.rb +3 -3
  63. data/lib/sisimai/lhost/x5.rb +3 -3
  64. data/lib/sisimai/lhost/x6.rb +3 -3
  65. data/lib/sisimai/lhost/yahoo.rb +4 -4
  66. data/lib/sisimai/lhost/yandex.rb +4 -4
  67. data/lib/sisimai/lhost/zoho.rb +4 -4
  68. data/lib/sisimai/lhost.rb +5 -5
  69. data/lib/sisimai/mail/maildir.rb +1 -1
  70. data/lib/sisimai/mail/stdin.rb +1 -1
  71. data/lib/sisimai/mda.rb +3 -3
  72. data/lib/sisimai/message.rb +9 -9
  73. data/lib/sisimai/order.rb +1 -0
  74. data/lib/sisimai/reason/badreputation.rb +1 -1
  75. data/lib/sisimai/reason/blocked.rb +1 -0
  76. data/lib/sisimai/reason/expired.rb +7 -0
  77. data/lib/sisimai/reason/filtered.rb +1 -0
  78. data/lib/sisimai/reason/mailboxfull.rb +3 -0
  79. data/lib/sisimai/reason/norelaying.rb +2 -0
  80. data/lib/sisimai/reason/rejected.rb +2 -1
  81. data/lib/sisimai/reason/suspend.rb +4 -0
  82. data/lib/sisimai/reason/userunknown.rb +4 -1
  83. data/lib/sisimai/reason.rb +8 -8
  84. data/lib/sisimai/rfc3464.rb +3 -3
  85. data/lib/sisimai/rfc3834.rb +2 -2
  86. data/lib/sisimai/rhost/apple.rb +92 -0
  87. data/lib/sisimai/rhost/cox.rb +81 -32
  88. data/lib/sisimai/rhost/franceptt.rb +84 -81
  89. data/lib/sisimai/rhost/godaddy.rb +205 -43
  90. data/lib/sisimai/rhost/google.rb +85 -72
  91. data/lib/sisimai/rhost/iua.rb +2 -2
  92. data/lib/sisimai/rhost/kddi.rb +6 -5
  93. data/lib/sisimai/rhost/microsoft.rb +12 -5
  94. data/lib/sisimai/rhost/mimecast.rb +15 -4
  95. data/lib/sisimai/rhost/nttdocomo.rb +4 -4
  96. data/lib/sisimai/rhost/spectrum.rb +100 -40
  97. data/lib/sisimai/rhost/tencent.rb +46 -25
  98. data/lib/sisimai/rhost/yahooinc.rb +110 -0
  99. data/lib/sisimai/rhost.rb +28 -35
  100. data/lib/sisimai/smtp/reply.rb +4 -3
  101. data/lib/sisimai/smtp/transcript.rb +3 -3
  102. data/lib/sisimai/version.rb +1 -1
  103. data/lib/sisimai.rb +0 -6
  104. data/set-of-emails/maildir/bsd/arf-26.eml +27 -0
  105. data/set-of-emails/maildir/bsd/lhost-dragonfly-01.eml +36 -0
  106. data/set-of-emails/maildir/bsd/lhost-dragonfly-02.eml +32 -0
  107. data/set-of-emails/maildir/bsd/lhost-dragonfly-03.eml +32 -0
  108. data/set-of-emails/maildir/bsd/lhost-dragonfly-04.eml +31 -0
  109. data/set-of-emails/maildir/bsd/lhost-dragonfly-05.eml +32 -0
  110. data/set-of-emails/maildir/bsd/lhost-dragonfly-06.eml +32 -0
  111. data/set-of-emails/maildir/bsd/lhost-dragonfly-07.eml +32 -0
  112. data/set-of-emails/maildir/bsd/lhost-dragonfly-08.eml +32 -0
  113. data/set-of-emails/maildir/bsd/lhost-dragonfly-09.eml +32 -0
  114. data/set-of-emails/maildir/bsd/lhost-dragonfly-10.eml +32 -0
  115. data/set-of-emails/maildir/bsd/lhost-dragonfly-11.eml +32 -0
  116. data/set-of-emails/maildir/bsd/lhost-dragonfly-12.eml +32 -0
  117. data/set-of-emails/maildir/bsd/lhost-dragonfly-13.eml +32 -0
  118. data/set-of-emails/maildir/bsd/lhost-dragonfly-14.eml +32 -0
  119. data/set-of-emails/maildir/bsd/lhost-dragonfly-15.eml +32 -0
  120. data/set-of-emails/maildir/bsd/lhost-dragonfly-16.eml +32 -0
  121. data/set-of-emails/maildir/bsd/lhost-dragonfly-17.eml +32 -0
  122. data/set-of-emails/maildir/bsd/lhost-dragonfly-18.eml +32 -0
  123. data/set-of-emails/maildir/bsd/lhost-dragonfly-19.eml +32 -0
  124. data/set-of-emails/maildir/bsd/lhost-dragonfly-20.eml +32 -0
  125. data/set-of-emails/maildir/bsd/lhost-dragonfly-21.eml +33 -0
  126. data/set-of-emails/maildir/bsd/lhost-dragonfly-22.eml +32 -0
  127. data/set-of-emails/maildir/bsd/lhost-dragonfly-23.eml +32 -0
  128. data/set-of-emails/maildir/bsd/lhost-dragonfly-24.eml +32 -0
  129. data/set-of-emails/maildir/bsd/lhost-dragonfly-25.eml +33 -0
  130. data/set-of-emails/maildir/bsd/lhost-dragonfly-26.eml +33 -0
  131. data/set-of-emails/maildir/bsd/lhost-dragonfly-27.eml +47 -0
  132. data/set-of-emails/maildir/bsd/lhost-dragonfly-28.eml +47 -0
  133. data/set-of-emails/maildir/bsd/lhost-dragonfly-29.eml +32 -0
  134. data/set-of-emails/maildir/bsd/lhost-dragonfly-30.eml +32 -0
  135. data/set-of-emails/maildir/bsd/lhost-opensmtpd-10.eml +58 -0
  136. data/set-of-emails/maildir/bsd/lhost-opensmtpd-11.eml +58 -0
  137. data/set-of-emails/maildir/bsd/lhost-opensmtpd-12.eml +62 -0
  138. data/set-of-emails/maildir/bsd/lhost-opensmtpd-13.eml +62 -0
  139. data/set-of-emails/maildir/bsd/lhost-opensmtpd-14.eml +58 -0
  140. data/set-of-emails/maildir/bsd/lhost-opensmtpd-15.eml +63 -0
  141. data/set-of-emails/maildir/bsd/lhost-opensmtpd-16.eml +62 -0
  142. data/set-of-emails/maildir/bsd/lhost-opensmtpd-17.eml +63 -0
  143. data/set-of-emails/maildir/bsd/lhost-qmail-11.eml +29 -0
  144. data/set-of-emails/maildir/bsd/lhost-qmail-12.eml +29 -0
  145. data/set-of-emails/maildir/bsd/lhost-qmail-13.eml +29 -0
  146. data/set-of-emails/maildir/bsd/lhost-qmail-14.eml +34 -0
  147. data/set-of-emails/maildir/bsd/lhost-qmail-15.eml +30 -0
  148. data/set-of-emails/maildir/bsd/lhost-qmail-16.eml +31 -0
  149. data/set-of-emails/maildir/bsd/lhost-qmail-17.eml +38 -0
  150. data/set-of-emails/maildir/bsd/lhost-qmail-18.eml +31 -0
  151. data/set-of-emails/maildir/bsd/lhost-qmail-19.eml +31 -0
  152. data/set-of-emails/maildir/bsd/lhost-qmail-20.eml +46 -0
  153. data/set-of-emails/maildir/bsd/lhost-qmail-21.eml +41 -0
  154. data/set-of-emails/maildir/bsd/lhost-qmail-22.eml +42 -0
  155. data/set-of-emails/maildir/bsd/lhost-qmail-23.eml +43 -0
  156. data/set-of-emails/maildir/bsd/lhost-qmail-24.eml +43 -0
  157. data/set-of-emails/maildir/bsd/lhost-qmail-25.eml +54 -0
  158. data/set-of-emails/maildir/bsd/rhost-apple-01.eml +79 -0
  159. data/set-of-emails/maildir/bsd/rhost-apple-02.eml +81 -0
  160. data/set-of-emails/maildir/bsd/rhost-apple-03.eml +75 -0
  161. data/set-of-emails/maildir/bsd/rhost-apple-04.eml +74 -0
  162. data/set-of-emails/maildir/bsd/rhost-microsoft-04.eml +86 -0
  163. data/set-of-emails/maildir/bsd/rhost-microsoft-05.eml +83 -0
  164. data/set-of-emails/maildir/bsd/rhost-yahooinc-01.eml +80 -0
  165. data/set-of-emails/maildir/bsd/rhost-yahooinc-02.eml +83 -0
  166. data/set-of-emails/maildir/bsd/rhost-yahooinc-03.eml +125 -0
  167. metadata +69 -3
  168. data/.travis.yml +0 -23
@@ -6,16 +6,54 @@ module Sisimai
6
6
  module Cox
7
7
  class << self
8
8
  ErrorCodes = {
9
- # https://www.cox.com/residential/support/email-error-codes.html
10
- 'CXBL' => 'blocked', # The sending IP address has been blocked by Cox due to exhibiting spam-like behavior.
9
+ # CXBL
10
+ # - The sending IP address has been blocked by Cox due to exhibiting spam-like behavior.
11
+ # - Send an email request to Cox to ask for a sending IP address be unblocked.
12
+ # Note: Cox has sole discretion whether to unblock the sending IP address.
13
+ 'CXBL' => 'blocked',
14
+
15
+ # CXDNS
16
+ # - There was an issue with the connecting IP address Domain Name System (DNS).
17
+ # - The Reverse DNS (rDNS) lookup for your IP address is failing.
18
+ # - Confirm the IP address that sends your email.
19
+ # - Check the rDNS of that IP address. If it passes, then wait 24 hours and try resending
20
+ # your email.
21
+ 'CXDNS' => 'requireptr',
22
+
23
+ # CXSNDR
24
+ # - There was a problem with the sender's domain.
25
+ # - Your email failed authentication checks against your sending domain's SPF, DomainKeys,
26
+ # or DKIM policy.
27
+ 'CXSNDR' => 'authfailure',
28
+
29
+ # CXSMTP
30
+ # - There was a violation of SMTP protocol.
31
+ # - Your email wasn't delivered because Cox was unable to verify that it came from a
32
+ # legitimate email sender.
33
+ 'CXSMTP' => 'rejected',
34
+
35
+ # CXCNCT
36
+ # - There was a connection issue from the IP address.
37
+ # - There is a limit to the number of concurrent SMTP connections per IP address to
38
+ # protect the systems against attack. Ensure that the sending email server is not
39
+ # opening more than 10 concurrent connections to avoid reaching this limit.
40
+ 'CXCNCT' => 'toomanyconn',
41
+
42
+ # CXMXRT
43
+ # - The sender has sent email to too many recipients and needs to wait before sending
44
+ # more email.
45
+ # - The email sender has exceeded the maximum number of sent email allowed.
46
+ 'CXMXRT' => 'toomanyconn',
47
+
48
+ # CDRBL
49
+ # - The sending IP address has been temporarily blocked by Cox due to exhibiting spam-like
50
+ # behavior.
51
+ # - The block duration varies depending on reputation and other factors, but will not exceed
52
+ # 24 hours. Inspect email traffic for potential spam, and retry email delivery.
53
+ 'CDRBL' => 'blocked',
54
+
11
55
  'CXTHRT' => 'securityerror', # Email sending limited due to suspicious account activity.
12
56
  'CXMJ' => 'securityerror', # Email sending blocked due to suspicious account activity on primary Cox account.
13
- 'CXDNS' => 'blocked', # There was an issue with the connecting IP address Domain Name System (DNS).
14
- 'CXSNDR' => 'rejected', # There was a problem with the sender's domain.
15
- 'CXSMTP' => 'rejected', # Your email wasn't delivered because Cox was unable to verify that it came from a legitimate email sender.
16
- 'CXCNCT' => 'toomanyconn', # There is a limit to the number of concurrent SMTP connections per IP address
17
- 'CXMXRT' => 'toomanyconn', # The email sender has exceeded the maximum number of sent email allowed.
18
- 'CDRBL' => 'blocked', # The sending IP address has been temporarily blocked by Cox due to exhibiting spam-like behavior.
19
57
  'IPBL0001' => 'blocked', # The sending IP address is listed in the Spamhaus Zen DNSBL.
20
58
  'IPBL0010' => 'blocked', # The sending IP is listed in the Return Path DNSBL.
21
59
  'IPBL0100' => 'blocked', # The sending IP is listed in the Invaluement ivmSIP DNSBL.
@@ -32,6 +70,7 @@ module Sisimai
32
70
  'IPBL1110' => 'blocked', # The sending IP is in the Cloudmark CSI, Return Path and Invaluement ivmSIP DNSBLs.
33
71
  'IPBL1111' => 'blocked', # The sending IP is in the Cloudmark CSI, Spamhaus Zen, Return Path and Invaluement ivmSIP DNSBLs.
34
72
  'IPBL00001' => 'blocked', # The sending IP address is listed on a Spamhaus blacklist. Check your status at Spamhaus.
73
+
35
74
  'URLBL011' => 'spamdetected', # A URL within the body of the message was found on blocklists SURBL and Spamhaus DBL.
36
75
  'URLBL101' => 'spamdetected', # A URL within the body of the message was found on blocklists SURBL and ivmURI.
37
76
  'URLBL110' => 'spamdetected', # A URL within the body of the message was found on blocklists Spamhaus DBL and ivmURI.
@@ -39,63 +78,73 @@ module Sisimai
39
78
  }.freeze
40
79
  MessagesOf = {
41
80
  'blocked' => [
42
- # Cox requires that all connecting email servers contain valid reverse DNS PTR records.
43
- 'rejected - no rDNS',
44
- # An email client has repeatedly sent bad commands or invalid passwords resulting in a three-hour block of the client's IP address.
81
+ # - An email client has repeatedly sent bad commands or invalid passwords resulting in
82
+ # a three-hour block of the client's IP address.
83
+ # - The sending IP address has exceeded the threshold of invalid recipients and has
84
+ # been blocked.
45
85
  'cox too many bad commands from',
46
- # The reverse DNS check of the sending server IP address has failed.
47
- 'DNS check failure - try again later',
48
- # The sending IP address has exceeded the threshold of invalid recipients and has been blocked.
49
- 'Too many invalid recipients',
86
+ 'too many invalid recipients',
50
87
  ],
51
- 'notaccept' => [
52
- # Our systems are experiencing an issue which is causing a temporary inability to accept new email.
53
- 'ESMTP server temporarily not available',
88
+ 'requireptr' => [
89
+ # - The reverse DNS check of the sending server IP address has failed.
90
+ # - Cox requires that all connecting email servers contain valid reverse DNS PTR records.
91
+ 'dns check failure - try again later',
92
+ 'rejected - no rdns',
54
93
  ],
55
94
  'policyviolation' => [
56
- # The sending server has attempted to communicate too soon within the SMTP transaction
57
- 'ESMTP no data before greeting',
58
- # The message has been rejected because it contains an attachment with one of the following prohibited
59
- # file types, which commonly contain viruses: .shb, .shs, .vbe, .vbs, .wsc, .wsf, .wsh, .pif, .msc,
60
- # .msi, .msp, .reg, .sct, .bat, .chm, .isp, .cpl, .js, .jse, .scr, .exe.
95
+ # - The sending server has attempted to communicate too soon within the SMTP transaction
96
+ # - The message has been rejected because it contains an attachment with one of the
97
+ # following prohibited file types, which commonly contain viruses: .shb, .shs, .vbe,
98
+ # .vbs, .wsc, .wsf, .wsh, .pif, .msc, .msi, .msp, .reg, .sct, .bat, .chm, .isp, .cpl,
99
+ # .js, .jse, .scr, .exe.
100
+ 'esmtp no data before greeting',
61
101
  'attachment extension is forbidden',
62
102
  ],
63
103
  'rejected' => [
64
104
  # Cox requires that all sender domains resolve to a valid MX or A-record within DNS.
65
105
  'sender rejected',
66
106
  ],
107
+ 'systemerror' => [
108
+ # - Our systems are experiencing an issue which is causing a temporary inability to
109
+ # accept new email.
110
+ 'esmtp server temporarily not available',
111
+ ],
67
112
  'toomanyconn' => [
68
- # The sending IP address has exceeded the five maximum concurrent connection limit.
113
+ # - The sending IP address has exceeded the five maximum concurrent connection limit.
114
+ # - The SMTP connection has exceeded the 100 email message threshold and was disconnected.
115
+ # - The sending IP address has exceeded one of these rate limits and has been temporarily
116
+ # blocked.
69
117
  'too many sessions from',
70
- # The SMTP connection has exceeded the 100 email message threshold and was disconnected.
71
118
  'requested action aborted: try again later',
72
- # The sending IP address has exceeded one of these rate limits and has been temporarily blocked.
73
- 'Message threshold exceeded',
119
+ 'message threshold exceeded',
74
120
  ],
75
121
  'userunknown' => [
76
- 'recipient rejected', # The intended recipient is not a valid Cox Email account.
122
+ # - The intended recipient is not a valid Cox Email account.
123
+ 'recipient rejected',
77
124
  ],
78
125
  }.freeze
79
126
 
80
127
  # Detect bounce reason from https://cox.com/
81
- # @param [Sisimai::Fact] argvs Parsed email object
128
+ # @param [Sisimai::Fact] argvs Decoded email object
82
129
  # @return [String, Nil] The bounce reason at Cox
130
+ # @see https://www.cox.com/residential/support/email-error-codes.html
83
131
  # @since v4.25.8
84
132
  def get(argvs)
85
- statusmesg = argvs['diagnosticcode']
133
+ issuedcode = argvs['diagnosticcode']
86
134
  codenumber = 0
87
135
 
88
- if cv = statusmesg.match(/AUP#([0-9A-Z]+)/)
136
+ if cv = issuedcode.match(/AUP#([0-9A-Z]+)/)
89
137
  # Capture the numeric part of the error code
90
138
  codenumber = cv[1]
91
139
  end
92
140
  reasontext = ErrorCodes[codenumber] || ''
93
141
 
142
+ issuedcode = argvs['diagnosticcode'].downcase
94
143
  if reasontext.empty?
95
144
  # The error code was not found in ErrorCodes
96
145
  MessagesOf.each_key do |e|
97
146
  # Try to find with each error message defined in MessagesOf
98
- next unless MessagesOf[e].any? { |a| statusmesg.include?(a) }
147
+ next unless MessagesOf[e].any? { |a| issuedcode.include?(a) }
99
148
  reasontext = e
100
149
  break
101
150
  end
@@ -6,144 +6,147 @@ module Sisimai
6
6
  module FrancePTT
7
7
  class << self
8
8
  ErrorCodes = {
9
- # 550 5.7.1 Service unavailable; client [X.X.X.X] blocked using Spamhaus
10
- # Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
11
- # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous et a suivre la procedure.
12
- # The emails sent to the mail host Laposte.net were blocked by our services.
13
- # To regularize your situation please click on the link below and follow the procedure
14
- # https://www.spamhaus.org/lookup/ LPNAAA_101 (in reply to RCPT TO command))
9
+ # - 550 5.7.1 Service unavailable; client [192.0.2.1] blocked using Spamhaus
10
+ # Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
11
+ # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous
12
+ # et a suivre la procedure.
13
+ # - The emails sent to the mail host Laposte.net were blocked by our services. To regularize
14
+ # your situation please click on the link below and follow the procedure
15
+ # https://www.spamhaus.org/lookup/ LPNAAA_101 (in reply to RCPT TO command))
15
16
  '101' => 'blocked',
16
17
 
17
- # 550 mwinf5c04 ME Adresse IP source bloquee pour incident de spam.
18
- # Client host blocked for spamming issues. OFR006_102 Ref
19
- #
20
- # refused to talk to me: 550 5.5.0 Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
21
- # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous et a suivre la procedure.
22
- # The emails sent to the mail host Laposte.net were blocked by our services.
23
- # To regularize your situation please click on the link below and follow the procedure
24
- # https://senderscore.org/blacklistlookup/ LPN007_102
18
+ # - 550 mwinf5c04 ME Adresse IP source bloquee pour incident de spam.
19
+ # - Client host blocked for spamming issues. OFR006_102 Ref http://csi.cloudmark.com ...
20
+ # - 550 5.5.0 Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos
21
+ # services. Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien
22
+ # ci-dessous et a suivre la procedure.
23
+ # - The emails sent to the mail host Laposte.net were blocked by our services. To regularize
24
+ # your situation please click on the link below and follow the procedure
25
+ # https://senderscore.org/blacklistlookup/ LPN007_102
25
26
  '102' => 'blocked',
26
27
 
27
- # refused to talk to me: 550 mwinf5c10 ME Service refuse. Veuillez essayer plus tard.
28
- # Service refused, please try later. OFR006_103 X.X.X.X [103]
28
+ # - 550 mwinf5c10 ME Service refuse. Veuillez essayer plus tard.
29
+ # - Service refused, please try later. OFR006_103 192.0.2.1 [103]
29
30
  '103' => 'blocked',
30
31
 
31
- # refused to talk to me: 421 mwinf5c79 ME Trop de connexions, veuillez verifier votre configuration.
32
- # Too many connections, slow down. OFR005_104 [104]
33
- # Too many connections, slow down. LPN105_104
32
+ # - 421 mwinf5c79 ME Trop de connexions, veuillez verifier votre configuration.
33
+ # - Too many connections, slow down. OFR005_104 [104]
34
+ # - Too many connections, slow down. LPN105_104
34
35
  '104' => 'toomanyconn',
35
36
 
36
- # Veuillez essayer plus tard.
37
- '105' => nil,
37
+ '105' => nil, # Veuillez essayer plus tard.
38
+ '107' => nil, # Service refused, please try later. LPN006_107
39
+ '108' => nil, # service refused, please try later. LPN001_108
40
+ '109' => nil, # Veuillez essayer plus tard. LPN003_109
41
+ '201' => nil, # Veuillez essayer plus tard. OFR004_201
38
42
 
39
- # refused to talk to me: 421 4.2.1 Service refuse. Veuillez essayer plus tard.
40
- # Service refused, please try later. LPN006_107)
41
- '107' => nil,
42
-
43
- # refused to talk to me: 550 5.5.0 Service refuse. Veuillez essayer plus tard.
44
- # service refused, please try later. LPN001_108
45
- '108' => nil,
46
-
47
- # Veuillez essayer plus tard. LPN003_109
48
- '109' => nil,
49
-
50
- # Veuillez essayer plus tard. OFR004_201
51
- '201' => nil,
52
-
53
- # 550 5.7.0 Code d'authentification invalide OFR_305
43
+ # - 550 5.7.0 Code d'authentification invalide OFR_305
54
44
  '305' => 'securityerror',
55
45
 
56
- # 550 5.5.0 SPF: *** is not allowed to send mail. LPN004_401
57
- '401' => 'blocked',
46
+ # - 550 5.5.0 SPF: *** is not allowed to send mail. LPN004_401
47
+ '401' => 'authfailure',
58
48
 
59
- # 550 5.5.0 Authentification requise. Authentication Required. LPN105_402
49
+ # - 550 5.5.0 Authentification requise. Authentication Required. LPN105_402
60
50
  '402' => 'securityerror',
61
51
 
62
- # 5.0.1 Emetteur invalide. Invalid Sender.
52
+ # - 5.0.1 Emetteur invalide. Invalid Sender.
63
53
  '403' => 'rejected',
64
54
 
65
- # 5.0.1 Emetteur invalide. Invalid Sender. LPN105_405
66
- # 501 5.1.0 Emetteur invalide. Invalid Sender. OFR004_405 [405] (in reply to MAIL FROM command))
55
+ # - 5.0.1 Emetteur invalide. Invalid Sender. LPN105_405
56
+ # - 501 5.1.0 Emetteur invalide. Invalid Sender. OFR004_405 [405] (in reply to MAIL FROM command))
67
57
  '405' => 'rejected',
68
58
 
69
59
  # Emetteur invalide. Invalid Sender. OFR_415
70
60
  '415' => 'rejected',
71
61
 
72
- # 550 5.1.1 Adresse d au moins un destinataire invalide.
73
- # Invalid recipient. LPN416 (in reply to RCPT TO command)
74
- # Invalid recipient. OFR_416 [416] (in reply to RCPT TO command)
62
+ # - 550 5.1.1 Adresse d au moins un destinataire invalide.
63
+ # - Invalid recipient. LPN416 (in reply to RCPT TO command)
64
+ # - Invalid recipient. OFR_416 [416] (in reply to RCPT TO command)
75
65
  '416' => 'userunknown',
76
66
 
77
- # 552 5.1.1 Boite du destinataire pleine.
78
- # Recipient overquota. OFR_417 [417] (in reply to RCPT TO command))
67
+ # - 552 5.1.1 Boite du destinataire pleine.
68
+ # - Recipient overquota. OFR_417 [417] (in reply to RCPT TO command))
79
69
  '417' => 'mailboxfull',
80
70
 
81
- # Adresse d au moins un destinataire invalide
82
- '418' => 'userunknown',
71
+ # - Adresse d au moins un destinataire invalide
83
72
 
84
- # 550 5.5.0 Boite du destinataire archivee.
85
- # Archived recipient. LPN007_420 (in reply to RCPT TO command)
73
+ # - 550 5.5.0 Boite du destinataire archivee.
74
+ # - Archived recipient. LPN007_420 (in reply to RCPT TO command)
86
75
  '420' => 'suspend',
87
76
 
88
- # 5.5.3 Mail from not owned by user. LPN105_421.
77
+ # - 5.5.3 Mail from not owned by user. LPN105_421.
89
78
  '421' => 'rejected',
90
79
 
91
- # Service refused, please try later. LPN105_423
92
- '423' => nil,
80
+ '423' => nil, # Service refused, please try later. LPN105_423
81
+ '424' => nil, # Veuillez essayer plus tard. LPN105_424
93
82
 
94
- # Veuillez essayer plus tard. LPN105_424
95
- '424' => nil,
96
-
97
- # 550 5.5.0 Le compte du destinataire est bloque. The recipient account isblocked. LPN007_426 (in reply to RCPT TO command)
83
+ # - 550 5.5.0 Le compte du destinataire est bloque. The recipient account isblocked.
84
+ # LPN007_426 (in reply to RCPT TO command)
98
85
  '426' => 'suspend',
99
86
 
100
- # 421 4.2.0 Service refuse. Veuillez essayer plus tard.
101
- # Service refused, please try later. OFR005_505 [505] (in reply to end of DATA command)
102
- #
103
- # 421 4.2.1 Service refuse. Veuillez essayer plus tard.
104
- # Service refused, please try later. LPN007_505 (in reply to end of DATA command)
87
+ # - 421 4.2.0 Service refuse. Veuillez essayer plus tard. Service refused, please try later.
88
+ # OFR005_505 [505] (in reply to end of DATA command)
89
+ # - 421 4.2.1 Service refuse. Veuillez essayer plus tard. Service refused, please try later.
90
+ # LPN007_505 (in reply to end of DATA command)
105
91
  '505' => 'systemerror',
106
92
 
107
- # Mail rejete. Mail rejected. OFR_506 [506]
93
+ # - Mail rejete. Mail rejected. OFR_506 [506]
108
94
  '506' => 'spamdetected',
109
95
 
110
- # 550 5.5.0 Service refuse. Veuillez essayer plus tard.
111
- # service refused, please try later. LPN005_510 (in reply to end of DATA command)
96
+ # - 550 5.5.0 Service refuse. Veuillez essayer plus tard. service refused, please try later.
97
+ # LPN005_510 (in reply to end of DATA command)
112
98
  '510' => 'blocked',
113
99
 
114
- # Mail rejete. Mail rejected. OUK_513
115
- '513' => nil,
100
+ '513' => nil, # Mail rejete. Mail rejected. OUK_513
116
101
 
117
- # Taille limite du message atteinte
102
+ # - Taille limite du message atteinte
118
103
  '514' => 'mesgtoobig',
119
104
 
120
- # 571 5.7.1 Message refused, DMARC verification Failed.
121
- # Message refuse, verification DMARC en echec LPN007_517
122
- '517' => 'policyviolation',
105
+ # - 571 5.7.1 Message refused, DMARC verification Failed.
106
+ # - Message refuse, verification DMARC en echec LPN007_517
107
+ '517' => 'authfailure',
123
108
 
124
- # 554 5.7.1 Client host rejected
125
- # LPN000_630
109
+ # - 554 5.7.1 Client host rejected LPN000_630
126
110
  '630' => 'policyviolation',
127
111
 
128
- # 421 mwinf5c77 ME Service refuse. Veuillez essayer plus tard.
129
- # Service refused, please try later. OFR_999 [999]
112
+ # - 421 mwinf5c77 ME Service refuse. Veuillez essayer plus tard. Service refused, please try
113
+ # later. OFR_999 [999]
130
114
  '999' => 'blocked',
131
115
  }.freeze
116
+ MessagesOf = {
117
+ 'authfailure' => [
118
+ # - 421 smtp.orange.fr [192.0.2.1] Emetteur invalide, Veuillez verifier la configuration
119
+ # SPF/DNS de votre nom de domaine. Invalid Sender. SPF check failed, please verify the
120
+ # SPF/DNS configuration for your domain name.
121
+ 'spf/dns de votre nom de domaine',
122
+ ],
123
+ }.freeze
132
124
 
133
125
  # Detect bounce reason from Oranage or La Poste
134
- # @param [Sisimai::Fact] argvs Parsed email object
126
+ # @param [Sisimai::Fact] argvs Decoded email object
135
127
  # @return [String] The bounce reason for Orange or La Poste
128
+ # @see https://www.postmastery.com/orange-postmaster-smtp-error-codes-ofr/
129
+ # https://smtpfieldmanual.com/provider/orange
136
130
  def get(argvs)
137
- return argvs['reason'] unless argvs['reason'].empty?
138
-
139
- statusmesg = argvs['diagnosticcode']
131
+ issuedcode = argvs['diagnosticcode']
140
132
  reasontext = ''
141
133
 
142
- if cv = statusmesg.match(/\b(LPN|LPNAAA|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/i)
134
+ if cv = issuedcode.match(/\b(LPN|LPNAAA|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/i)
143
135
  # OUK_513, LPN105-104, OFR102-104, ofr_506
144
136
  v = sprintf("%03d", (cv[1] + cv[2])[-3, 3])
145
137
  reasontext = ErrorCodes[v] || 'undefined'
146
138
  end
139
+ return reasontext if reasontext.size > 0
140
+
141
+ issuedcode = issuedcode.downcase
142
+ MessagesOf.each_key do |e|
143
+ MessagesOf[e].each do |f|
144
+ next unless issuedcode.include?(f)
145
+ reasontext = e
146
+ break
147
+ end
148
+ break if reasontext.size > 0
149
+ end
147
150
  return reasontext
148
151
  end
149
152