truemail 2.4.1 → 2.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +37 -19
- data/.codeclimate.yml +1 -1
- data/.rubocop.yml +24 -0
- data/CHANGELOG.md +55 -0
- data/Gemfile.lock +35 -34
- data/README.md +12 -11
- data/lib/truemail/core.rb +1 -1
- data/lib/truemail/log/serializer/base.rb +6 -6
- data/lib/truemail/validate/mx.rb +4 -2
- data/lib/truemail/validate/smtp/request.rb +1 -1
- data/lib/truemail/version.rb +1 -1
- data/truemail.gemspec +10 -10
- metadata +37 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b2201740b5ebff1faab259b9fc6f824c3a1d35ae09c7e39ad1a12ec669acfaa
|
4
|
+
data.tar.gz: ee1d67e7ce06d83f314f0e1bb3cb74c184ce5299e25d1dcc8303f34d07121e9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d778d06f21cd3c6fac2fc346ef576a060e47f502e1f83d1c06533c2857785f7589b85a0762cd0692ad18b0520cb44531840821dd986eb1ff3d687b90e524ac7f
|
7
|
+
data.tar.gz: d493f1b19593721bf6d7c86c2a7534a4a6a856642a095b213746b44a4e7e4c99e1cde52d6f026bdbdbd1613176edfad904497159bd8e5756729d5b7e162a64ad
|
data/.circleci/config.yml
CHANGED
@@ -3,14 +3,19 @@ version: 2.1
|
|
3
3
|
defaults: &defaults
|
4
4
|
working_directory: ~/truemail
|
5
5
|
docker:
|
6
|
-
- image:
|
6
|
+
- image: cimg/ruby:<< parameters.ruby-version >>
|
7
7
|
environment:
|
8
8
|
CC_TEST_REPORTER_ID: 693272a1328521f6f7c09d7ffd419b21c00410da26e98e94c687fdd38b26e2cb
|
9
9
|
|
10
10
|
orbs:
|
11
|
-
ruby: circleci/ruby@1.1.
|
11
|
+
ruby: circleci/ruby@1.1.3
|
12
12
|
|
13
13
|
references:
|
14
|
+
install_bundler: &install_bundler
|
15
|
+
run:
|
16
|
+
name: Installing Bundler
|
17
|
+
command: gem i bundler -v $(tail -1 Gemfile.lock | tr -d ' ')
|
18
|
+
|
14
19
|
restore_bundle_cache: &restore_bundle_cache
|
15
20
|
restore_cache:
|
16
21
|
keys:
|
@@ -29,63 +34,71 @@ references:
|
|
29
34
|
|
30
35
|
install_codeclimate_reporter: &install_codeclimate_reporter
|
31
36
|
run:
|
32
|
-
name:
|
37
|
+
name: Installing CodeClimate test reporter
|
33
38
|
command: |
|
34
39
|
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
35
40
|
chmod +x ./cc-test-reporter
|
36
41
|
|
37
42
|
jobs:
|
38
|
-
linters:
|
43
|
+
linters-ruby:
|
44
|
+
parameters:
|
45
|
+
ruby-version:
|
46
|
+
type: string
|
47
|
+
|
39
48
|
<<: *defaults
|
40
49
|
|
41
50
|
steps:
|
42
51
|
- checkout
|
43
52
|
|
53
|
+
- <<: *install_bundler
|
44
54
|
- <<: *restore_bundle_cache
|
45
55
|
- <<: *bundle_install
|
46
56
|
- <<: *save_bundle_cache
|
47
57
|
|
48
58
|
- run:
|
49
|
-
name: Running
|
59
|
+
name: Running Overcommit
|
50
60
|
command: |
|
51
61
|
bundle exec overcommit -s
|
52
62
|
SKIP=AuthorEmail,AuthorName bundle exec overcommit -r
|
53
63
|
|
54
|
-
tests:
|
64
|
+
tests-ruby:
|
65
|
+
parameters:
|
66
|
+
ruby-version:
|
67
|
+
type: string
|
68
|
+
|
55
69
|
<<: *defaults
|
56
70
|
|
57
71
|
steps:
|
58
72
|
- checkout
|
59
73
|
|
74
|
+
- <<: *install_bundler
|
60
75
|
- <<: *restore_bundle_cache
|
61
76
|
- <<: *bundle_install
|
62
77
|
- <<: *save_bundle_cache
|
63
78
|
- <<: *install_codeclimate_reporter
|
64
79
|
|
65
80
|
- run:
|
66
|
-
name: Running
|
81
|
+
name: Running RSpec
|
67
82
|
command: |
|
68
|
-
mkdir /tmp/test-results
|
69
83
|
./cc-test-reporter before-build
|
70
84
|
bundle exec rspec
|
71
85
|
|
72
86
|
- run:
|
73
|
-
name:
|
87
|
+
name: Creating CodeClimate test coverage report
|
74
88
|
command: |
|
75
89
|
./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
|
76
90
|
|
77
|
-
- store_test_results:
|
78
|
-
path: /tmp/test-results
|
79
|
-
|
80
91
|
- store_artifacts:
|
81
|
-
|
82
|
-
|
92
|
+
name: Saving Simplecov coverage artifacts
|
93
|
+
path: ~/truemail/coverage
|
94
|
+
destination: coverage
|
83
95
|
|
84
96
|
- deploy:
|
97
|
+
name: Uploading CodeClimate test coverage report
|
85
98
|
command: |
|
86
99
|
./cc-test-reporter sum-coverage --output - --parts $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input -
|
87
100
|
|
88
|
-
compatibility-
|
101
|
+
compatibility-ruby:
|
89
102
|
parameters:
|
90
103
|
ruby-version:
|
91
104
|
type: string
|
@@ -94,7 +107,6 @@ jobs:
|
|
94
107
|
steps:
|
95
108
|
- checkout
|
96
109
|
- ruby/install-deps:
|
97
|
-
bundler-version: '1.16.6'
|
98
110
|
with-cache: false
|
99
111
|
path: './vendor/custom_bundle'
|
100
112
|
- run:
|
@@ -104,9 +116,15 @@ jobs:
|
|
104
116
|
workflows:
|
105
117
|
build_and_test:
|
106
118
|
jobs:
|
107
|
-
- linters
|
108
|
-
|
109
|
-
|
119
|
+
- linters-ruby:
|
120
|
+
matrix:
|
121
|
+
parameters:
|
122
|
+
ruby-version: ["2.5"]
|
123
|
+
- tests-ruby:
|
124
|
+
matrix:
|
125
|
+
parameters:
|
126
|
+
ruby-version: ["2.5"]
|
127
|
+
- compatibility-ruby:
|
110
128
|
matrix:
|
111
129
|
parameters:
|
112
130
|
ruby-version: ["2.6", "2.7", "3.0"]
|
data/.codeclimate.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -28,6 +28,9 @@ Naming/VariableNumber:
|
|
28
28
|
Naming/RescuedExceptionsVariableName:
|
29
29
|
Enabled: false
|
30
30
|
|
31
|
+
Naming/InclusiveLanguage:
|
32
|
+
Enabled: false
|
33
|
+
|
31
34
|
Style/Documentation:
|
32
35
|
Enabled: false
|
33
36
|
|
@@ -154,6 +157,15 @@ Style/HashConversion:
|
|
154
157
|
Style/StringChars:
|
155
158
|
Enabled: true
|
156
159
|
|
160
|
+
Style/InPatternThen:
|
161
|
+
Enabled: true
|
162
|
+
|
163
|
+
Style/MultilineInPatternThen:
|
164
|
+
Enabled: true
|
165
|
+
|
166
|
+
Style/QuotedSymbols:
|
167
|
+
Enabled: true
|
168
|
+
|
157
169
|
Layout/LineLength:
|
158
170
|
Max: 140
|
159
171
|
|
@@ -188,6 +200,9 @@ Layout/BeginEndAlignment:
|
|
188
200
|
Layout/SpaceBeforeBrackets:
|
189
201
|
Enabled: true
|
190
202
|
|
203
|
+
Layout/LineEndStringConcatenationIndentation:
|
204
|
+
Enabled: true
|
205
|
+
|
191
206
|
Lint/NonDeterministicRequireOrder:
|
192
207
|
Enabled: false
|
193
208
|
|
@@ -308,6 +323,9 @@ Lint/SymbolConversion:
|
|
308
323
|
Lint/TripleQuotes:
|
309
324
|
Enabled: true
|
310
325
|
|
326
|
+
Lint/EmptyInPattern:
|
327
|
+
Enabled: true
|
328
|
+
|
311
329
|
Gemspec/DateAssignment:
|
312
330
|
Enabled: true
|
313
331
|
|
@@ -388,3 +406,9 @@ RSpec/MultipleMemoizedHelpers:
|
|
388
406
|
|
389
407
|
RSpec/StubbedMock:
|
390
408
|
Enabled: false
|
409
|
+
|
410
|
+
RSpec/IdenticalEqualityAssertion:
|
411
|
+
Enabled: true
|
412
|
+
|
413
|
+
RSpec/Rails/AvoidSetupHook:
|
414
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,61 @@
|
|
2
2
|
|
3
3
|
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).
|
4
4
|
|
5
|
+
## [2.4.6] - 2021.07.10
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
- Wrong domain punycode extraction in DNS validation layer
|
10
|
+
|
11
|
+
### Updated
|
12
|
+
|
13
|
+
- Updated gem codebase, restored `Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL`
|
14
|
+
- Updated tests
|
15
|
+
|
16
|
+
## [2.4.5] - 2021.07.09
|
17
|
+
|
18
|
+
### Removed
|
19
|
+
|
20
|
+
- `Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL`
|
21
|
+
|
22
|
+
### Updated
|
23
|
+
|
24
|
+
- `Truemail::Validate::Mx`
|
25
|
+
- Updated gem development dependencies
|
26
|
+
- Updated gem version
|
27
|
+
|
28
|
+
## [2.4.4] - 2021.06.29
|
29
|
+
|
30
|
+
### Updated
|
31
|
+
|
32
|
+
Allowed using special characters in email user names (following [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696#page-6)) for default regex email pattern.
|
33
|
+
|
34
|
+
- Updated `Truemail::RegexConstant::REGEX_EMAIL_PATTERN`, tests
|
35
|
+
- Updated gem development dependencies
|
36
|
+
- Updated Rubocop/Codeclimate config
|
37
|
+
- Updated gem documentation, version
|
38
|
+
|
39
|
+
## [2.4.3] - 2021.06.15
|
40
|
+
|
41
|
+
### Updated
|
42
|
+
|
43
|
+
- Updated gem development dependencies
|
44
|
+
- Updated Rubocop/Codeclimate config
|
45
|
+
- Updated gem documentation, version
|
46
|
+
|
47
|
+
## [2.4.2] - 2021.05.13
|
48
|
+
|
49
|
+
### Fixed
|
50
|
+
|
51
|
+
- Fixed security vulnerability for bundler ([CVE-2019-3881](https://github.com/advisories/GHSA-g98m-96g9-wfjq))
|
52
|
+
- Fixed test coverage issues
|
53
|
+
|
54
|
+
### Updated
|
55
|
+
|
56
|
+
- Updated gem development dependencies
|
57
|
+
- Updated simplecov/CircleCi config
|
58
|
+
- Updated gem documentation, version
|
59
|
+
|
5
60
|
## [2.4.1] - 2021.05.05
|
6
61
|
|
7
62
|
### Updated
|
data/Gemfile.lock
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
truemail (2.4.
|
4
|
+
truemail (2.4.6)
|
5
5
|
simpleidn (~> 0.2.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.
|
10
|
+
addressable (2.8.0)
|
11
11
|
public_suffix (>= 2.0.2, < 5.0)
|
12
12
|
ast (2.4.2)
|
13
13
|
bundler-audit (0.8.0)
|
14
14
|
bundler (>= 1.2.0, < 3)
|
15
15
|
thor (~> 1.0)
|
16
16
|
byebug (11.1.3)
|
17
|
-
childprocess (4.
|
17
|
+
childprocess (4.1.0)
|
18
18
|
coderay (1.1.3)
|
19
19
|
colorize (0.8.1)
|
20
|
-
concurrent-ruby (1.1.
|
20
|
+
concurrent-ruby (1.1.9)
|
21
21
|
crack (0.4.5)
|
22
22
|
rexml
|
23
23
|
diff-lcs (1.4.4)
|
24
|
-
dns_mock (1.
|
25
|
-
docile (1.
|
26
|
-
faker (2.
|
24
|
+
dns_mock (1.3.1)
|
25
|
+
docile (1.4.0)
|
26
|
+
faker (2.18.0)
|
27
27
|
i18n (>= 1.6, < 2)
|
28
28
|
fasterer (0.9.0)
|
29
29
|
colorize (~> 0.7)
|
@@ -38,11 +38,12 @@ GEM
|
|
38
38
|
json_schema (0.21.0)
|
39
39
|
kwalify (0.7.2)
|
40
40
|
method_source (1.0.0)
|
41
|
-
overcommit (0.
|
41
|
+
overcommit (0.58.0)
|
42
42
|
childprocess (>= 0.6.3, < 5)
|
43
43
|
iniparse (~> 1.4)
|
44
|
+
rexml (~> 3.2)
|
44
45
|
parallel (1.20.1)
|
45
|
-
parser (3.0.
|
46
|
+
parser (3.0.2.0)
|
46
47
|
ast (~> 2.4.1)
|
47
48
|
pry (0.13.1)
|
48
49
|
coderay (~> 1.1)
|
@@ -50,10 +51,10 @@ GEM
|
|
50
51
|
pry-byebug (3.9.0)
|
51
52
|
byebug (~> 11.0)
|
52
53
|
pry (~> 0.13.0)
|
53
|
-
psych (3.3.
|
54
|
+
psych (3.3.2)
|
54
55
|
public_suffix (4.0.6)
|
55
56
|
rainbow (3.0.0)
|
56
|
-
rake (13.0.
|
57
|
+
rake (13.0.6)
|
57
58
|
reek (6.0.4)
|
58
59
|
kwalify (~> 0.7.0)
|
59
60
|
parser (~> 3.0.0)
|
@@ -74,27 +75,27 @@ GEM
|
|
74
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
75
76
|
rspec-support (~> 3.10.0)
|
76
77
|
rspec-support (3.10.2)
|
77
|
-
rubocop (1.
|
78
|
+
rubocop (1.18.3)
|
78
79
|
parallel (~> 1.10)
|
79
80
|
parser (>= 3.0.0.0)
|
80
81
|
rainbow (>= 2.2.2, < 4.0)
|
81
82
|
regexp_parser (>= 1.8, < 3.0)
|
82
83
|
rexml
|
83
|
-
rubocop-ast (>= 1.
|
84
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
84
85
|
ruby-progressbar (~> 1.7)
|
85
86
|
unicode-display_width (>= 1.4.0, < 3.0)
|
86
|
-
rubocop-ast (1.
|
87
|
+
rubocop-ast (1.7.0)
|
87
88
|
parser (>= 3.0.1.1)
|
88
|
-
rubocop-performance (1.11.
|
89
|
+
rubocop-performance (1.11.4)
|
89
90
|
rubocop (>= 1.7.0, < 2.0)
|
90
91
|
rubocop-ast (>= 0.4.0)
|
91
|
-
rubocop-rspec (2.
|
92
|
+
rubocop-rspec (2.4.0)
|
92
93
|
rubocop (~> 1.0)
|
93
94
|
rubocop-ast (>= 1.1.0)
|
94
95
|
ruby-progressbar (1.11.0)
|
95
|
-
ruby_parser (3.
|
96
|
-
sexp_processor (~> 4.
|
97
|
-
sexp_processor (4.15.
|
96
|
+
ruby_parser (3.16.0)
|
97
|
+
sexp_processor (~> 4.15, >= 4.15.1)
|
98
|
+
sexp_processor (4.15.3)
|
98
99
|
simplecov (0.17.1)
|
99
100
|
docile (~> 1.1)
|
100
101
|
json (>= 1.8, < 3)
|
@@ -103,41 +104,41 @@ GEM
|
|
103
104
|
simpleidn (0.2.1)
|
104
105
|
unf (~> 0.1.4)
|
105
106
|
thor (1.1.0)
|
106
|
-
truemail-rspec (0.
|
107
|
+
truemail-rspec (0.6.0)
|
107
108
|
faker (~> 2.17)
|
108
109
|
rspec (~> 3.10)
|
109
|
-
truemail (>= 2.
|
110
|
+
truemail (>= 2.4)
|
110
111
|
unf (0.1.4)
|
111
112
|
unf_ext
|
112
113
|
unf_ext (0.0.7.7)
|
113
114
|
unicode-display_width (2.0.0)
|
114
|
-
webmock (3.
|
115
|
+
webmock (3.13.0)
|
115
116
|
addressable (>= 2.3.6)
|
116
117
|
crack (>= 0.3.2)
|
117
118
|
hashdiff (>= 0.4.0, < 2.0.0)
|
118
119
|
|
119
120
|
PLATFORMS
|
120
|
-
|
121
|
+
x86_64-darwin-20
|
121
122
|
|
122
123
|
DEPENDENCIES
|
123
|
-
bundler (~>
|
124
|
+
bundler (~> 2.2, >= 2.2.23)
|
124
125
|
bundler-audit (~> 0.8.0)
|
125
|
-
dns_mock (~> 1.
|
126
|
-
faker (~> 2.
|
126
|
+
dns_mock (~> 1.3, >= 1.3.1)
|
127
|
+
faker (~> 2.18)
|
127
128
|
fasterer (~> 0.9.0)
|
128
129
|
json_matchers (~> 0.11.1)
|
129
|
-
overcommit (~> 0.
|
130
|
+
overcommit (~> 0.58.0)
|
130
131
|
pry-byebug (~> 3.9)
|
131
|
-
rake (~> 13.0, >= 13.0.
|
132
|
+
rake (~> 13.0, >= 13.0.6)
|
132
133
|
reek (~> 6.0, >= 6.0.4)
|
133
134
|
rspec (~> 3.10)
|
134
|
-
rubocop (~> 1.
|
135
|
-
rubocop-performance (~> 1.11, >= 1.11.
|
136
|
-
rubocop-rspec (~> 2.
|
135
|
+
rubocop (~> 1.18, >= 1.18.3)
|
136
|
+
rubocop-performance (~> 1.11, >= 1.11.4)
|
137
|
+
rubocop-rspec (~> 2.4)
|
137
138
|
simplecov (~> 0.17.1)
|
138
139
|
truemail!
|
139
|
-
truemail-rspec (~> 0.
|
140
|
-
webmock (~> 3.
|
140
|
+
truemail-rspec (~> 0.6)
|
141
|
+
webmock (~> 3.13)
|
141
142
|
|
142
143
|
BUNDLED WITH
|
143
|
-
|
144
|
+
2.2.23
|
data/README.md
CHANGED
@@ -178,11 +178,12 @@ Truemail.configure do |config|
|
|
178
178
|
|
179
179
|
# Optional parameter. You can predefine default validation type for
|
180
180
|
# Truemail.validate('email@email.com') call without with-parameter
|
181
|
-
# Available validation types: :regex, :mx, :smtp
|
181
|
+
# Available validation types: :regex, :mx, :mx_blacklist, :smtp
|
182
182
|
config.default_validation_type = :mx
|
183
183
|
|
184
184
|
# Optional parameter. You can predefine which type of validation will be used for domains.
|
185
|
-
# Also you can skip validation by domain.
|
185
|
+
# Also you can skip validation by domain.
|
186
|
+
# Available validation types: :regex, :mx, :mx_blacklist, :smtp
|
186
187
|
# This configuration will be used over current or default validation type parameter
|
187
188
|
# All of validations for 'somedomain.com' will be processed with regex validation only.
|
188
189
|
# And all of validations for 'otherdomain.com' will be processed with mx validation only.
|
@@ -192,7 +193,7 @@ Truemail.configure do |config|
|
|
192
193
|
# Optional parameter. Validation of email which contains whitelisted domain always will
|
193
194
|
# return true. Other validations will not processed even if it was defined in validation_type_for
|
194
195
|
# It is equal to empty array by default.
|
195
|
-
config.whitelisted_domains = [
|
196
|
+
config.whitelisted_domains = %w[somedomain1.com somedomain2.com]
|
196
197
|
|
197
198
|
# Optional parameter. With this option Truemail will validate email which contains whitelisted
|
198
199
|
# domain only, i.e. if domain whitelisted, validation will passed to Regex, MX or SMTP validators.
|
@@ -203,18 +204,18 @@ Truemail.configure do |config|
|
|
203
204
|
# Optional parameter. Validation of email which contains blacklisted domain always will
|
204
205
|
# return false. Other validations will not processed even if it was defined in validation_type_for
|
205
206
|
# It is equal to empty array by default.
|
206
|
-
config.blacklisted_domains = [
|
207
|
+
config.blacklisted_domains = %w[somedomain3.com somedomain4.com]
|
207
208
|
|
208
209
|
# Optional parameter. With this option Truemail will filter out unwanted mx servers via
|
209
210
|
# predefined list of ip addresses. It can be used as a part of DEA (disposable email
|
210
211
|
# address) validations. It is equal to empty array by default.
|
211
|
-
config.blacklisted_mx_ip_addresses = [
|
212
|
+
config.blacklisted_mx_ip_addresses = %w[1.1.1.1 2.2.2.2]
|
212
213
|
|
213
214
|
# Optional parameter. This option will provide to use custom DNS gateway when Truemail
|
214
215
|
# interacts with DNS. Valid port numbers are in the range 1-65535. If you won't specify
|
215
216
|
# nameserver's ports Truemail will use default DNS TCP/UDP port 53. By default Truemail
|
216
217
|
# uses DNS gateway from system settings and this option is equal to empty array.
|
217
|
-
config.dns = [
|
218
|
+
config.dns = %w[10.0.0.1 10.0.0.2:54]
|
218
219
|
|
219
220
|
# Optional parameter. This option will provide to use not RFC MX lookup flow.
|
220
221
|
# It means that MX and Null MX records will be cheked on the DNS validation layer only.
|
@@ -222,7 +223,7 @@ Truemail.configure do |config|
|
|
222
223
|
config.not_rfc_mx_lookup_flow = true
|
223
224
|
|
224
225
|
# Optional parameter. This option will provide to use smtp fail fast behaviour. When
|
225
|
-
# smtp_fail_fast = true it means that
|
226
|
+
# smtp_fail_fast = true it means that Truemail ends smtp validation session after first
|
226
227
|
# attempt on the first mx server in any fail cases (network connection/timeout error,
|
227
228
|
# smtp validation error). This feature helps to reduce total time of SMTP validation
|
228
229
|
# session up to 1 second. By default this option is disabled.
|
@@ -350,8 +351,8 @@ require 'truemail'
|
|
350
351
|
|
351
352
|
Truemail.configure do |config|
|
352
353
|
config.verifier_email = 'verifier@example.com'
|
353
|
-
config.whitelisted_domains = [
|
354
|
-
config.blacklisted_domains = [
|
354
|
+
config.whitelisted_domains = %w[white-domain.com somedomain.com]
|
355
|
+
config.blacklisted_domains = %w[black-domain.com somedomain.com]
|
355
356
|
config.validation_type_for = { 'somedomain.com' => :mx }
|
356
357
|
end
|
357
358
|
```
|
@@ -399,7 +400,7 @@ require 'truemail'
|
|
399
400
|
|
400
401
|
Truemail.configure do |config|
|
401
402
|
config.verifier_email = 'verifier@example.com'
|
402
|
-
config.whitelisted_domains = [
|
403
|
+
config.whitelisted_domains = %w[white-domain.com]
|
403
404
|
config.whitelist_validation = true
|
404
405
|
end
|
405
406
|
```
|
@@ -767,7 +768,7 @@ require 'truemail'
|
|
767
768
|
|
768
769
|
Truemail.configure do |config|
|
769
770
|
config.verifier_email = 'verifier@example.com'
|
770
|
-
config.blacklisted_mx_ip_addresses = [
|
771
|
+
config.blacklisted_mx_ip_addresses = %w[127.0.1.2]
|
771
772
|
end
|
772
773
|
|
773
774
|
Truemail.validate('email@example.com', with: :mx_blacklist)
|
data/lib/truemail/core.rb
CHANGED
@@ -20,7 +20,7 @@ module Truemail
|
|
20
20
|
|
21
21
|
module RegexConstant
|
22
22
|
REGEX_DOMAIN = /[\p{L}0-9]+([\-.]{1}[\p{L}0-9]+)*\.\p{L}{2,63}/i.freeze
|
23
|
-
REGEX_EMAIL_PATTERN = /(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w
|
23
|
+
REGEX_EMAIL_PATTERN = /(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\W\w]*)@(#{REGEX_DOMAIN})\z)/.freeze
|
24
24
|
REGEX_DOMAIN_PATTERN = /(?=\A.{4,255}\z)(\A#{REGEX_DOMAIN}\z)/.freeze
|
25
25
|
REGEX_DOMAIN_FROM_EMAIL = /\A.+@(.+)\z/.freeze
|
26
26
|
REGEX_SMTP_ERROR_BODY_PATTERN = /(?=.*550)(?=.*(user|account|customer|mailbox)).*/i.freeze
|
@@ -40,20 +40,20 @@ module Truemail
|
|
40
40
|
|
41
41
|
Truemail::Log::Serializer::Base::CONFIGURATION_ARRAY_ATTRS.each do |method|
|
42
42
|
define_method(method) do
|
43
|
-
|
44
|
-
return if
|
45
|
-
|
43
|
+
executor_configuration_attr = executor_configuration.public_send(method)
|
44
|
+
return if executor_configuration_attr.empty?
|
45
|
+
executor_configuration_attr
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
Truemail::Log::Serializer::Base::CONFIGURATION_REGEX_ATTRS.each do |method|
|
50
50
|
define_method(method) do
|
51
|
-
|
51
|
+
executor_configuration_attr = executor_configuration.public_send(method)
|
52
52
|
default_pattern = Truemail::RegexConstant.const_get(
|
53
53
|
(method.eql?(:email_pattern) ? :regex_email_pattern : :regex_smtp_error_body_pattern).upcase
|
54
54
|
)
|
55
|
-
return Truemail::Log::Serializer::Base::DEFAULT_GEM_VALUE if
|
56
|
-
|
55
|
+
return Truemail::Log::Serializer::Base::DEFAULT_GEM_VALUE if executor_configuration_attr.eql?(default_pattern)
|
56
|
+
executor_configuration_attr
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
data/lib/truemail/validate/mx.rb
CHANGED
@@ -8,7 +8,6 @@ module Truemail
|
|
8
8
|
|
9
9
|
def run
|
10
10
|
return false unless Truemail::Validate::Regex.check(result)
|
11
|
-
result.domain = result.punycode_email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
|
12
11
|
return true if success(mx_lookup && domain_not_include_null_mx)
|
13
12
|
mail_servers.clear && add_error(Truemail::Validate::Mx::ERROR)
|
14
13
|
false
|
@@ -53,7 +52,10 @@ module Truemail
|
|
53
52
|
end
|
54
53
|
|
55
54
|
def domain
|
56
|
-
|
55
|
+
@domain ||= begin
|
56
|
+
result.domain = result.email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
|
57
|
+
result.punycode_email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
|
58
|
+
end
|
57
59
|
end
|
58
60
|
|
59
61
|
def hosts_from_mx_records?
|
@@ -50,7 +50,7 @@ module Truemail
|
|
50
50
|
REQUEST_PARAMS = %i[connection_timeout response_timeout verifier_domain verifier_email].freeze
|
51
51
|
|
52
52
|
def initialize(configuration)
|
53
|
-
REQUEST_PARAMS.each do |attribute|
|
53
|
+
Truemail::Validate::Smtp::Request::Configuration::REQUEST_PARAMS.each do |attribute|
|
54
54
|
self.class.class_eval { attr_reader attribute }
|
55
55
|
instance_variable_set(:"@#{attribute}", configuration.public_send(attribute))
|
56
56
|
end
|
data/lib/truemail/version.rb
CHANGED
data/truemail.gemspec
CHANGED
@@ -33,21 +33,21 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
spec.add_runtime_dependency 'simpleidn', '~> 0.2.1'
|
35
35
|
|
36
|
-
spec.add_development_dependency 'bundler', '~>
|
36
|
+
spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.23'
|
37
37
|
spec.add_development_dependency 'bundler-audit', '~> 0.8.0'
|
38
|
-
spec.add_development_dependency 'dns_mock', '~> 1.
|
39
|
-
spec.add_development_dependency 'faker', '~> 2.
|
38
|
+
spec.add_development_dependency 'dns_mock', '~> 1.3', '>= 1.3.1'
|
39
|
+
spec.add_development_dependency 'faker', '~> 2.18'
|
40
40
|
spec.add_development_dependency 'fasterer', '~> 0.9.0'
|
41
41
|
spec.add_development_dependency 'json_matchers', '~> 0.11.1'
|
42
|
-
spec.add_development_dependency 'overcommit', '~> 0.
|
42
|
+
spec.add_development_dependency 'overcommit', '~> 0.58.0'
|
43
43
|
spec.add_development_dependency 'pry-byebug', '~> 3.9'
|
44
|
-
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.
|
44
|
+
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
|
45
45
|
spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.4'
|
46
46
|
spec.add_development_dependency 'rspec', '~> 3.10'
|
47
|
-
spec.add_development_dependency 'rubocop', '~> 1.
|
48
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.
|
49
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 2.
|
47
|
+
spec.add_development_dependency 'rubocop', '~> 1.18', '>= 1.18.3'
|
48
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.4'
|
49
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.4'
|
50
50
|
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
51
|
-
spec.add_development_dependency 'truemail-rspec', '~> 0.
|
52
|
-
spec.add_development_dependency 'webmock', '~> 3.
|
51
|
+
spec.add_development_dependency 'truemail-rspec', '~> 0.6'
|
52
|
+
spec.add_development_dependency 'webmock', '~> 3.13'
|
53
53
|
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: 2.4.
|
4
|
+
version: 2.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Trotsenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simpleidn
|
@@ -30,14 +30,20 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.2'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.2.23
|
34
37
|
type: :development
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
43
|
+
version: '2.2'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.2.23
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: bundler-audit
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,34 +64,34 @@ dependencies:
|
|
58
64
|
requirements:
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
67
|
+
version: '1.3'
|
62
68
|
- - ">="
|
63
69
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.
|
70
|
+
version: 1.3.1
|
65
71
|
type: :development
|
66
72
|
prerelease: false
|
67
73
|
version_requirements: !ruby/object:Gem::Requirement
|
68
74
|
requirements:
|
69
75
|
- - "~>"
|
70
76
|
- !ruby/object:Gem::Version
|
71
|
-
version: '1.
|
77
|
+
version: '1.3'
|
72
78
|
- - ">="
|
73
79
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.
|
80
|
+
version: 1.3.1
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: faker
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
78
84
|
requirements:
|
79
85
|
- - "~>"
|
80
86
|
- !ruby/object:Gem::Version
|
81
|
-
version: '2.
|
87
|
+
version: '2.18'
|
82
88
|
type: :development
|
83
89
|
prerelease: false
|
84
90
|
version_requirements: !ruby/object:Gem::Requirement
|
85
91
|
requirements:
|
86
92
|
- - "~>"
|
87
93
|
- !ruby/object:Gem::Version
|
88
|
-
version: '2.
|
94
|
+
version: '2.18'
|
89
95
|
- !ruby/object:Gem::Dependency
|
90
96
|
name: fasterer
|
91
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,14 +126,14 @@ dependencies:
|
|
120
126
|
requirements:
|
121
127
|
- - "~>"
|
122
128
|
- !ruby/object:Gem::Version
|
123
|
-
version: 0.
|
129
|
+
version: 0.58.0
|
124
130
|
type: :development
|
125
131
|
prerelease: false
|
126
132
|
version_requirements: !ruby/object:Gem::Requirement
|
127
133
|
requirements:
|
128
134
|
- - "~>"
|
129
135
|
- !ruby/object:Gem::Version
|
130
|
-
version: 0.
|
136
|
+
version: 0.58.0
|
131
137
|
- !ruby/object:Gem::Dependency
|
132
138
|
name: pry-byebug
|
133
139
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +157,7 @@ dependencies:
|
|
151
157
|
version: '13.0'
|
152
158
|
- - ">="
|
153
159
|
- !ruby/object:Gem::Version
|
154
|
-
version: 13.0.
|
160
|
+
version: 13.0.6
|
155
161
|
type: :development
|
156
162
|
prerelease: false
|
157
163
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -161,7 +167,7 @@ dependencies:
|
|
161
167
|
version: '13.0'
|
162
168
|
- - ">="
|
163
169
|
- !ruby/object:Gem::Version
|
164
|
-
version: 13.0.
|
170
|
+
version: 13.0.6
|
165
171
|
- !ruby/object:Gem::Dependency
|
166
172
|
name: reek
|
167
173
|
requirement: !ruby/object:Gem::Requirement
|
@@ -202,14 +208,20 @@ dependencies:
|
|
202
208
|
requirements:
|
203
209
|
- - "~>"
|
204
210
|
- !ruby/object:Gem::Version
|
205
|
-
version: '1.
|
211
|
+
version: '1.18'
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: 1.18.3
|
206
215
|
type: :development
|
207
216
|
prerelease: false
|
208
217
|
version_requirements: !ruby/object:Gem::Requirement
|
209
218
|
requirements:
|
210
219
|
- - "~>"
|
211
220
|
- !ruby/object:Gem::Version
|
212
|
-
version: '1.
|
221
|
+
version: '1.18'
|
222
|
+
- - ">="
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
version: 1.18.3
|
213
225
|
- !ruby/object:Gem::Dependency
|
214
226
|
name: rubocop-performance
|
215
227
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,7 +231,7 @@ dependencies:
|
|
219
231
|
version: '1.11'
|
220
232
|
- - ">="
|
221
233
|
- !ruby/object:Gem::Version
|
222
|
-
version: 1.11.
|
234
|
+
version: 1.11.4
|
223
235
|
type: :development
|
224
236
|
prerelease: false
|
225
237
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -229,21 +241,21 @@ dependencies:
|
|
229
241
|
version: '1.11'
|
230
242
|
- - ">="
|
231
243
|
- !ruby/object:Gem::Version
|
232
|
-
version: 1.11.
|
244
|
+
version: 1.11.4
|
233
245
|
- !ruby/object:Gem::Dependency
|
234
246
|
name: rubocop-rspec
|
235
247
|
requirement: !ruby/object:Gem::Requirement
|
236
248
|
requirements:
|
237
249
|
- - "~>"
|
238
250
|
- !ruby/object:Gem::Version
|
239
|
-
version: '2.
|
251
|
+
version: '2.4'
|
240
252
|
type: :development
|
241
253
|
prerelease: false
|
242
254
|
version_requirements: !ruby/object:Gem::Requirement
|
243
255
|
requirements:
|
244
256
|
- - "~>"
|
245
257
|
- !ruby/object:Gem::Version
|
246
|
-
version: '2.
|
258
|
+
version: '2.4'
|
247
259
|
- !ruby/object:Gem::Dependency
|
248
260
|
name: simplecov
|
249
261
|
requirement: !ruby/object:Gem::Requirement
|
@@ -264,34 +276,28 @@ dependencies:
|
|
264
276
|
requirements:
|
265
277
|
- - "~>"
|
266
278
|
- !ruby/object:Gem::Version
|
267
|
-
version: '0.
|
279
|
+
version: '0.6'
|
268
280
|
type: :development
|
269
281
|
prerelease: false
|
270
282
|
version_requirements: !ruby/object:Gem::Requirement
|
271
283
|
requirements:
|
272
284
|
- - "~>"
|
273
285
|
- !ruby/object:Gem::Version
|
274
|
-
version: '0.
|
286
|
+
version: '0.6'
|
275
287
|
- !ruby/object:Gem::Dependency
|
276
288
|
name: webmock
|
277
289
|
requirement: !ruby/object:Gem::Requirement
|
278
290
|
requirements:
|
279
291
|
- - "~>"
|
280
292
|
- !ruby/object:Gem::Version
|
281
|
-
version: '3.
|
282
|
-
- - ">="
|
283
|
-
- !ruby/object:Gem::Version
|
284
|
-
version: 3.12.2
|
293
|
+
version: '3.13'
|
285
294
|
type: :development
|
286
295
|
prerelease: false
|
287
296
|
version_requirements: !ruby/object:Gem::Requirement
|
288
297
|
requirements:
|
289
298
|
- - "~>"
|
290
299
|
- !ruby/object:Gem::Version
|
291
|
-
version: '3.
|
292
|
-
- - ">="
|
293
|
-
- !ruby/object:Gem::Version
|
294
|
-
version: 3.12.2
|
300
|
+
version: '3.13'
|
295
301
|
description: Configurable framework agnostic plain Ruby email validator. Verify email
|
296
302
|
via Regex, DNS, SMTP and even more.
|
297
303
|
email:
|
@@ -381,8 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
381
387
|
- !ruby/object:Gem::Version
|
382
388
|
version: '0'
|
383
389
|
requirements: []
|
384
|
-
|
385
|
-
rubygems_version: 2.7.3
|
390
|
+
rubygems_version: 3.2.20
|
386
391
|
signing_key:
|
387
392
|
specification_version: 4
|
388
393
|
summary: truemail
|