sisimai 4.20.1 → 4.20.2

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -2
  3. data/Changes +11 -1
  4. data/README-JA.md +135 -202
  5. data/README.md +128 -192
  6. data/fig/sisimai-architecture.png +0 -0
  7. data/lib/sisimai.rb +5 -3
  8. data/lib/sisimai/arf.rb +2 -2
  9. data/lib/sisimai/ced/us/amazonses.rb +5 -5
  10. data/lib/sisimai/ced/us/sendgrid.rb +4 -4
  11. data/lib/sisimai/data.rb +1 -8
  12. data/lib/sisimai/data/json.rb +1 -1
  13. data/lib/sisimai/datetime.rb +1 -1
  14. data/lib/sisimai/mail/maildir.rb +3 -3
  15. data/lib/sisimai/mda.rb +2 -2
  16. data/lib/sisimai/message.rb +7 -3
  17. data/lib/sisimai/message/email.rb +8 -2
  18. data/lib/sisimai/mime.rb +2 -2
  19. data/lib/sisimai/msp/de/einsundeins.rb +2 -2
  20. data/lib/sisimai/msp/de/gmx.rb +2 -2
  21. data/lib/sisimai/msp/jp/biglobe.rb +2 -2
  22. data/lib/sisimai/msp/jp/ezweb.rb +2 -2
  23. data/lib/sisimai/msp/jp/kddi.rb +3 -3
  24. data/lib/sisimai/msp/ru/mailru.rb +3 -3
  25. data/lib/sisimai/msp/ru/yandex.rb +2 -2
  26. data/lib/sisimai/msp/uk/messagelabs.rb +2 -2
  27. data/lib/sisimai/msp/us/amazonses.rb +4 -5
  28. data/lib/sisimai/msp/us/amazonworkmail.rb +2 -2
  29. data/lib/sisimai/msp/us/aol.rb +2 -2
  30. data/lib/sisimai/msp/us/bigfoot.rb +3 -3
  31. data/lib/sisimai/msp/us/facebook.rb +2 -2
  32. data/lib/sisimai/msp/us/google.rb +2 -2
  33. data/lib/sisimai/msp/us/office365.rb +2 -3
  34. data/lib/sisimai/msp/us/outlook.rb +2 -2
  35. data/lib/sisimai/msp/us/receivingses.rb +2 -2
  36. data/lib/sisimai/msp/us/sendgrid.rb +2 -2
  37. data/lib/sisimai/msp/us/verizon.rb +3 -3
  38. data/lib/sisimai/msp/us/yahoo.rb +2 -2
  39. data/lib/sisimai/msp/us/zoho.rb +2 -2
  40. data/lib/sisimai/mta/activehunter.rb +2 -2
  41. data/lib/sisimai/mta/apachejames.rb +3 -3
  42. data/lib/sisimai/mta/courier.rb +3 -3
  43. data/lib/sisimai/mta/domino.rb +2 -2
  44. data/lib/sisimai/mta/exchange2003.rb +4 -4
  45. data/lib/sisimai/mta/exchange2007.rb +2 -2
  46. data/lib/sisimai/mta/exim.rb +8 -4
  47. data/lib/sisimai/mta/imailserver.rb +3 -3
  48. data/lib/sisimai/mta/interscanmss.rb +3 -3
  49. data/lib/sisimai/mta/mailfoundry.rb +2 -2
  50. data/lib/sisimai/mta/mailmarshalsmtp.rb +2 -2
  51. data/lib/sisimai/mta/mcafee.rb +2 -2
  52. data/lib/sisimai/mta/messagingserver.rb +3 -3
  53. data/lib/sisimai/mta/mfilter.rb +2 -2
  54. data/lib/sisimai/mta/mxlogic.rb +3 -3
  55. data/lib/sisimai/mta/notes.rb +3 -3
  56. data/lib/sisimai/mta/opensmtpd.rb +2 -2
  57. data/lib/sisimai/mta/postfix.rb +3 -3
  58. data/lib/sisimai/mta/qmail.rb +3 -3
  59. data/lib/sisimai/mta/sendmail.rb +2 -2
  60. data/lib/sisimai/mta/surfcontrol.rb +2 -2
  61. data/lib/sisimai/mta/userdefined.rb +3 -3
  62. data/lib/sisimai/mta/v5sendmail.rb +3 -3
  63. data/lib/sisimai/mta/x1.rb +2 -2
  64. data/lib/sisimai/mta/x2.rb +2 -2
  65. data/lib/sisimai/mta/x3.rb +2 -2
  66. data/lib/sisimai/mta/x4.rb +3 -3
  67. data/lib/sisimai/mta/x5.rb +3 -3
  68. data/lib/sisimai/reason/rejected.rb +1 -0
  69. data/lib/sisimai/reason/securityerror.rb +7 -2
  70. data/lib/sisimai/reason/toomanyconn.rb +4 -0
  71. data/lib/sisimai/rfc3464.rb +3 -3
  72. data/lib/sisimai/rfc3834.rb +2 -2
  73. data/lib/sisimai/rfc5322.rb +4 -4
  74. data/lib/sisimai/rhost.rb +0 -1
  75. data/lib/sisimai/rhost/exchangeonline.rb +2 -2
  76. data/lib/sisimai/smtp.rb +4 -4
  77. data/lib/sisimai/smtp/error.rb +7 -12
  78. data/lib/sisimai/smtp/reply.rb +1 -1
  79. data/lib/sisimai/string.rb +7 -7
  80. data/lib/sisimai/version.rb +1 -1
  81. data/set-of-emails/maildir/bsd/rfc3834-06.eml +56 -0
  82. metadata +5 -3
@@ -50,7 +50,7 @@ module Sisimai
50
50
  match = 0
51
51
  match += 1 if mhead['from'] =~ Re0[:from]
52
52
  match += 1 if Re0[:subject].find { |a| mhead['subject'] == a }
53
- return nil if match == 0
53
+ return nil if match.zero?
54
54
 
55
55
  dscontents = [Sisimai::MTA.DELIVERYSTATUS]
56
56
  hasdivided = mbody.split("\n")
@@ -61,7 +61,7 @@ module Sisimai
61
61
  v = nil
62
62
 
63
63
  hasdivided.each do |e|
64
- if readcursor == 0
64
+ if readcursor.zero?
65
65
  # Beginning of the bounce message or delivery status part
66
66
  if e =~ Re1[:begin]
67
67
  readcursor |= Indicators[:deliverystatus]
@@ -129,7 +129,7 @@ module Sisimai
129
129
  end
130
130
  end
131
131
  end
132
- return nil if recipients == 0
132
+ return nil if recipients.zero?
133
133
  require 'sisimai/string'
134
134
 
135
135
  dscontents.map do |e|
@@ -51,7 +51,7 @@ module Sisimai
51
51
  v = nil
52
52
 
53
53
  hasdivided.each do |e|
54
- if readcursor == 0
54
+ if readcursor.zero?
55
55
  # Beginning of the bounce message or delivery status part
56
56
  if e =~ Re1[:begin]
57
57
  readcursor |= Indicators[:deliverystatus]
@@ -117,7 +117,7 @@ module Sisimai
117
117
  end
118
118
  end
119
119
  end
120
- return nil if recipients == 0
120
+ return nil if recipients.zero?
121
121
  require 'sisimai/string'
122
122
 
123
123
  dscontents.map do |e|
@@ -62,7 +62,7 @@ module Sisimai
62
62
  end
63
63
 
64
64
  hasdivided.each do |e|
65
- if readcursor == 0
65
+ if readcursor.zero?
66
66
  # Beginning of the bounce message or delivery status part
67
67
  if e =~ Re1[:begin]
68
68
  readcursor |= Indicators[:deliverystatus]
@@ -156,7 +156,7 @@ module Sisimai
156
156
  end
157
157
  end
158
158
  end
159
- return nil if recipients == 0
159
+ return nil if recipients.zero?
160
160
  require 'sisimai/string'
161
161
 
162
162
  dscontents.map do |e|
@@ -66,7 +66,7 @@ module Sisimai
66
66
  havepassed << e
67
67
  p = havepassed[-2]
68
68
 
69
- if readcursor == 0
69
+ if readcursor.zero?
70
70
  # Beginning of the bounce message or delivery status part
71
71
  if e =~ Re1[:begin]
72
72
  readcursor |= Indicators[:deliverystatus]
@@ -145,7 +145,7 @@ module Sisimai
145
145
  end
146
146
  end
147
147
  end
148
- return nil if recipients == 0
148
+ return nil if recipients.zero?
149
149
  require 'sisimai/string'
150
150
 
151
151
  dscontents.map do |e|
@@ -47,7 +47,7 @@ module Sisimai
47
47
  match = 0
48
48
  match += 1 if mhead['content-type'] =~ Re0[:boundary]
49
49
  match += 1 if mhead['subject'] =~ Re0[:subject]
50
- return nil if match == 0
50
+ return nil if match.zero?
51
51
 
52
52
  require 'sisimai/address'
53
53
  dscontents = [Sisimai::MTA.DELIVERYSTATUS]
@@ -59,7 +59,7 @@ module Sisimai
59
59
  v = nil
60
60
 
61
61
  hasdivided.each do |e|
62
- if readcursor == 0
62
+ if readcursor.zero?
63
63
  # Beginning of the bounce message or delivery status part
64
64
  if e =~ Re1[:begin]
65
65
  readcursor |= Indicators[:deliverystatus]
@@ -181,7 +181,7 @@ module Sisimai
181
181
  end
182
182
  end
183
183
  end
184
- return nil if recipients == 0
184
+ return nil if recipients.zero?
185
185
  require 'sisimai/string'
186
186
 
187
187
  dscontents.map do |e|
@@ -55,7 +55,7 @@ module Sisimai
55
55
  v = nil
56
56
 
57
57
  hasdivided.each do |e|
58
- if readcursor == 0
58
+ if readcursor.zero?
59
59
  # Beginning of the bounce message or delivery status part
60
60
  readcursor |= Indicators[:deliverystatus] if e =~ Re1[:begin]
61
61
  end
@@ -135,7 +135,7 @@ module Sisimai
135
135
  end
136
136
  end
137
137
  end
138
- return nil if recipients == 0
138
+ return nil if recipients.zero?
139
139
  require 'sisimai/string'
140
140
 
141
141
  dscontents.map do |e|
@@ -100,7 +100,7 @@ module Sisimai
100
100
  match += 1 if mhead['x-mxl-notehash']
101
101
  match += 1 if mhead['subject'] =~ Re0[:subject]
102
102
  match += 1 if mhead['from'] =~ Re0[:from]
103
- return nil if match == 0
103
+ return nil if match.zero?
104
104
 
105
105
  dscontents = [Sisimai::MTA.DELIVERYSTATUS]
106
106
  hasdivided = mbody.split("\n")
@@ -112,7 +112,7 @@ module Sisimai
112
112
  v = nil
113
113
 
114
114
  hasdivided.each do |e|
115
- if readcursor == 0
115
+ if readcursor.zero?
116
116
  # Beginning of the bounce message or delivery status part
117
117
  if e =~ Re1[:begin]
118
118
  readcursor |= Indicators[:deliverystatus]
@@ -174,7 +174,7 @@ module Sisimai
174
174
  end
175
175
  end
176
176
  end
177
- return nil if recipients == 0
177
+ return nil if recipients.zero?
178
178
 
179
179
  if mhead['received'].size > 0
180
180
  # Get the name of local MTA
@@ -59,7 +59,7 @@ module Sisimai
59
59
  v = nil
60
60
 
61
61
  hasdivided.each do |e|
62
- if readcursor == 0
62
+ if readcursor.zero?
63
63
  # Beginning of the bounce message or delivery status part
64
64
  if e =~ Re1[:begin]
65
65
  readcursor |= Indicators[:deliverystatus]
@@ -142,7 +142,7 @@ module Sisimai
142
142
  end
143
143
  end
144
144
 
145
- if recipients == 0
145
+ if recipients.zero?
146
146
  # Fallback: Get the recpient address from RFC822 part
147
147
  rfc822list.each do |e|
148
148
  if cv = e.match(/^To:[ ]*(.+)$/m)
@@ -153,7 +153,7 @@ module Sisimai
153
153
  end
154
154
  end
155
155
 
156
- return nil if recipients == 0
156
+ return nil if recipients.zero?
157
157
  require 'sisimai/string'
158
158
  require 'sisimai/smtp/status'
159
159
 
@@ -113,7 +113,7 @@ module Sisimai
113
113
  v = nil
114
114
 
115
115
  hasdivided.each do |e|
116
- if readcursor == 0
116
+ if readcursor.zero?
117
117
  # Beginning of the bounce message or delivery status part
118
118
  if e =~ Re1[:begin]
119
119
  readcursor |= Indicators[:deliverystatus]
@@ -168,7 +168,7 @@ module Sisimai
168
168
  end
169
169
  end
170
170
  end
171
- return nil if recipients == 0
171
+ return nil if recipients.zero?
172
172
  require 'sisimai/string'
173
173
 
174
174
  dscontents.map do |e|
@@ -79,7 +79,7 @@ module Sisimai
79
79
  havepassed << e
80
80
  p = havepassed[-2]
81
81
 
82
- if readcursor == 0
82
+ if readcursor.zero?
83
83
  # Beginning of the bounce message or delivery status part
84
84
  if e =~ Re1[:begin]
85
85
  readcursor |= Indicators[:deliverystatus]
@@ -235,7 +235,7 @@ module Sisimai
235
235
  end # End of if: rfc822
236
236
  end
237
237
 
238
- if recipients == 0
238
+ if recipients.zero?
239
239
  # Fallback: set recipient address from error message
240
240
  if anotherset['recipient'] && anotherset['recipient'].size > 0
241
241
  # Set recipient address
@@ -243,7 +243,7 @@ module Sisimai
243
243
  recipients += 1
244
244
  end
245
245
  end
246
- return nil if recipients == 0
246
+ return nil if recipients.zero?
247
247
 
248
248
  require 'sisimai/string'
249
249
  require 'sisimai/smtp'
@@ -148,7 +148,7 @@ module Sisimai
148
148
  match = 0
149
149
  match += 1 if mhead['subject'] =~ Re0[:subject]
150
150
  match += 1 if mhead['received'].find { |a| a =~ Re0[:received] }
151
- return nil if match == 0
151
+ return nil if match.zero?
152
152
 
153
153
  dscontents = [Sisimai::MTA.DELIVERYSTATUS]
154
154
  hasdivided = mbody.split("\n")
@@ -159,7 +159,7 @@ module Sisimai
159
159
  v = nil
160
160
 
161
161
  hasdivided.each do |e|
162
- if readcursor == 0
162
+ if readcursor.zero?
163
163
  # Beginning of the bounce message or delivery status part
164
164
  if e =~ Re1[:begin]
165
165
  readcursor |= Indicators[:deliverystatus]
@@ -219,7 +219,7 @@ module Sisimai
219
219
  end
220
220
  end
221
221
  end
222
- return nil if recipients == 0
222
+ return nil if recipients.zero?
223
223
 
224
224
  require 'sisimai/string'
225
225
  require 'sisimai/smtp/status'
@@ -75,7 +75,7 @@ module Sisimai
75
75
  havepassed << e
76
76
  p = havepassed[-2]
77
77
 
78
- if readcursor == 0
78
+ if readcursor.zero?
79
79
  # Beginning of the bounce message or delivery status part
80
80
  if e =~ Re1[:begin]
81
81
  readcursor |= Indicators[:deliverystatus]
@@ -240,7 +240,7 @@ module Sisimai
240
240
  end
241
241
  end
242
242
  end
243
- return nil if recipients == 0
243
+ return nil if recipients.zero?
244
244
  require 'sisimai/string'
245
245
 
246
246
  dscontents.map do |e|
@@ -60,7 +60,7 @@ module Sisimai
60
60
  havepassed << e
61
61
  p = havepassed[-2]
62
62
 
63
- if readcursor == 0
63
+ if readcursor.zero?
64
64
  # Beginning of the bounce message or delivery status part
65
65
  if e =~ Re1[:begin]
66
66
  readcursor |= Indicators[:deliverystatus]
@@ -144,7 +144,7 @@ module Sisimai
144
144
  end
145
145
  end
146
146
  end
147
- return nil if recipients == 0
147
+ return nil if recipients.zero?
148
148
  require 'sisimai/string'
149
149
 
150
150
  dscontents.map do |e|
@@ -58,7 +58,7 @@ module Sisimai
58
58
  match += 1 if mhead['subject'] =~ Re0[:subject]
59
59
  match += 1 if mhead['from'] =~ Re0[:from]
60
60
  match += 1 if mhead['x-some-userdefined-header']
61
- return nil if match == 0
61
+ return nil if match.zero?
62
62
 
63
63
  # 2. Parse message body(mbody) of the bounce message. See some modules
64
64
  # in lib/sisimai/mta or lib/sisimai/msp directory to implement codes.
@@ -70,7 +70,7 @@ module Sisimai
70
70
  recipients = 0 # (Integer) The number of 'Final-Recipient' header
71
71
 
72
72
  hasdivided.each do |e|
73
- if readcursor == 0
73
+ if readcursor.zero?
74
74
  # Beginning of the bounce message or delivery status part
75
75
  if e =~ Re1[:begin]
76
76
  readcursor |= Indicators[:deliverystatus]
@@ -118,7 +118,7 @@ module Sisimai
118
118
 
119
119
  # 3. Return undef when there is no recipient address which is failed to
120
120
  # delivery in the bounce message
121
- return nil if recipients == 0
121
+ return nil if recipients.zero?
122
122
 
123
123
  # 4. Return the following variable.
124
124
  rfc822part = Sisimai::RFC5322.weedout(rfc822list)
@@ -74,7 +74,7 @@ module Sisimai
74
74
  v = nil
75
75
 
76
76
  hasdivided.each do |e|
77
- if readcursor == 0
77
+ if readcursor.zero?
78
78
  # Beginning of the bounce message or delivery status part
79
79
  if e =~ Re1[:begin]
80
80
  readcursor |= Indicators[:deliverystatus]
@@ -159,7 +159,7 @@ module Sisimai
159
159
  end
160
160
  return nil if readcursor & Indicators[:'message-rfc822'] == 0
161
161
 
162
- if recipients == 0
162
+ if recipients.zero?
163
163
  # Get the recipient address from the original message
164
164
  rfc822list.each do |e|
165
165
  if cv = e.match(/^To: (.+)$/m)
@@ -170,7 +170,7 @@ module Sisimai
170
170
  end
171
171
  end
172
172
  end
173
- return nil if recipients == 0
173
+ return nil if recipients.zero?
174
174
  require 'sisimai/string'
175
175
 
176
176
  dscontents.map do |e|
@@ -51,7 +51,7 @@ module Sisimai
51
51
  v = nil
52
52
 
53
53
  hasdivided.each do |e|
54
- if readcursor == 0
54
+ if readcursor.zero?
55
55
  # Beginning of the bounce message or delivery status part
56
56
  if e =~ Re1[:begin]
57
57
  readcursor |= Indicators[:deliverystatus]
@@ -106,7 +106,7 @@ module Sisimai
106
106
  end
107
107
  end
108
108
  end
109
- return nil if recipients == 0
109
+ return nil if recipients.zero?
110
110
  require 'sisimai/string'
111
111
 
112
112
  dscontents.map do |e|
@@ -54,7 +54,7 @@ module Sisimai
54
54
  v = nil
55
55
 
56
56
  hasdivided.each do |e|
57
- if readcursor == 0
57
+ if readcursor.zero?
58
58
  # Beginning of the bounce message or delivery status part
59
59
  if e =~ Re1[:begin]
60
60
  readcursor |= Indicators[:deliverystatus]
@@ -108,7 +108,7 @@ module Sisimai
108
108
  end
109
109
  end
110
110
  end
111
- return nil if recipients == 0
111
+ return nil if recipients.zero?
112
112
  require 'sisimai/string'
113
113
 
114
114
  dscontents.map do |e|
@@ -50,7 +50,7 @@ module Sisimai
50
50
  v = nil
51
51
 
52
52
  hasdivided.each do |e|
53
- if readcursor == 0
53
+ if readcursor.zero?
54
54
  # Beginning of the bounce message or delivery status part
55
55
  if e =~ Re1[:begin]
56
56
  readcursor |= Indicators[:deliverystatus]
@@ -122,7 +122,7 @@ module Sisimai
122
122
  end
123
123
  end
124
124
 
125
- return nil if recipients == 0
125
+ return nil if recipients.zero?
126
126
  require 'sisimai/string'
127
127
  require 'sisimai/smtp/status'
128
128
 
@@ -173,7 +173,7 @@ module Sisimai
173
173
  match = 0
174
174
  match += 1 if mhead['subject'] =~ Re0[:subject]
175
175
  match += 1 if mhead['received'].find { |a| a =~ Re0[:received] }
176
- return nil if match == 0
176
+ return nil if match.zero?
177
177
 
178
178
  dscontents = [Sisimai::MTA.DELIVERYSTATUS]
179
179
  hasdivided = mbody.split("\n")
@@ -184,7 +184,7 @@ module Sisimai
184
184
  v = nil
185
185
 
186
186
  hasdivided.each do |e|
187
- if readcursor == 0
187
+ if readcursor.zero?
188
188
  # Beginning of the bounce message or delivery status part
189
189
  if e =~ Re1[:begin]
190
190
  readcursor |= Indicators[:deliverystatus]
@@ -244,7 +244,7 @@ module Sisimai
244
244
  end
245
245
  end
246
246
  end
247
- return nil if recipients == 0
247
+ return nil if recipients.zero?
248
248
  require 'sisimai/string'
249
249
 
250
250
  dscontents.map do |e|
@@ -76,7 +76,7 @@ module Sisimai
76
76
  havepassed << e
77
77
  p = havepassed[-2]
78
78
 
79
- if readcursor == 0
79
+ if readcursor.zero?
80
80
  # Beginning of the bounce message or delivery status part
81
81
  if e =~ Re1[:begin]
82
82
  readcursor |= Indicators[:deliverystatus]
@@ -149,7 +149,7 @@ module Sisimai
149
149
  end
150
150
  else
151
151
  # After "message/rfc822"
152
- next if recipients == 0
152
+ next if recipients.zero?
153
153
  next if readcursor & Indicators['deliverystatus'] == 0
154
154
 
155
155
  if e.empty?
@@ -161,7 +161,7 @@ module Sisimai
161
161
 
162
162
  end
163
163
  end
164
- return nil if recipients == 0
164
+ return nil if recipients.zero?
165
165
  require 'sisimai/string'
166
166
 
167
167
  dscontents.map do |e|