truemail 1.7.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08c2fc87715dca966f6671f6b1d58d58e9d411bb01ae460ff31a34125d8f4a14'
4
- data.tar.gz: 30ef54377bce7d03294e73dafbbb9d637ed8d6e55dfbf0931768a1246837b45d
3
+ metadata.gz: 51df5b3fdb1b14899fba11d4d5cfc28f52396b85e03a653439c1f3b5616c6804
4
+ data.tar.gz: 927ec7dfd5f30a6b9339a587bac21db11c127b9a97074942d4a9d7c363d7ea87
5
5
  SHA512:
6
- metadata.gz: 9ef76732a55fb837e0f0eeb77da337a34b5b019e9f774debc777f5a4155c4a7ba6640ca245e106c90dd560814f87870513664a601986518e4f23399b1351ce56
7
- data.tar.gz: 203da733353f7377bda0527d6f330281c1d8357b6e65ba384c3f80decfcc8cdbf2cec8b6f80a31aa967e22bfa9e4afa16c77d576412848f397ba91cfb2035e8e
6
+ metadata.gz: 45d7f94b891fc7d70f488147761ff1de9389435abfda562306c75a401c2a0576cad744d1d607777c826c74a4d1b0575a13ef38745d8737f10a426d8ff80c2d50
7
+ data.tar.gz: 21ba52447572ae156611681cd5a14e279e834030e0aa9e8c143f06dda68069eb1016cbed78ad912ba773dc643d89b58bc4645b052ffb655534e31055ee911b2f
@@ -3,7 +3,7 @@ defaults: &defaults
3
3
  docker:
4
4
  - image: circleci/ruby:2.5.0-node
5
5
  environment:
6
- CC_TEST_REPORTER_ID: a98d23d6d916932ae11dbe5df36dee070173cbe376b68758901dcc289e098979
6
+ CC_TEST_REPORTER_ID: 693272a1328521f6f7c09d7ffd419b21c00410da26e98e94c687fdd38b26e2cb
7
7
 
8
8
  references:
9
9
  restore_bundle_cache: &restore_bundle_cache
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-0-78
10
+ channel: rubocop-0-91
11
11
 
12
12
  reek:
13
13
  enabled: true
@@ -3,9 +3,9 @@
3
3
  ### New Issue Checklist
4
4
 
5
5
  - [ ] I have updated truemail to the latest version
6
- - [ ] I have read the [Contribution Guidelines](https://github.com/rubygarage/truemail/blob/master/CONTRIBUTING.md)
7
- - [ ] I have read the [documentation](https://github.com/rubygarage/truemail/blob/master/README.md)
8
- - [ ] I have searched for [existing GitHub issues](https://github.com/rubygarage/truemail/issues)
6
+ - [ ] I have read the [Contribution Guidelines](https://github.com/truemail-rb/truemail/blob/master/CONTRIBUTING.md)
7
+ - [ ] I have read the [documentation](https://truemail-rb.org/truemail-gem)
8
+ - [ ] I have searched for [existing GitHub issues](https://github.com/truemail-rb/truemail/issues)
9
9
 
10
10
  ### Issue Description
11
11
  <!-- Please include what's happening, expected behavior, and any relevant code samples -->
@@ -40,7 +40,7 @@
40
40
  - [ ] My code follows the code style of this project
41
41
  - [ ] My change requires a change to the documentation
42
42
  - [ ] I have updated the documentation accordingly
43
- - [ ] I have read the [**CONTRIBUTING** document](https://github.com/rubygarage/truemail/blob/master/CONTRIBUTING.md)
43
+ - [ ] I have read the [**CONTRIBUTING** document](https://github.com/truemail-rb/truemail/blob/master/CONTRIBUTING.md)
44
44
  - [ ] I have added tests to cover my changes
45
45
  - [ ] I have run `bundle exec rspec` from the root directory to see all new and existing tests pass
46
46
  - [ ] I have run `rubocop` and `reek` to ensure the code style is valid
data/.reek.yml CHANGED
@@ -39,6 +39,8 @@ detectors:
39
39
  - Truemail::Validate::Mx#a_record
40
40
  - Truemail::Audit::Base#verifier_domain
41
41
  - Truemail::Configuration#domain_matcher
42
+ - Truemail::Configuration#logger_options
43
+ - Truemail::Log::Serializer::Base#errors
42
44
 
43
45
  ControlParameter:
44
46
  exclude:
@@ -55,6 +57,8 @@ detectors:
55
57
  - Truemail::ConfigurationHelper#create_configuration
56
58
  - Truemail::Log::Serializer::Base#smtp_debug
57
59
  - Truemail::Log::Serializer::Text#data_composer
60
+ - Truemail::Log::Serializer::ValidatorBase#smtp_debug
61
+ - Truemail::Log::Serializer::ValidatorText#data_composer
58
62
 
59
63
  NilCheck:
60
64
  exclude:
@@ -40,6 +40,81 @@ Style/EmptyCaseCondition:
40
40
  Style/RescueStandardError:
41
41
  Enabled: false
42
42
 
43
+ Style/AccessorGrouping:
44
+ Enabled: true
45
+
46
+ Style/ArrayCoercion:
47
+ Enabled: true
48
+
49
+ Style/BisectedAttrAccessor:
50
+ Enabled: true
51
+
52
+ Style/CaseLikeIf:
53
+ Enabled: true
54
+
55
+ Style/ExplicitBlockArgument:
56
+ Enabled: true
57
+
58
+ Style/ExponentialNotation:
59
+ Enabled: true
60
+
61
+ Style/GlobalStdStream:
62
+ Enabled: true
63
+
64
+ Style/HashAsLastArrayItem:
65
+ Enabled: true
66
+
67
+ Style/HashEachMethods:
68
+ Enabled: true
69
+
70
+ Style/HashLikeCase:
71
+ Enabled: true
72
+
73
+ Style/HashTransformKeys:
74
+ Enabled: true
75
+
76
+ Style/HashTransformValues:
77
+ Enabled: true
78
+
79
+ Style/OptionalBooleanParameter:
80
+ Enabled: true
81
+
82
+ Style/RedundantAssignment:
83
+ Enabled: true
84
+
85
+ Style/RedundantFetchBlock:
86
+ Enabled: true
87
+
88
+ Style/RedundantFileExtensionInRequire:
89
+ Enabled: true
90
+
91
+ Style/RedundantRegexpCharacterClass:
92
+ Enabled: true
93
+
94
+ Style/RedundantRegexpEscape:
95
+ Enabled: true
96
+
97
+ Style/SingleArgumentDig:
98
+ Enabled: true
99
+
100
+ Style/SlicingWithRange:
101
+ Enabled: true
102
+
103
+ Style/StringConcatenation:
104
+ Enabled: true
105
+
106
+ Style/CombinableLoops:
107
+ Enabled: true
108
+
109
+ Style/KeywordParametersOrder:
110
+ Enabled: true
111
+
112
+ Style/RedundantSelfAssignment:
113
+ Enabled: true
114
+
115
+ Style/SoleNestedConditional:
116
+ Enabled: true
117
+
43
118
  Layout/LineLength:
44
119
  Max: 140
45
120
 
@@ -50,15 +125,9 @@ Layout/ClassStructure:
50
125
  - include
51
126
  - prepend
52
127
  - extend
53
- associations:
54
- - has_one
55
- - has_many
56
- - belongs_to
57
- - has_and_belongs_to_many
58
128
  ExpectedOrder:
59
129
  - module_inclusion
60
130
  - constants
61
- - associations
62
131
  - public_class_methods
63
132
  - initializer
64
133
  - public_methods
@@ -68,9 +137,108 @@ Layout/ClassStructure:
68
137
  Layout/EmptyLineAfterGuardClause:
69
138
  Enabled: false
70
139
 
140
+ Layout/SpaceAroundMethodCallOperator:
141
+ Enabled: true
142
+
143
+ Layout/EmptyLinesAroundAttributeAccessor:
144
+ Enabled: true
145
+
146
+ Layout/BeginEndAlignment:
147
+ Enabled: true
148
+
71
149
  Lint/NonDeterministicRequireOrder:
72
150
  Enabled: false
73
151
 
152
+ Lint/BinaryOperatorWithIdenticalOperands:
153
+ Enabled: true
154
+
155
+ Lint/DeprecatedOpenSSLConstant:
156
+ Enabled: true
157
+
158
+ Lint/DuplicateElsifCondition:
159
+ Enabled: true
160
+
161
+ Lint/DuplicateRescueException:
162
+ Enabled: true
163
+
164
+ Lint/EmptyConditionalBody:
165
+ Enabled: true
166
+
167
+ Lint/FloatComparison:
168
+ Enabled: true
169
+
170
+ Lint/MissingSuper:
171
+ Enabled: false
172
+
173
+ Lint/MixedRegexpCaptureTypes:
174
+ Enabled: true
175
+
176
+ Lint/OutOfRangeRegexpRef:
177
+ Enabled: true
178
+
179
+ Lint/RaiseException:
180
+ Enabled: true
181
+
182
+ Lint/SelfAssignment:
183
+ Enabled: true
184
+
185
+ Lint/StructNewOverride:
186
+ Enabled: true
187
+
188
+ Lint/TopLevelReturnWithArgument:
189
+ Enabled: true
190
+
191
+ Lint/UnreachableLoop:
192
+ Enabled: true
193
+
194
+ Lint/ConstantDefinitionInBlock:
195
+ Enabled: true
196
+
197
+ Lint/DuplicateRequire:
198
+ Enabled: true
199
+
200
+ Lint/EmptyFile:
201
+ Enabled: true
202
+
203
+ Lint/IdentityComparison:
204
+ Enabled: true
205
+
206
+ Lint/TrailingCommaInAttributeDeclaration:
207
+ Enabled: true
208
+
209
+ Lint/UselessMethodDefinition:
210
+ Enabled: true
211
+
212
+ Lint/UselessTimes:
213
+ Enabled: true
214
+
215
+ Performance/AncestorsInclude:
216
+ Enabled: true
217
+
218
+ Performance/BigDecimalWithNumericArgument:
219
+ Enabled: true
220
+
221
+ Performance/RedundantSortBlock:
222
+ Enabled: true
223
+
224
+ Performance/RedundantStringChars:
225
+ Enabled: true
226
+
227
+ Performance/ReverseFirst:
228
+ Enabled: true
229
+
230
+ Performance/SortReverse:
231
+ Enabled: true
232
+
233
+ Performance/Squeeze:
234
+ Enabled: true
235
+
236
+ Performance/StringInclude:
237
+ Enabled: true
238
+
239
+ Performance/Sum:
240
+ Enabled: true
241
+
74
242
  RSpec/ExampleLength:
75
243
  Enabled: false
76
244
 
@@ -94,3 +262,6 @@ RSpec/MessageSpies:
94
262
 
95
263
  RSpec/MultipleDescribes:
96
264
  Enabled: false
265
+
266
+ RSpec/MultipleMemoizedHelpers:
267
+ Enabled: false
@@ -1,9 +1,139 @@
1
1
  # Changelog
2
+
2
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).
3
4
 
5
+ ## [2.0.0] - 2020.10.19
6
+
7
+ ### Fixed
8
+
9
+ SMTP connection errors: invalid `HELO` hostname (`localhost`), duplicate `HELO` (`verifier domain`).
10
+
11
+ ### Changed
12
+
13
+ - Updated `Truemail::Validate::Smtp::Request#run`
14
+ - Updated `Truemail::Validate::Smtp::Request#session_data`
15
+ - Updated `Truemail::Validate::Smtp::Response`
16
+
17
+ Now `helo` is a `Boolean` instead of `Net::SMTP::Response` instance. It was changed because `helo` is sending during SMTP-session initializing (`Net::SMTP.new.start`), and `helo` is always `true` if session up is okay. Also `hello` response won't logged as error if it happens. Example of `Truemail::Validate::Smtp::Response` instance from 1.9.3 version.
18
+
19
+ ```ruby
20
+ #<struct Truemail::Validate::Smtp::Response:0x00007fa74704cd10
21
+ port_opened=true,
22
+ connection=true,
23
+ helo=true, # Returns Boolean instead of Net::SMTP::Response instance
24
+ mailfrom=false,
25
+ rcptto=nil,
26
+ errors={:mailfrom=>"server response timeout"}>
27
+ ```
28
+
29
+ ## [1.9.2] - 2020.10.02
30
+
31
+ ### Added
32
+
33
+ - `Truemail::TypeError`
34
+ - error handling for invalid types as input email
35
+
36
+ ### Changed
37
+
38
+ - Updated `Truemail.validate`
39
+ - Updated `Truemail.valid?`
40
+
41
+ ## [1.9.1] - 2020.09.21
42
+
43
+ ### Changed
44
+
45
+ Migrated to updated Ruby 2.7.x syntax.
46
+
47
+ - Updated `Truemail::Configuration#logger=`
48
+
49
+ ## [1.9.0] - 2020.09.01
50
+
51
+ ### Added
52
+
53
+ - Ability to use `Truemail::Auditor` instance represented as json directly
54
+ - `Truemail::Log::Serializer::AuditorJson`
55
+
56
+ ### Changed
57
+
58
+ - `Truemail::Auditor`, `Truemail::Validator`
59
+ - serializers namespaces
60
+ - gem development dependencies
61
+ - gem documentation
62
+
63
+ ```ruby
64
+ Truemail.host_audit.as_json
65
+
66
+ =>
67
+ # Serialized Truemail::Auditor instance
68
+ {
69
+ "date": "2020-08-31 22:33:43 +0300",
70
+ "current_host_ip": "127.0.0.1",
71
+ "warnings": {
72
+ "dns": "A-record of verifier domain not refers to current host ip address", "ptr": "PTR-record does not reference to current verifier domain"
73
+ },
74
+ "configuration": {
75
+ "validation_type_by_domain": null,
76
+ "whitelist_validation": false,
77
+ "whitelisted_domains": null,
78
+ "blacklisted_domains": null,
79
+ "not_rfc_mx_lookup_flow": false,
80
+ "smtp_safe_check": false,
81
+ "email_pattern": "default gem value",
82
+ "smtp_error_body_pattern": "default gem value"
83
+ }
84
+ }
85
+ ```
86
+
87
+ ## [1.8.0] - 2020.06.21
88
+
89
+ ### Added
90
+
91
+ Separated audit features for verifier host.
92
+
93
+ - `Truemail::Audit::Ip`
94
+ - `Truemail::Audit::Dns`
95
+
96
+ ```ruby
97
+ Truemail.host_audit
98
+
99
+ => #<Truemail::Auditor:0x00005580df358828
100
+ @result=
101
+ #<struct Truemail::Auditor::Result
102
+ current_host_ip="127.0.0.1",
103
+ warnings={
104
+ :dns=>"a record of verifier domain not refers to current host ip address",
105
+ :ptr=>"ptr record does not reference to current verifier domain"
106
+ },
107
+ configuration=
108
+ #<Truemail::Configuration:0x00005615e86327a8
109
+ @blacklisted_domains=[],
110
+ @connection_attempts=2,
111
+ @connection_timeout=2,
112
+ @default_validation_type=:smtp,
113
+ @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)/,
114
+ @response_timeout=2,
115
+ @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
116
+ @not_rfc_mx_lookup_flow=false,
117
+ @smtp_safe_check=false,
118
+ @validation_type_by_domain={},
119
+ @verifier_domain="example.com",
120
+ @verifier_email="verifier@example.com",
121
+ @whitelist_validation=false,
122
+ @whitelisted_domains=[]>
123
+ ```
124
+
125
+ ### Changed
126
+
127
+ - `Truemail::Auditor`
128
+ - `Truemail::Auditor::Result`
129
+ - `Truemail::Audit::Base`
130
+ - `Truemail::Audit::Ptr`
131
+ - `Truemail::VERSION`
132
+ - gem documentation
133
+
4
134
  ## [1.7.1] - 2020.05.10
5
135
 
6
- ## Added
136
+ ### Added
7
137
 
8
138
  - Ability to show `not_rfc_mx_lookup_flow` attribute in serialized validation result
9
139
 
@@ -51,7 +181,7 @@ Truemail.validate('nonexistent_email@bestweb.com.ua').as_json
51
181
 
52
182
  ## [1.7.0] - 2020.05.09
53
183
 
54
- ## Added
184
+ ### Added
55
185
 
56
186
  - Ability to use not RFC MX lookup flow (MX and Null MX records will be checked on the DNS validation layer only)
57
187
 
@@ -91,7 +221,7 @@ end
91
221
 
92
222
  ### Added
93
223
 
94
- - Possibility to use `Truemail::Validator` instance represented as json directly
224
+ - Ability to use `Truemail::Validator` instance represented as json directly
95
225
 
96
226
  ### Changed
97
227
 
@@ -274,7 +404,7 @@ Truemail.validate('email@domain.com', with: :regex)
274
404
 
275
405
  ### Added
276
406
 
277
- - Configurable default validation type, [issue details](https://github.com/rubygarage/truemail/issues/48)
407
+ - Configurable default validation type, [issue details](https://github.com/truemail-rb/truemail/issues/48)
278
408
 
279
409
  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```
280
410
 
@@ -392,7 +522,7 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
392
522
 
393
523
  ### Added
394
524
 
395
- - SMTP error body configurable option, [issue details](https://github.com/rubygarage/truemail/issues/19)
525
+ - SMTP error body configurable option, [issue details](https://github.com/truemail-rb/truemail/issues/19)
396
526
 
397
527
  ### Changed
398
528
 
@@ -409,11 +539,11 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
409
539
 
410
540
  ### Added
411
541
 
412
- - Reverse trace, [issue details](https://github.com/rubygarage/truemail/issues/18)
542
+ - Reverse trace, [issue details](https://github.com/truemail-rb/truemail/issues/18)
413
543
 
414
544
  ### Fixed
415
545
 
416
- - Behaviour of current host address resolver, [issue details](https://github.com/rubygarage/truemail/issues/18)
546
+ - Behaviour of current host address resolver, [issue details](https://github.com/truemail-rb/truemail/issues/18)
417
547
 
418
548
  ### Changed
419
549
 
@@ -424,7 +554,7 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
424
554
 
425
555
  ### Added
426
556
 
427
- - PTR record audit, [issue details](https://github.com/rubygarage/truemail/issues/18)
557
+ - PTR record audit, [issue details](https://github.com/truemail-rb/truemail/issues/18)
428
558
 
429
559
  ### Changed
430
560
 
@@ -435,12 +565,12 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
435
565
 
436
566
  ### Added
437
567
 
438
- - 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)
568
+ - MX gem logic with [RFC 7505](https://tools.ietf.org/html/rfc7505), null MX record supporting, [issue details](https://github.com/truemail-rb/truemail/issues/27)
439
569
  - [Contributing guideline](CONTRIBUTING.md)
440
570
 
441
571
  ### Fixed
442
572
 
443
- - Multihomed MX records supporting, [issue details](https://github.com/rubygarage/truemail/issues/28)
573
+ - Multihomed MX records supporting, [issue details](https://github.com/truemail-rb/truemail/issues/28)
444
574
 
445
575
  ### Changed
446
576
 
@@ -463,11 +593,11 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
463
593
 
464
594
  ### Added
465
595
 
466
- - Checking A record presence if ```MX``` and ```CNAME``` records not exist, [issue details](https://github.com/rubygarage/truemail/issues/10)
467
- - Handling of ```CNAME``` records, [issue details](https://github.com/rubygarage/truemail/issues/11)
468
- - Checking A record if ```MX``` and ```CNAME``` records not found, [issue details](https://github.com/rubygarage/truemail/issues/12)
469
- - Supporting of multihomed MX records, conversion host names to ips, [issue details](https://github.com/rubygarage/truemail/issues/17)
470
- - Timeout configuration for DNS resolver, [issue details](https://github.com/rubygarage/truemail/issues/13)
596
+ - Checking A record presence if ```MX``` and ```CNAME``` records not exist, [issue details](https://github.com/truemail-rb/truemail/issues/10)
597
+ - Handling of ```CNAME``` records, [issue details](https://github.com/truemail-rb/truemail/issues/11)
598
+ - Checking A record if ```MX``` and ```CNAME``` records not found, [issue details](https://github.com/truemail-rb/truemail/issues/12)
599
+ - Supporting of multihomed MX records, conversion host names to ips, [issue details](https://github.com/truemail-rb/truemail/issues/17)
600
+ - Timeout configuration for DNS resolver, [issue details](https://github.com/truemail-rb/truemail/issues/13)
471
601
  - ```.valid?``` helper
472
602
 
473
603
  ### Changed
@@ -483,12 +613,12 @@ Truemail.configuration.validation_type_for = { 'somedomain.com' => :skip }
483
613
 
484
614
  ### Fixed
485
615
 
486
- - Default ```REGEX_EMAIL_PATTERN```, [issue details](https://github.com/rubygarage/truemail/issues/7)
616
+ - Default ```REGEX_EMAIL_PATTERN```, [issue details](https://github.com/truemail-rb/truemail/issues/7)
487
617
  * local part of address can't start with a dot or special symbol
488
618
  * local part of address can include ```+``` symbol
489
- - Default ```REGEX_DOMAIN_PATTERN```, [issue details](https://github.com/rubygarage/truemail/issues/8)
619
+ - Default ```REGEX_DOMAIN_PATTERN```, [issue details](https://github.com/truemail-rb/truemail/issues/8)
490
620
  * TLD size increased up to 63 characters
491
- - Case sensitive domain names, [issue details](https://github.com/rubygarage/truemail/issues/9)
621
+ - Case sensitive domain names, [issue details](https://github.com/truemail-rb/truemail/issues/9)
492
622
 
493
623
  ### Changed
494
624
 
@@ -535,10 +665,7 @@ Truemail.validate('email@example.com')
535
665
  #<struct Truemail::Validate::Smtp::Response
536
666
  port_opened=true,
537
667
  connection=false,
538
- helo=
539
- #<Net::SMTP::Response:0x0000000002c934c8
540
- @status="250",
541
- @string="250 mx1.example.com\n">,
668
+ helo=true,
542
669
  mailfrom=false,
543
670
  rcptto=nil,
544
671
  errors={:mailfrom=>"554 5.7.1 Client host blocked\n", :connection=>"server dropped connection after response"}>>,]>,