truemail 1.6.1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31b9d354c841d370094f66ba22e481aded3501b0b17206b61eeb1c768d756ea1
4
- data.tar.gz: dbe57fe9cdc4763b4fc60c75aaf313aa1dd4ddff2cb5f60c1af9b3a6caddb659
3
+ metadata.gz: eb8cb5fec7b8a099bb4861bf2e07d72236d93a22c1dfd79eaef2c722d9160765
4
+ data.tar.gz: 05174034b4c4f493cd43c0d2dbb2380972bd6ee884f75592bde43300efc33e28
5
5
  SHA512:
6
- metadata.gz: 3e319f8eeaadba558bc79173fb5765c615c0b67112d49b45eeaee07b3c3f496019eb89ebb95f736c0413eb08d0e7b1b1b6579389bd02e13c33464eefef8aaa82
7
- data.tar.gz: 4093fc875a8363d7fe7211c0d1e698ac081c80ff63e8a01e3fc7bef913a65b71743afbc47f0de7eaa4d203f32e3560b40336b5d311b48449dde6542c9c8e9164
6
+ metadata.gz: cd660c9f167bdd910788d66eca957c7332917ce8fa1e5a1dca807efa2c256f7b0feb5c6fdecd43321afd0eb50b27f3c8d768f796e3ca1bb3c2173f1565aac58f
7
+ data.tar.gz: 78eefc8c3737e5f878fcb6bf18ddba001e555b230ff02b422b0b1d77002c4834dda2924e38f660f340fec4438af3967b81ae9e095e00fe5a213c13a5d256f30a
data/.reek.yml CHANGED
@@ -26,6 +26,7 @@ detectors:
26
26
  Attribute:
27
27
  exclude:
28
28
  - Truemail::Configuration#whitelist_validation
29
+ - Truemail::Configuration#not_rfc_mx_lookup_flow
29
30
  - Truemail::Configuration#smtp_safe_check
30
31
  - Truemail::Wrapper#attempts
31
32
 
@@ -1,8 +1,33 @@
1
1
  # Changelog
2
2
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3
3
 
4
+ ## [1.7.0] - 2020.05.09
5
+
6
+ ## Added
7
+
8
+ - Possibility to use not RFC MX lookup flow (MX and Null MX records will be checked on the DNS validation layer only)
9
+
10
+ ```ruby
11
+ Truemail.configure do |config|
12
+ # Optional parameter. This option will provide to use not RFC MX lookup flow.
13
+ # It means that MX and Null MX records will be cheked on the DNS validation layer only.
14
+ # By default this option is disabled.
15
+ config.not_rfc_mx_lookup_flow = true
16
+ end
17
+ ```
18
+
19
+ ### Changed
20
+
21
+ - `Truemail.configuration`
22
+ - `Truemail::Validate::Mx`
23
+ - `Truemail::VERSION`
24
+ - gem development dependencies
25
+ - gem documentation
26
+
4
27
  ## [1.6.1] - 2020.03.23
28
+
5
29
  ### Changed
30
+
6
31
  - `Truemail.configuration`
7
32
  - `Truemail::ArgumentError`
8
33
  - `Truemail::Audit::Ptr`
@@ -11,26 +36,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
11
36
  - gem documentation
12
37
 
13
38
  ### Removed
39
+
14
40
  `Truemail::Configuration.retry_count` deprecated, and alias for this method has been removed. Please use `Truemail::Configuration.connection_attempts` instead.
15
41
 
16
42
  ## [1.6.0] - 2020-02-01
43
+
17
44
  ### Added
45
+
18
46
  - Possibility to use `Truemail::Validator` instance represented as json directly
19
47
 
20
48
  ### Changed
49
+
21
50
  - gem development dependencies
22
51
  - gem documentation
23
52
 
24
53
  ## [1.5.1] - 2020-01-20
54
+
25
55
  ### Changed
56
+
26
57
  - gem development dependencies
27
58
  - gem documentation
28
59
 
29
60
  ## [1.5.0] - 2019-12-29
61
+
30
62
  ### Added
63
+
31
64
  - Supporting of internationalized emails ([EAI](https://en.wikipedia.org/wiki/International_email)). Now you can validate emails, like: `dörte@sörensen.de`, `квіточка@пошта.укр`, `alegría@mañana.es`
32
65
 
33
66
  ### Changed
67
+
34
68
  - `Truemail::RegexConstant::REGEX_DOMAIN`
35
69
  - `Truemail::RegexConstant::REGEX_EMAIL_PATTERN`
36
70
  - `Truemail::Validator::Result`
@@ -42,22 +76,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
42
76
  - linters configs
43
77
 
44
78
  ## [1.4.2] - 2019-11-27
79
+
45
80
  ### Changed
81
+
46
82
  - `Truemail::Configuration`
47
83
  - gem development dependencies
48
84
  - linters configs
49
85
 
50
86
  ## [1.4.1] - 2019-11-20
87
+
51
88
  ### Changed
89
+
52
90
  - gem development dependencies
53
91
  - gem documentation
54
92
  - linters configs
55
93
 
56
94
  ### Removed
95
+
57
96
  - truemail rspec helpers (moved to independent gem [`truemail-rspec`](https://github.com/truemail-rb/truemail-rspec))
58
97
 
59
98
  ## [1.4.0] - 2019-10-28
99
+
60
100
  ### Added
101
+
61
102
  - Event logger (ability to output validation logs to stdout/file)
62
103
  - JSON serializer for validator instance
63
104
  - [Changelog](CHANGELOG.md)
@@ -85,6 +126,7 @@ Truemail::Log::Serializer::Json.call(Truemail.validate('nonexistent_email@bestwe
85
126
  ```
86
127
 
87
128
  ### Changed
129
+
88
130
  - `Truemail::Configuration`
89
131
  - `Truemail::Validator`
90
132
  - `Truemail::Validate::Regex`
@@ -93,11 +135,14 @@ Truemail::Log::Serializer::Json.call(Truemail.validate('nonexistent_email@bestwe
93
135
  - gem description
94
136
 
95
137
  ## [1.3.0] - 2019-09-16
138
+
96
139
  ### Added
140
+
97
141
  - Ability to create new `Truemail::Configuration` instance with block
98
142
  - `Truemail::Validate::Smtp::Request::Configuration`
99
143
 
100
144
  ### Changed
145
+
101
146
  - `Truemail::Wrapper`
102
147
  - `Truemail::Validate::Base`
103
148
  - `Truemail::Validator`
@@ -115,15 +160,20 @@ Truemail::Log::Serializer::Json.call(Truemail.validate('nonexistent_email@bestwe
115
160
  - gem description
116
161
 
117
162
  ## [1.2.1] - 2019-06-27
163
+
118
164
  ### Fixed
165
+
119
166
  - Removed memoization from ```DomainListMatch#whitelisted_domain?```
120
167
 
121
168
  ### Changed
169
+
122
170
  - `Truemail::VERSION`
123
171
  - gem documentation
124
172
 
125
173
  ## [1.2.0] - 2019-06-26
174
+
126
175
  ### Added
176
+
127
177
  - Configurable option: validation for whitelisted domains only.
128
178
 
129
179
  When email domain in whitelist and ```whitelist_validation``` is sets equal to ```true``` validation type will be passed to other validators. Validation of email which not contains whitelisted domain always will return ```false```.
@@ -168,11 +218,14 @@ Truemail.validate('email@domain.com', with: :regex)
168
218
  ```
169
219
 
170
220
  ### Changed
221
+
171
222
  - `Truemail::VERSION`
172
223
  - gem documentation
173
224
 
174
225
  ## [1.1.0] - 2019-06-18
226
+
175
227
  ### Added
228
+
176
229
  - Configurable default validation type, [issue details](https://github.com/rubygarage/truemail/issues/48)
177
230
 
178
231
  You can predefine default validation type for ```Truemail.validate('email@email.com')``` call without with-parameter. Available validation types: ```:regex```, ```:mx```, ```:smtp```. By default validation type still remains ```:smtp```
@@ -185,11 +238,14 @@ end
185
238
  ```
186
239
 
187
240
  ### Changed
241
+
188
242
  - `Truemail::VERSION`
189
243
  - gem documentation
190
244
 
191
245
  ## [1.0.1] - 2019-06-08
246
+
192
247
  ### Added
248
+
193
249
  - Result validation type marker for domain list match check
194
250
 
195
251
  ```ruby
@@ -219,11 +275,14 @@ Truemail.validate('email@black-domain.com')
219
275
  ```
220
276
 
221
277
  ### Changed
278
+
222
279
  - `Truemail::VERSION`
223
280
  - gem documentation
224
281
 
225
282
  ## [1.0] - 2019-06-04
283
+
226
284
  ### Added
285
+
227
286
  - Feature domain whitelist blacklist. Other validations will not processed even if it was defined in ```validation_type_for```.
228
287
 
229
288
  ```ruby
@@ -237,6 +296,7 @@ Truemail.configure do |config|
237
296
  config.blacklisted_domains = ['somedomain1.com', 'somedomain2.com']
238
297
  end
239
298
  ```
299
+
240
300
  and
241
301
 
242
302
  ```ruby
@@ -245,17 +305,22 @@ Truemail.configuration.blacklisted_domains = ['somedomain1.com', 'somedomain2.co
245
305
  ```
246
306
 
247
307
  ### Removed
308
+
248
309
  - ```:skip``` validation type for ```validation_type_for```
249
310
 
250
311
  ### Fixed
312
+
251
313
  - error key in `lower_snake_case`
252
314
 
253
315
  ### Changed
316
+
254
317
  - `Truemail::VERSION`
255
318
  - gem documentation
256
319
 
257
320
  ## [0.2] - 2019-05-23
321
+
258
322
  ### Added
323
+
259
324
  - skip validation by domain for validation_type_for configuration option:
260
325
 
261
326
  ```ruby
@@ -263,68 +328,93 @@ Truemail.configure do |config|
263
328
  config.validation_type_for = { 'somedomain.com' => :skip }
264
329
  end
265
330
  ```
331
+
266
332
  and
333
+
267
334
  ```ruby
268
335
  Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
269
336
  ```
337
+
270
338
  ### Changed
339
+
271
340
  - `Truemail::VERSION`
272
341
  - gem documentation
273
342
 
274
343
  ## [0.1.10] - 2019-05-10
344
+
275
345
  ### Added
346
+
276
347
  - SMTP error body configurable option, [issue details](https://github.com/rubygarage/truemail/issues/19)
277
348
 
278
349
  ### Changed
350
+
279
351
  - `Truemail::VERSION`
280
352
  - gem documentation
281
353
 
282
354
  ## [0.1.9] - 2019-04-29
355
+
283
356
  ### Fixed
357
+
284
358
  - Empty ptr constant
285
359
 
286
360
  ## [0.1.8] - 2019-04-29
361
+
287
362
  ### Added
363
+
288
364
  - Reverse trace, [issue details](https://github.com/rubygarage/truemail/issues/18)
289
365
 
290
366
  ### Fixed
367
+
291
368
  - Behaviour of current host address resolver, [issue details](https://github.com/rubygarage/truemail/issues/18)
292
369
 
293
370
  ### Changed
371
+
294
372
  - `Truemail::VERSION`
295
373
  - gem documentation
296
374
 
297
375
  ## [0.1.7] - 2019-04-17
376
+
298
377
  ### Added
378
+
299
379
  - PTR record audit, [issue details](https://github.com/rubygarage/truemail/issues/18)
300
380
 
301
381
  ### Changed
382
+
302
383
  - `Truemail::VERSION`
303
384
  - gem documentation
304
385
 
305
386
  ## [0.1.6] - 2019-04-08
387
+
306
388
  ### Added
389
+
307
390
  - MX gem logic with [RFC 7505](https://tools.ietf.org/html/rfc7505), null MX record supporting, [issue details](https://github.com/rubygarage/truemail/issues/27)
308
391
  - [Contributing guideline](CONTRIBUTING.md)
309
392
 
310
393
  ### Fixed
394
+
311
395
  - Multihomed MX records supporting, [issue details](https://github.com/rubygarage/truemail/issues/28)
312
396
 
313
397
  ### Changed
398
+
314
399
  - `Truemail::VERSION`
315
400
  - gem documentation
316
401
 
317
402
  ## [0.1.5] - 2019-04-05
403
+
318
404
  ### Added
405
+
319
406
  - Retries for ```Truemail::Validate::Smtp``` for cases when one mx server
320
407
 
321
408
  ### Changed
409
+
322
410
  - ```Truemail::Configuration``` class, please use ```.connection_attempts``` instead ```.retry_count```
323
411
  - `Truemail::VERSION`
324
412
  - gem documentation
325
413
 
326
414
  ## [0.1.4] - 2019-04-01
415
+
327
416
  ### Added
417
+
328
418
  - Checking A record presence if ```MX``` and ```CNAME``` records not exist, [issue details](https://github.com/rubygarage/truemail/issues/10)
329
419
  - Handling of ```CNAME``` records, [issue details](https://github.com/rubygarage/truemail/issues/11)
330
420
  - Checking A record if ```MX``` and ```CNAME``` records not found, [issue details](https://github.com/rubygarage/truemail/issues/12)
@@ -333,14 +423,18 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
333
423
  - ```.valid?``` helper
334
424
 
335
425
  ### Changed
426
+
336
427
  - `Truemail::VERSION`
337
428
  - gem documentation
338
429
 
339
430
  ## [0.1.3] - 2019-03-27
431
+
340
432
  ### Added
433
+
341
434
  - Independent domain name extractor to ```Truemail::Validate::Mx#run```
342
435
 
343
436
  ### Fixed
437
+
344
438
  - Default ```REGEX_EMAIL_PATTERN```, [issue details](https://github.com/rubygarage/truemail/issues/7)
345
439
  * local part of address can't start with a dot or special symbol
346
440
  * local part of address can include ```+``` symbol
@@ -349,11 +443,14 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
349
443
  - Case sensitive domain names, [issue details](https://github.com/rubygarage/truemail/issues/9)
350
444
 
351
445
  ### Changed
446
+
352
447
  - `Truemail::VERSION`
353
448
  - gem documentation
354
449
 
355
450
  ## [0.1.0] - 2019-03-26
451
+
356
452
  ### Added
453
+
357
454
  - 'SMTP safe check' option for cases when SMTP server does not return an exact answer that the email does not exist.
358
455
 
359
456
  ```ruby
@@ -401,5 +498,6 @@ Truemail.validate('email@example.com')
401
498
  ```
402
499
 
403
500
  ### Changed
501
+
404
502
  - `Truemail::VERSION`
405
503
  - gem documentation
@@ -1,39 +1,27 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (1.6.1)
4
+ truemail (1.7.0)
5
5
  simpleidn (~> 0.1.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.0)
11
- axiom-types (0.1.1)
12
- descendants_tracker (~> 0.0.4)
13
- ice_nine (~> 0.11.0)
14
- thread_safe (~> 0.3, >= 0.3.1)
15
11
  bundler-audit (0.6.1)
16
12
  bundler (>= 1.2.0, < 3)
17
13
  thor (~> 0.18)
18
- byebug (11.1.1)
14
+ byebug (11.1.3)
19
15
  childprocess (3.0.0)
20
- codeclimate-engine-rb (0.4.1)
21
- virtus (~> 1.0)
22
16
  coderay (1.1.2)
23
- coercible (1.0.0)
24
- descendants_tracker (~> 0.0.1)
25
17
  colorize (0.8.1)
26
- descendants_tracker (0.0.4)
27
- thread_safe (~> 0.3, >= 0.3.1)
28
18
  diff-lcs (1.3)
29
19
  docile (1.3.2)
30
- equalizer (0.0.11)
31
- fasterer (0.8.2)
20
+ fasterer (0.8.3)
32
21
  colorize (~> 0.7)
33
22
  ruby_parser (>= 3.14.1)
34
23
  ffaker (2.14.0)
35
- ice_nine (0.11.2)
36
- iniparse (1.4.4)
24
+ iniparse (1.5.0)
37
25
  jaro_winkler (1.5.4)
38
26
  json (2.3.0)
39
27
  json_matchers (0.11.1)
@@ -41,13 +29,13 @@ GEM
41
29
  json_schema (0.20.8)
42
30
  kwalify (0.7.2)
43
31
  method_source (1.0.0)
44
- overcommit (0.52.1)
32
+ overcommit (0.53.0)
45
33
  childprocess (>= 0.6.3, < 4)
46
34
  iniparse (~> 1.4)
47
35
  parallel (1.19.1)
48
- parser (2.7.0.2)
36
+ parser (2.7.1.2)
49
37
  ast (~> 2.4.0)
50
- pry (0.13.0)
38
+ pry (0.13.1)
51
39
  coderay (~> 1.1)
52
40
  method_source (~> 1.0)
53
41
  pry-byebug (3.9.0)
@@ -56,8 +44,7 @@ GEM
56
44
  psych (3.1.0)
57
45
  rainbow (3.0.0)
58
46
  rake (13.0.1)
59
- reek (5.6.0)
60
- codeclimate-engine-rb (~> 0.4.0)
47
+ reek (6.0.0)
61
48
  kwalify (~> 0.7.0)
62
49
  parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
63
50
  psych (~> 3.1.0)
@@ -66,15 +53,15 @@ GEM
66
53
  rspec-core (~> 3.9.0)
67
54
  rspec-expectations (~> 3.9.0)
68
55
  rspec-mocks (~> 3.9.0)
69
- rspec-core (3.9.1)
70
- rspec-support (~> 3.9.1)
71
- rspec-expectations (3.9.0)
56
+ rspec-core (3.9.2)
57
+ rspec-support (~> 3.9.3)
58
+ rspec-expectations (3.9.2)
72
59
  diff-lcs (>= 1.2.0, < 2.0)
73
60
  rspec-support (~> 3.9.0)
74
61
  rspec-mocks (3.9.1)
75
62
  diff-lcs (>= 1.2.0, < 2.0)
76
63
  rspec-support (~> 3.9.0)
77
- rspec-support (3.9.2)
64
+ rspec-support (3.9.3)
78
65
  rubocop (0.79.0)
79
66
  jaro_winkler (~> 1.5.1)
80
67
  parallel (~> 1.10)
@@ -84,7 +71,7 @@ GEM
84
71
  unicode-display_width (>= 1.4.0, < 1.7)
85
72
  rubocop-performance (1.5.2)
86
73
  rubocop (>= 0.71.0)
87
- rubocop-rspec (1.37.1)
74
+ rubocop-rspec (1.39.0)
88
75
  rubocop (>= 0.68.1)
89
76
  ruby-progressbar (1.10.1)
90
77
  ruby_parser (3.14.2)
@@ -98,19 +85,13 @@ GEM
98
85
  simpleidn (0.1.1)
99
86
  unf (~> 0.1.4)
100
87
  thor (0.20.3)
101
- thread_safe (0.3.6)
102
- truemail-rspec (0.1.1)
103
- rspec (~> 3.0)
88
+ truemail-rspec (0.1.2)
89
+ rspec (~> 3.9)
104
90
  truemail (~> 1.4, >= 1.4.1)
105
91
  unf (0.1.4)
106
92
  unf_ext
107
- unf_ext (0.0.7.6)
93
+ unf_ext (0.0.7.7)
108
94
  unicode-display_width (1.6.1)
109
- virtus (1.0.5)
110
- axiom-types (~> 0.1)
111
- coercible (~> 1.0)
112
- descendants_tracker (~> 0.0, >= 0.0.3)
113
- equalizer (~> 0.0, >= 0.0.9)
114
95
 
115
96
  PLATFORMS
116
97
  ruby
@@ -118,20 +99,20 @@ PLATFORMS
118
99
  DEPENDENCIES
119
100
  bundler (~> 1.16)
120
101
  bundler-audit (~> 0.6.1)
121
- fasterer (~> 0.8.2)
102
+ fasterer (~> 0.8.3)
122
103
  ffaker (~> 2.14)
123
104
  json_matchers (~> 0.11.1)
124
- overcommit (~> 0.52.1)
105
+ overcommit (~> 0.53.0)
125
106
  pry-byebug (~> 3.9)
126
107
  rake (~> 13.0, >= 13.0.1)
127
- reek (~> 5.6)
108
+ reek (~> 6.0)
128
109
  rspec (~> 3.9)
129
110
  rubocop (~> 0.79.0)
130
111
  rubocop-performance (~> 1.5, >= 1.5.2)
131
- rubocop-rspec (~> 1.37, >= 1.37.1)
112
+ rubocop-rspec (~> 1.39)
132
113
  simplecov (~> 0.17.1)
133
114
  truemail!
134
- truemail-rspec (~> 0.1.1)
115
+ truemail-rspec (~> 0.1.2)
135
116
 
136
117
  BUNDLED WITH
137
118
  1.16.6
data/README.md CHANGED
@@ -8,6 +8,7 @@ Configurable framework agnostic plain Ruby email validator. Verify email via Reg
8
8
 
9
9
  - [Synopsis](#synopsis)
10
10
  - [Features](#features)
11
+ - [Requirements](#requirements)
11
12
  - [Installation](#installation)
12
13
  - [Usage](#usage)
13
14
  - [Configuration features](#configuration-features)
@@ -26,6 +27,8 @@ Configurable framework agnostic plain Ruby email validator. Verify email via Reg
26
27
  - [With default regex pattern](#with-default-regex-pattern)
27
28
  - [With custom regex pattern](#with-custom-regex-pattern)
28
29
  - [DNS (MX) validation](#mx-validation)
30
+ - [RFC MX lookup flow](#rfc-mx-lookup-flow)
31
+ - [Not RFC MX lookup flow](#not-rfc-mx-lookup-flow)
29
32
  - [SMTP validation](#smtp-validation)
30
33
  - [SMTP safe check disabled](#smtp-safe-check-disabled)
31
34
  - [SMTP safe check enabled](#smtp-safe-check-enabled)
@@ -69,6 +72,10 @@ Also Truemail gem allows performing an audit of the host in which runs.
69
72
  - Event logger
70
73
  - JSON serializer
71
74
 
75
+ ## Requirements
76
+
77
+ Ruby MRI 2.5.0+
78
+
72
79
  ## Installation
73
80
 
74
81
  Add this line to your application's Gemfile:
@@ -79,11 +86,15 @@ gem 'truemail'
79
86
 
80
87
  And then execute:
81
88
 
82
- $ bundle
89
+ ```bash
90
+ bundle
91
+ ```
83
92
 
84
93
  Or install it yourself as:
85
94
 
86
- $ gem install truemail
95
+ ```bash
96
+ gem install truemail
97
+ ```
87
98
 
88
99
  ## Usage
89
100
 
@@ -168,6 +179,11 @@ Truemail.configure do |config|
168
179
  # It is equal to empty array by default.
169
180
  config.blacklisted_domains = ['somedomain1.com', 'somedomain2.com']
170
181
 
182
+ # Optional parameter. This option will provide to use not RFC MX lookup flow.
183
+ # It means that MX and Null MX records will be cheked on the DNS validation layer only.
184
+ # By default this option is disabled.
185
+ config.not_rfc_mx_lookup_flow = true
186
+
171
187
  # Optional parameter. This option will be parse bodies of SMTP errors. It will be helpful
172
188
  # if SMTP server does not return an exact answer that the email does not exist
173
189
  # By default this option is disabled, available for SMTP validation only.
@@ -198,7 +214,8 @@ Truemail.configuration
198
214
  @whitelist_validation=true,
199
215
  @blacklisted_domains=[],
200
216
  @verifier_domain="somedomain.com",
201
- @verifier_email="verifier@example.com"
217
+ @verifier_email="verifier@example.com",
218
+ @not_rfc_mx_lookup_flow=true,
202
219
  @smtp_safe_check=true,
203
220
  @logger=#<Truemail::Logger:0x0000557f837450b0
204
221
  @event=:all, @file="/home/app/log/truemail.log", @stdout=true>>
@@ -227,6 +244,7 @@ Truemail.configuration
227
244
  @blacklisted_domains=[],
228
245
  @verifier_domain="somedomain.com",
229
246
  @verifier_email="verifier@example.com",
247
+ @not_rfc_mx_lookup_flow=true,
230
248
  @smtp_safe_check=true,
231
249
  @logger=#<Truemail::Logger:0x0000557f837450b0
232
250
  @event=:all, @file="/home/app/log/truemail.log", @stdout=true>>
@@ -309,6 +327,7 @@ Truemail.validate('email@white-domain.com')
309
327
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
310
328
  @response_timeout=2,
311
329
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
330
+ @not_rfc_mx_lookup_flow=false,
312
331
  @smtp_safe_check=false,
313
332
  @validation_type_by_domain={"somedomain.com"=>:mx},
314
333
  @verifier_domain="example.com",
@@ -355,6 +374,7 @@ Truemail.validate('email@white-domain.com', with: :regex)
355
374
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
356
375
  @response_timeout=2,
357
376
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
377
+ @not_rfc_mx_lookup_flow=false,
358
378
  @smtp_safe_check=false,
359
379
  @validation_type_by_domain={},
360
380
  @verifier_domain="example.com",
@@ -386,6 +406,7 @@ Truemail.validate('email@domain.com', with: :regex)
386
406
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
387
407
  @response_timeout=2,
388
408
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
409
+ @not_rfc_mx_lookup_flow=false,
389
410
  @smtp_safe_check=false,
390
411
  @validation_type_by_domain={},
391
412
  @verifier_domain="example.com",
@@ -419,6 +440,7 @@ Truemail.validate('email@black-domain.com')
419
440
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
420
441
  @response_timeout=2,
421
442
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
443
+ @not_rfc_mx_lookup_flow=false,
422
444
  @smtp_safe_check=false,
423
445
  @validation_type_by_domain={},
424
446
  @verifier_domain="example.com",
@@ -452,6 +474,7 @@ Truemail.validate('email@somedomain.com')
452
474
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
453
475
  @response_timeout=2,
454
476
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
477
+ @not_rfc_mx_lookup_flow=false,
455
478
  @smtp_safe_check=false,
456
479
  @validation_type_by_domain={},
457
480
  @verifier_domain="example.com",
@@ -501,6 +524,7 @@ Truemail.validate('email@example.com', with: :regex)
501
524
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
502
525
  @response_timeout=2,
503
526
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
527
+ @not_rfc_mx_lookup_flow=false,
504
528
  @smtp_safe_check=false,
505
529
  @validation_type_by_domain={},
506
530
  @verifier_domain="example.com",
@@ -542,6 +566,7 @@ Truemail.validate('email@example.com', with: :regex)
542
566
  @email_pattern=/regex_pattern/,
543
567
  @response_timeout=2,
544
568
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
569
+ @not_rfc_mx_lookup_flow=false,
545
570
  @smtp_safe_check=false,
546
571
  @validation_type_by_domain={},
547
572
  @verifier_domain="example.com",
@@ -559,7 +584,11 @@ In fact it's DNS validation because it checks not MX records only. DNS validatio
559
584
  [Whitelist/Blacklist] -> [Regex validation] -> [MX validation]
560
585
  ```
561
586
 
562
- Please note, Truemail MX validator not performs strict compliance of the [RFC 5321](https://tools.ietf.org/html/rfc5321#section-5) standard for best validation outcome.
587
+ Please note, Truemail MX validator [not performs](https://github.com/rubygarage/truemail/issues/26) strict compliance of the [RFC 5321](https://tools.ietf.org/html/rfc5321#section-5) standard for best validation outcome.
588
+
589
+ ##### RFC MX lookup flow
590
+
591
+ [Truemail MX lookup](https://slides.com/vladislavtrotsenko/truemail#/0/9) based on RFC 5321. It consists of 3 substeps: MX, CNAME and A record resolvers. The point of each resolver is attempt to extract the mail servers from email domain. If at least one server exists that validation is successful. Iteration is processing until resolver returns true.
563
592
 
564
593
  Example of usage:
565
594
 
@@ -590,6 +619,51 @@ Truemail.validate('email@example.com', with: :mx)
590
619
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
591
620
  @response_timeout=2,
592
621
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
622
+ @not_rfc_mx_lookup_flow=false,
623
+ @smtp_safe_check=false,
624
+ @validation_type_by_domain={},
625
+ @verifier_domain="example.com",
626
+ @verifier_email="verifier@example.com",
627
+ @whitelist_validation=false,
628
+ @whitelisted_domains=[]>,
629
+ @validation_type=:mx>
630
+ ```
631
+
632
+ ##### Not RFC MX lookup flow
633
+
634
+ Also Truemail has possibility to use not RFC MX lookup flow. It means that will be used only one MX resolver on the DNS validation layer. By default this option is disabled.
635
+
636
+ Example of usage:
637
+
638
+ ```ruby
639
+ require 'truemail'
640
+
641
+ Truemail.configure do |config|
642
+ config.verifier_email = 'verifier@example.com'
643
+ config.not_rfc_mx_lookup_flow = true
644
+ end
645
+
646
+ Truemail.validate('email@example.com', with: :mx)
647
+
648
+ => #<Truemail::Validator:0x000055590c9c1c50
649
+ @result=
650
+ #<struct Truemail::Validator::Result
651
+ success=true,
652
+ email="email@example.com",
653
+ domain="example.com",
654
+ mail_servers=["127.0.1.1", "127.0.1.2"],
655
+ errors={},
656
+ smtp_debug=nil>,
657
+ configuration=
658
+ #<Truemail::Configuration:0x0000559b6e44af70
659
+ @blacklisted_domains=[],
660
+ @connection_attempts=2,
661
+ @connection_timeout=2,
662
+ @default_validation_type=:smtp,
663
+ @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
664
+ @response_timeout=2,
665
+ @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
666
+ @not_rfc_mx_lookup_flow=true,
593
667
  @smtp_safe_check=false,
594
668
  @validation_type_by_domain={},
595
669
  @verifier_domain="example.com",
@@ -611,7 +685,7 @@ If total count of MX servers is equal to one, ```Truemail::Smtp``` validator wil
611
685
 
612
686
  By default, you don't need pass with-parameter to use it. Example of usage is specified below:
613
687
 
614
- ###### SMTP safe check disabled
688
+ ##### SMTP safe check disabled
615
689
 
616
690
  With ```smtp_safe_check = false```
617
691
 
@@ -643,6 +717,7 @@ Truemail.validate('email@example.com')
643
717
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
644
718
  @response_timeout=2,
645
719
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
720
+ @not_rfc_mx_lookup_flow=false,
646
721
  @smtp_safe_check=false,
647
722
  @validation_type_by_domain={},
648
723
  @verifier_domain="example.com",
@@ -694,6 +769,7 @@ Truemail.validate('email@example.com')
694
769
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
695
770
  @response_timeout=2,
696
771
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
772
+ @not_rfc_mx_lookup_flow=false,
697
773
  @smtp_safe_check=false,
698
774
  @validation_type_by_domain={},
699
775
  @verifier_domain="example.com",
@@ -703,8 +779,7 @@ Truemail.validate('email@example.com')
703
779
  @validation_type=:smtp>
704
780
  ```
705
781
 
706
-
707
- ###### SMTP safe check enabled
782
+ ##### SMTP safe check enabled
708
783
 
709
784
  With ```smtp_safe_check = true```
710
785
 
@@ -758,6 +833,7 @@ Truemail.validate('email@example.com')
758
833
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
759
834
  @response_timeout=2,
760
835
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
836
+ @not_rfc_mx_lookup_flow=false,
761
837
  @smtp_safe_check=false,
762
838
  @validation_type_by_domain={},
763
839
  @verifier_domain="example.com",
@@ -806,6 +882,7 @@ Truemail.validate('email@example.com')
806
882
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
807
883
  @response_timeout=2,
808
884
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
885
+ @not_rfc_mx_lookup_flow=false,
809
886
  @smtp_safe_check=false,
810
887
  @validation_type_by_domain={},
811
888
  @verifier_domain="example.com",
@@ -895,6 +972,7 @@ Truemail.host_audit
895
972
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
896
973
  @response_timeout=2,
897
974
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
975
+ @not_rfc_mx_lookup_flow=false,
898
976
  @smtp_safe_check=false,
899
977
  @validation_type_by_domain={},
900
978
  @verifier_domain="example.com",
@@ -917,6 +995,7 @@ Truemail.host_audit
917
995
  @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
918
996
  @response_timeout=2,
919
997
  @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
998
+ @not_rfc_mx_lookup_flow=false,
920
999
  @smtp_safe_check=false,
921
1000
  @validation_type_by_domain={},
922
1001
  @verifier_domain="example.com",
@@ -1008,21 +1087,18 @@ end
1008
1087
  ```
1009
1088
 
1010
1089
  ---
1090
+
1011
1091
  ## Truemail family
1012
1092
 
1013
1093
  All Truemail extensions: https://github.com/truemail-rb
1014
1094
 
1015
- ### truemail server
1016
-
1017
- Lightweight rack based web API wrapper for Truemail, https://github.com/truemail-rb/truemail-rack
1018
-
1019
- ### truemail-rack-docker-image
1020
-
1021
- Lightweight rack based web API dockerized image :whale: of [Truemail server](https://github.com/truemail-rb/truemail-rack) hosted on [dockerhub](https://hub.docker.com/r/truemail/truemail-rack), https://github.com/truemail-rb/truemail-rack-docker-image
1022
-
1023
- ### truemail-rspec
1024
-
1025
- gem `truemail-rspec` - Truemail configuration and validator RSpec helpers, https://github.com/truemail-rb/truemail-rspec
1095
+ | Name | Type | Description |
1096
+ | --- | --- | --- |
1097
+ | [truemail server](https://github.com/truemail-rb/truemail-rack) | ruby app | Lightweight rack based web API wrapper for Truemail |
1098
+ | [truemail-rack-docker](https://github.com/truemail-rb/truemail-rack-docker-image) | docker image | Lightweight rack based web API [dockerized image](https://hub.docker.com/r/truemail/truemail-rack) :whale: of Truemail server |
1099
+ | [truemail-ruby-client](https://github.com/truemail-rb/truemail-ruby-client) | ruby gem | Truemail web API client library for Ruby |
1100
+ | [truemail-crystal-client](https://github.com/truemail-rb/truemail-crystal-client) | crystal shard | Truemail web API client library for Crystal |
1101
+ | [truemail-rspec](https://github.com/truemail-rb/truemail-rspec) | ruby gem | Truemail configuration and validator RSpec helpers |
1026
1102
 
1027
1103
  ## Contributing
1028
1104
 
@@ -20,7 +20,7 @@ module Truemail
20
20
  :blacklisted_domains,
21
21
  :logger
22
22
 
23
- attr_accessor :whitelist_validation, :smtp_safe_check
23
+ attr_accessor :whitelist_validation, :not_rfc_mx_lookup_flow, :smtp_safe_check
24
24
 
25
25
  def initialize(&block)
26
26
  instance_initializer.each do |instace_variable, value|
@@ -99,6 +99,7 @@ module Truemail
99
99
  whitelisted_domains: [],
100
100
  whitelist_validation: false,
101
101
  blacklisted_domains: [],
102
+ not_rfc_mx_lookup_flow: false,
102
103
  smtp_safe_check: false
103
104
  }
104
105
  end
@@ -19,6 +19,7 @@ module Truemail
19
19
  private
20
20
 
21
21
  def host_extractor_methods
22
+ return %i[hosts_from_mx_records?] if configuration.not_rfc_mx_lookup_flow
22
23
  %i[hosts_from_mx_records? hosts_from_cname_records? host_from_a_record?]
23
24
  end
24
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '1.6.1'
4
+ VERSION = '1.7.0'
5
5
  end
@@ -27,17 +27,17 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_development_dependency 'bundler', '~> 1.16'
29
29
  spec.add_development_dependency 'bundler-audit', '~> 0.6.1'
30
- spec.add_development_dependency 'fasterer', '~> 0.8.2'
30
+ spec.add_development_dependency 'fasterer', '~> 0.8.3'
31
31
  spec.add_development_dependency 'ffaker', '~> 2.14'
32
32
  spec.add_development_dependency 'json_matchers', '~> 0.11.1'
33
- spec.add_development_dependency 'overcommit', '~> 0.52.1'
33
+ spec.add_development_dependency 'overcommit', '~> 0.53.0'
34
34
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
35
35
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
36
- spec.add_development_dependency 'reek', '~> 5.6'
36
+ spec.add_development_dependency 'reek', '~> 6.0'
37
37
  spec.add_development_dependency 'rspec', '~> 3.9'
38
38
  spec.add_development_dependency 'rubocop', '~> 0.79.0'
39
39
  spec.add_development_dependency 'rubocop-performance', '~> 1.5', '>= 1.5.2'
40
- spec.add_development_dependency 'rubocop-rspec', '~> 1.37', '>= 1.37.1'
40
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.39'
41
41
  spec.add_development_dependency 'simplecov', '~> 0.17.1'
42
- spec.add_development_dependency 'truemail-rspec', '~> 0.1.1'
42
+ spec.add_development_dependency 'truemail-rspec', '~> 0.1.2'
43
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: truemail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-23 00:00:00.000000000 Z
11
+ date: 2020-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simpleidn
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.2
61
+ version: 0.8.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.8.2
68
+ version: 0.8.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ffaker
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.52.1
103
+ version: 0.53.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.52.1
110
+ version: 0.53.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pry-byebug
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '5.6'
151
+ version: '6.0'
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '5.6'
158
+ version: '6.0'
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: rspec
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -210,20 +210,14 @@ dependencies:
210
210
  requirements:
211
211
  - - "~>"
212
212
  - !ruby/object:Gem::Version
213
- version: '1.37'
214
- - - ">="
215
- - !ruby/object:Gem::Version
216
- version: 1.37.1
213
+ version: '1.39'
217
214
  type: :development
218
215
  prerelease: false
219
216
  version_requirements: !ruby/object:Gem::Requirement
220
217
  requirements:
221
218
  - - "~>"
222
219
  - !ruby/object:Gem::Version
223
- version: '1.37'
224
- - - ">="
225
- - !ruby/object:Gem::Version
226
- version: 1.37.1
220
+ version: '1.39'
227
221
  - !ruby/object:Gem::Dependency
228
222
  name: simplecov
229
223
  requirement: !ruby/object:Gem::Requirement
@@ -244,14 +238,14 @@ dependencies:
244
238
  requirements:
245
239
  - - "~>"
246
240
  - !ruby/object:Gem::Version
247
- version: 0.1.1
241
+ version: 0.1.2
248
242
  type: :development
249
243
  prerelease: false
250
244
  version_requirements: !ruby/object:Gem::Requirement
251
245
  requirements:
252
246
  - - "~>"
253
247
  - !ruby/object:Gem::Version
254
- version: 0.1.1
248
+ version: 0.1.2
255
249
  description: Configurable framework agnostic plain Ruby email validator. Verify email
256
250
  via Regex, DNS and SMTP.
257
251
  email: