sisimai 4.25.14-java → 4.25.16-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +51 -0
- data/README-JA.md +2 -2
- data/README.md +2 -2
- data/lib/sisimai/address.rb +1 -1
- data/lib/sisimai/data.rb +7 -3
- data/lib/sisimai/lhost/facebook.rb +10 -6
- data/lib/sisimai/lhost/googlegroups.rb +1 -2
- data/lib/sisimai/lhost/imailserver.rb +1 -1
- data/lib/sisimai/message.rb +15 -2
- data/lib/sisimai/mime.rb +1 -1
- data/lib/sisimai/reason/blocked.rb +2 -1
- data/lib/sisimai/reason/contenterror.rb +1 -0
- data/lib/sisimai/reason/filtered.rb +1 -0
- data/lib/sisimai/reason/networkerror.rb +1 -0
- data/lib/sisimai/reason/notaccept.rb +1 -0
- data/lib/sisimai/reason/policyviolation.rb +2 -0
- data/lib/sisimai/reason/rejected.rb +5 -0
- data/lib/sisimai/reason/spamdetected.rb +4 -0
- data/lib/sisimai/reason/userunknown.rb +8 -1
- data/lib/sisimai/rfc3464.rb +1 -1
- data/lib/sisimai/rfc3834.rb +0 -2
- data/lib/sisimai/rhost/exchangeonline.rb +711 -142
- data/lib/sisimai/rhost/googleapps.rb +239 -104
- data/lib/sisimai/rhost/mimecast.rb +290 -0
- data/lib/sisimai/rhost/nttdocomo.rb +118 -0
- data/lib/sisimai/rhost.rb +3 -1
- data/lib/sisimai/string.rb +2 -2
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/maildir/bsd/rhost-mimecast-01.eml +88 -0
- data/set-of-emails/maildir/bsd/rhost-mimecast-02.eml +90 -0
- data/set-of-emails/maildir/bsd/rhost-nttdocomo-01.eml +62 -0
- data/set-of-emails/maildir/bsd/rhost-nttdocomo-02.eml +89 -0
- data/set-of-emails/maildir/bsd/rhost-nttdocomo-03.eml +79 -0
- metadata +9 -2
@@ -5,118 +5,253 @@ module Sisimai
|
|
5
5
|
# is "aspmx.l.google.com". This class is called only Sisimai::Data class.
|
6
6
|
module GoogleApps
|
7
7
|
class << self
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
]
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
]
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
]
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
]
|
99
|
-
|
100
|
-
|
8
|
+
MessagesOf = {
|
9
|
+
'blocked' => [
|
10
|
+
['421', '4.7.0', 'ip not in whitelist for rcpt domain, closing connection.'],
|
11
|
+
|
12
|
+
# - 421 4.7.0 Our system has detected an unusual rate of unsolicited mail originating
|
13
|
+
# from your IP address. To protect our users from spam, mail sent from your IP ad-
|
14
|
+
# dress has been temporarily blocked.
|
15
|
+
# For more information, visit https://support.google.com/mail/answer/81126
|
16
|
+
['421', '4.7.0', 'our system has detected an unusual rate of unsolicited mail originating from your ip address'],
|
17
|
+
|
18
|
+
# - 421 4.7.0 Try again later, closing connection. This usually indicates a Denial of
|
19
|
+
# Service (DoS) for the SMTP relay at the HELO stage.
|
20
|
+
['421', '4.7.0', 'try again later, closing connection.'],
|
21
|
+
|
22
|
+
# - 501 5.5.4 HELO/EHLO argument is invalid. For more information, visit [HELO/EHLO e-
|
23
|
+
# mail error].
|
24
|
+
['501', '5.5.4', 'helo/ehlo argument is invalid'],
|
25
|
+
|
26
|
+
# - 550 5.7.1 Our system has detected an unusual rate of unsolicited mail originating
|
27
|
+
# from your IP address. To protect our users from spam, mail sent from your IP ad-
|
28
|
+
# dress has been blocked. Review https://support.google.com/mail/answer/81126
|
29
|
+
['550', '5.7.1', 'our system has detected an unusual rate of unsolicited mail originating from your ip address'],
|
30
|
+
|
31
|
+
# - 550 5.7.1 The IP you're using to send mail is not authorized to send email directly
|
32
|
+
# to our servers. Please use the SMTP relay at your service provider instead. For
|
33
|
+
# more information, visit https://support.google.com/mail/answer/10336
|
34
|
+
['550', '5.7.1', "the ip you're using to send mail is not authorized to send email directly to our servers"],
|
35
|
+
|
36
|
+
# - 550 5.7.25 The IP address sending this message does not have a PTR record setup, or
|
37
|
+
# the corresponding forward DNS entry does not point to the sending IP. As a policy,
|
38
|
+
# Gmail does not accept messages from IPs with missing PTR records.
|
39
|
+
['550', '5.7.25', 'the ip address sending this message does not have a ptr record setup'],
|
40
|
+
|
41
|
+
# - 550 5.7.26 Unauthenticated email from domain-name is not accepted due to domain's
|
42
|
+
# DMARC policy. Please contact the administrator of domain-name domain. If this was
|
43
|
+
# a legitimate mail please visit [Control unauthenticated mail from your domain] to
|
44
|
+
# learn about the DMARC initiative. If the messages are valid and aren't spam, con-
|
45
|
+
# tact the administrator of the receiving mail server to determine why your outgoing
|
46
|
+
# messages don't pass authentication checks.
|
47
|
+
['550', '5.7.26', "is not accepted due to domain's dmarc policy"],
|
48
|
+
|
49
|
+
# - 550 5.7.26 This message does not have authentication information or fails to pass
|
50
|
+
# authentication checks (SPF or DKIM). To best protect our users from spam, the mes-
|
51
|
+
# sage has been blocked. Please visit https://support.google.com/mail/answer/81126
|
52
|
+
# for more information.
|
53
|
+
['550', '5.7.1', 'fails to pass authentication checks'],
|
54
|
+
['550', '5.7.26', 'fails to pass authentication checks'],
|
55
|
+
|
56
|
+
# - 550 5.7.26 This message fails to pass SPF checks for an SPF record with a hard fail
|
57
|
+
# policy (-all). To best protect our users from spam and phishing, the message has
|
58
|
+
# been blocked. Please visit https://support.google.com/mail/answer/81126 for more
|
59
|
+
# information.
|
60
|
+
['550', '5.7.26', 'this message fails to pass spf checks for an spf record with a hard fail'],
|
61
|
+
# - 550 5.7.1 Our system has detected that this message is likely suspicious due to the
|
62
|
+
# very low reputation of the sending IP address. To best protect our users from spam,
|
63
|
+
# the message has been blocked.
|
64
|
+
# Please visit https://support.google.com/mail/answer/188131 for more information.
|
65
|
+
['550', '5.7.1', 'this message is likely suspicious due to the very low reputation of the sending ip address'],
|
66
|
+
],
|
67
|
+
'contenterror' => [
|
68
|
+
['554', '5.6.0', 'mail message is malformed. Not accepted'],
|
69
|
+
],
|
70
|
+
'exceedlimit' => [
|
71
|
+
# - 552 5.2.3 Your message exceeded Google's message size limits. For more information,
|
72
|
+
# visit https://support.google.com/mail/answer/6584
|
73
|
+
['552', '5.2.3', "your message exceeded Google's message size limits"],
|
74
|
+
],
|
75
|
+
'expired' => [
|
76
|
+
['451', '4.4.2', 'timeout - closing connection'],
|
77
|
+
],
|
78
|
+
'mailboxfull' => [
|
79
|
+
# - 452 4.2.2 The email account that you tried to reach is over quota. Please direct
|
80
|
+
# the recipient to Clear Google Drive space & increase storage.
|
81
|
+
['452', '4.2.2', 'the email account that you tried to reach is over quota'],
|
82
|
+
['552', '5.2.2', 'the email account that you tried to reach is over quota'],
|
83
|
+
['550', '5.7.1', 'email quota exceeded'],
|
84
|
+
],
|
85
|
+
'networkerror' => [
|
86
|
+
['554', '5.6.0', 'message exceeded 50 hops, this may indicate a mail loop'],
|
87
|
+
],
|
88
|
+
'norelaying' => [
|
89
|
+
['550', '5.7.0', 'mail relay denied'],
|
90
|
+
],
|
91
|
+
'policyviolation' => [
|
92
|
+
['550', '5.7.1', 'messages with multiple addresses in from: header are not accepted'],
|
93
|
+
|
94
|
+
# - 550 5.7.1 The user or domain that you are sending to (or from) has a policy that
|
95
|
+
# prohibited the mail that you sent. Please contact your domain administrator for
|
96
|
+
# further details.
|
97
|
+
# For more information, visit https://support.google.com/a/answer/172179
|
98
|
+
['550', '5.7.1', 'the user or domain that you are sending to (or from) has a policy that prohibited'],
|
99
|
+
|
100
|
+
# - 552 5.7.0 Our system detected an illegal attachment on your message. Please visit
|
101
|
+
# http://mail.google.com/support/bin/answer.py?answer=6590 to review our attachment
|
102
|
+
# guidelines.
|
103
|
+
['552', '5.7.0', 'our system detected an illegal attachment on your message'],
|
104
|
+
|
105
|
+
# - 552 5.7.0 This message was blocked because its content presents a potential securi-
|
106
|
+
# ty issue. Please visit https://support.google.com/mail/?p=BlockedMessage to review
|
107
|
+
# our message content and attachment content guidelines.
|
108
|
+
['552', '5.7.0', 'this message was blocked because its content presents a potential security issue'],
|
109
|
+
],
|
110
|
+
'rejected' => [
|
111
|
+
# - 550 5.7.0, Mail Sending denied. This error occurs if the sender account is disabled
|
112
|
+
# or not registered within your Google Workspace domain.
|
113
|
+
['550', '5.7.0', 'mail sending denied'],
|
114
|
+
|
115
|
+
['550', '5.7.1', 'unauthenticated email is not accepted from this domain'],
|
116
|
+
],
|
117
|
+
'securityerror' => [
|
118
|
+
['421', '4.7.0', 'tls required for rcpt domain, closing connection'],
|
119
|
+
['501', '5.5.2', 'cannot decode response'], # 2FA related error, maybe.
|
120
|
+
|
121
|
+
# - 530 5.5.1 Authentication Required. For more information, visit
|
122
|
+
# https://support.google.com/accounts/troubleshooter/2402620
|
123
|
+
['530', '5.5.1', 'authentication required.'],
|
124
|
+
|
125
|
+
# - 535 5.7.1 Application-specific password required.
|
126
|
+
# For more information, visit https://support.google.com/accounts/answer/185833
|
127
|
+
['535', '5.7.1', 'application-specific password required'],
|
128
|
+
|
129
|
+
# - 535 5.7.1 Please log in with your web browser and then try again. For more infor-
|
130
|
+
# mation, visit https://support.google.com/mail/bin/accounts/answer/78754
|
131
|
+
['535', '5.7.1', 'please log in with your web browser and then try again'],
|
132
|
+
|
133
|
+
# - 535 5.7.1 Username and Password not accepted. For more information, visit
|
134
|
+
# https://support.google.com/accounts/troubleshooter/2402620
|
135
|
+
['535', '5.7.1', 'username and password not accepted'],
|
136
|
+
|
137
|
+
['550', '5.7.1', 'invalid credentials for relay'],
|
138
|
+
],
|
139
|
+
'spamdetected' => [
|
140
|
+
# - 550 5.7.1 Our system has detected that this message is likely unsolicited mail. To
|
141
|
+
# reduce the amount of spam sent to Gmail, this message has been blocked.
|
142
|
+
# For more information, visit https://support.google.com/mail/answer/188131
|
143
|
+
['550', '5.7.1', 'our system has detected that this message is likely unsolicited mail'],
|
144
|
+
],
|
145
|
+
'suspend' => [
|
146
|
+
['550', '5.2.1', 'the email account that you tried to reach is disabled'],
|
147
|
+
],
|
148
|
+
'syntaxerror' => [
|
149
|
+
['451', '4.5.0', 'smtp protocol violation, visit rfc 2821'],
|
150
|
+
['454', '4.5.0', 'smtp protocol violation, no commands allowed to pipeline after starttls'],
|
151
|
+
['454', '5.5.1', 'starttls may not be repeated'],
|
152
|
+
['502', '5.5.1', 'too many unrecognized commands, goodbye'],
|
153
|
+
['502', '5.5.1', 'unimplemented command'],
|
154
|
+
['502', '5.5.1', 'unrecognized command'],
|
155
|
+
['503', '5.5.1', 'ehlo/helo first'],
|
156
|
+
['503', '5.5.1', 'mail first'],
|
157
|
+
['503', '5.5.1', 'rcpt first'],
|
158
|
+
['503', '5.7.0', 'no identity changes permitted'],
|
159
|
+
['504', '5.7.4', 'unrecognized authentication type'],
|
160
|
+
['530', '5.7.0', 'must issue a starttls command first'],
|
161
|
+
['535', '5.5.4', 'optional argument not permitted for that auth mode'],
|
162
|
+
['554', '5.7.0', 'too many unauthenticated commands'],
|
163
|
+
['555', '5.5.2', 'syntax error'],
|
164
|
+
],
|
165
|
+
'systemerror' => [
|
166
|
+
['421', '4.3.0', 'temporary system problem'],
|
167
|
+
['421', '4.7.0', 'temporary system problem'],
|
168
|
+
['421', '4.4.5', 'server busy'],
|
169
|
+
['451', '4.3.0', 'mail server temporarily rejected message'],
|
170
|
+
['454', '4.7.0', 'cannot authenticate due to temporary system problem'],
|
171
|
+
|
172
|
+
# - 452 4.5.3 Domain policy size per transaction exceeded, please try this recipient in
|
173
|
+
# a separate transaction. This message means the email policy size (size of policies,
|
174
|
+
# number of policies, or both) for the recipient domain has been exceeded.
|
175
|
+
['452', '4.5.3', 'domain policy size per transaction exceeded'],
|
176
|
+
],
|
177
|
+
'toomanyconn' => [
|
178
|
+
['451', '4.3.0', 'multiple destination domains per transaction is unsupported'],
|
179
|
+
|
180
|
+
# - 452 4.5.3 Your message has too many recipients. For more information regarding
|
181
|
+
# Google's sending limits, visit https://support.google.com/mail/answer/6592
|
182
|
+
['452', '4.5.3', 'your message has too many recipients'],
|
183
|
+
|
184
|
+
# - 450 4.2.1 The user you are trying to contact is receiving mail too quickly. Please
|
185
|
+
# resend your message at a later time. If the user is able to receive mail at that
|
186
|
+
# time, your message will be delivered.
|
187
|
+
# For more information, visit https://support.google.com/mail/answer/22839
|
188
|
+
['450', '4.2.1', 'is receiving mail too quickly'],
|
189
|
+
|
190
|
+
# - 450 4.2.1 The user you are trying to contact is receiving mail at a rate that pre-
|
191
|
+
# vents additional messages from being delivered. Please resend your message at a
|
192
|
+
# later time. If the user is able to receive mail at that time, your message will be
|
193
|
+
# delivered. For more information, visit https://support.google.com/mail/answer/6592
|
194
|
+
['450', '4.2.1', 'is receiving mail at a rate that prevents additional messages from being delivered'],
|
195
|
+
['550', '5.2.1', 'is receiving mail at a rate that prevents additional messages from being delivered'],
|
196
|
+
|
197
|
+
# - 450 4.2.1 Peak SMTP relay limit exceeded for customer. This is a temporary error.
|
198
|
+
# For more information on SMTP relay limits, please contact your administrator or
|
199
|
+
# visit https://support.google.com/a/answer/6140680
|
200
|
+
['450', '4.2.1', 'peak smtp relay limit exceeded for customer'],
|
201
|
+
|
202
|
+
# - 550 5.4.5 Daily SMTP relay limit exceeded for user. For more information on SMTP
|
203
|
+
# relay sending limits please contact your administrator or visit SMTP relay service
|
204
|
+
# error messages.
|
205
|
+
['550', '5.4.5', 'daily smtp relay limit exceeded for user'],
|
206
|
+
['550', '5.4.5', 'daily sending quota exceeded'],
|
207
|
+
|
208
|
+
# - 550 5.7.1 Daily SMTP relay limit exceeded for customer. For more information on
|
209
|
+
# SMTP relay sending limits please contact your administrator or visit
|
210
|
+
# https://support.google.com/a/answer/6140680
|
211
|
+
['550', '5.7.1', 'daily smtp relay limit exceeded for customer'],
|
212
|
+
],
|
213
|
+
'userunknown' => [
|
214
|
+
# - 550 5.1.1 The email account that you tried to reach does not exist. Please try dou-
|
215
|
+
# ble-checking the recipient's email address for typos or unnecessary spaces.
|
216
|
+
# For more information, visit https://support.google.com/mail/answer/6596
|
217
|
+
['550', '5.1.1', 'the email account that you tried to reach does not exist'],
|
218
|
+
|
219
|
+
# - 553 5.1.2 We weren't able to find the recipient domain. Please check for any spell-
|
220
|
+
# ing errors, and make sure you didn't enter any spaces, periods, or other punctua-
|
221
|
+
# tion after the recipient's email address.
|
222
|
+
['553', '5.1.2', "we weren't able to find the recipient domain"],
|
223
|
+
],
|
101
224
|
}.freeze
|
102
225
|
|
103
|
-
# Detect bounce reason from Google
|
104
|
-
# @param [Sisimai::
|
105
|
-
# @return [String] The bounce reason for Google
|
226
|
+
# Detect bounce reason from Google Workspace
|
227
|
+
# @param [Sisimai::Fact] argvs Parsed email object
|
228
|
+
# @return [String] The bounce reason for Google Workspace
|
106
229
|
# @see https://support.google.com/a/answer/3726730?hl=en
|
107
230
|
def get(argvs)
|
108
231
|
return argvs.reason unless argvs.reason.empty?
|
232
|
+
return '' if argvs.diagnosticcode.empty?
|
233
|
+
return '' if argvs.replycode.empty?
|
234
|
+
return '' if argvs.deliverystatus.empty?
|
235
|
+
return '' unless argvs.deliverystatus =~ /\A[245][.]\d[.]\d+\z/
|
109
236
|
|
110
|
-
|
111
|
-
|
112
|
-
|
237
|
+
statuscode = argvs.deliverystatus[2,6]
|
238
|
+
esmtpreply = argvs.replycode[1,2]
|
239
|
+
esmtperror = argvs.diagnosticcode.downcase
|
113
240
|
reasontext = ''
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
241
|
+
|
242
|
+
MessagesOf.each_key do |e|
|
243
|
+
# Each key is a reason name
|
244
|
+
MessagesOf[e].each do |f|
|
245
|
+
# Try to match an SMTP reply code, a D.S.N, and an error message
|
246
|
+
next unless esmtperror.include?(f[2])
|
247
|
+
next unless f[0].end_with?(esmtpreply)
|
248
|
+
next unless f[1].end_with?(statuscode)
|
249
|
+
reasontext = e
|
250
|
+
break
|
251
|
+
end
|
252
|
+
break unless reasontext.empty?
|
119
253
|
end
|
254
|
+
|
120
255
|
return reasontext
|
121
256
|
end
|
122
257
|
|