valid_email2 7.1.0 → 7.2.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 +4 -4
- data/.github/workflows/ci.yaml +2 -7
- data/.gitignore +1 -0
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile +2 -1
- data/README.md +26 -0
- data/config/disposable_email_domains.txt +11264 -6
- data/lib/valid_email2/address.rb +3 -3
- data/lib/valid_email2/dns.rb +26 -26
- data/lib/valid_email2/email_validator.rb +1 -1
- data/lib/valid_email2/sorted_domain_list.rb +36 -0
- data/lib/valid_email2/version.rb +1 -1
- data/lib/valid_email2.rb +27 -0
- data/pull_mailchecker_emails.rb +2 -1
- data/spec/address_spec.rb +53 -157
- data/spec/benchmark_spec.rb +11 -1
- data/spec/dns_spec.rb +44 -0
- data/spec/sorted_domain_list_spec.rb +17 -0
- data/spec/valid_email2_spec.rb +43 -0
- metadata +215 -192
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab3ac120e88c1119add503d1e30e81cd1342ba6c7f47a9714565c12219fb5f75
|
|
4
|
+
data.tar.gz: 4564231489179e5a59c80a23b3ccf484e889630a4dd13190262c5022e3bd20fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 092e92a411a333b7d8b5e0d0ed447a4e90040fe7a8bf289424a1feed390be6954330d9f3b0d4fc738f8045be922f1214dbaecc8c33475e0a39bfc8de7fafdb35
|
|
7
|
+
data.tar.gz: af1e6b96bf6c5d6d8bb8aa6d8f3e1d1017ef2ebb0ca7b9129468c12a5fc22809f6a8f885daa5c59bbce36d6e871c4777c341e960a0a7af02e196ae74e860496d
|
data/.github/workflows/ci.yaml
CHANGED
|
@@ -5,13 +5,8 @@ jobs:
|
|
|
5
5
|
strategy:
|
|
6
6
|
fail-fast: false
|
|
7
7
|
matrix:
|
|
8
|
-
gemfile: [
|
|
9
|
-
ruby: [3.
|
|
10
|
-
exclude:
|
|
11
|
-
- gemfile: activemodel6
|
|
12
|
-
ruby: 3.4
|
|
13
|
-
- gemfile: activemodel8
|
|
14
|
-
ruby: 3.1
|
|
8
|
+
gemfile: [activemodel7, activemodel8]
|
|
9
|
+
ruby: [3.2, 3.3, 3.4, 4.0]
|
|
15
10
|
runs-on: ubuntu-latest
|
|
16
11
|
env:
|
|
17
12
|
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
data/.gitignore
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{".":"7.
|
|
1
|
+
{".":"7.2.0"}
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.2.0](https://github.com/micke/valid_email2/compare/v7.1.0...v7.2.0) (2026-11-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* optionally look up disposable domains without building a Set of them ([#326](https://github.com/micke/valid_email2/issues/326)) ([edb46ea](https://github.com/micke/valid_email2/commit/edb46eae949fa25ad635697570968b4bc2550a07))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* keep checking MX hosts after an unlisted host with one dot ([#330](https://github.com/micke/valid_email2/issues/330)) ([a90d66c](https://github.com/micke/valid_email2/commit/a90d66cb0adb693c08b8ba797a9725505904a4ec))
|
|
14
|
+
* make the DNS cache thread-safe with ActiveSupport::Cache::MemoryStore ([#335](https://github.com/micke/valid_email2/issues/335)) ([96ef31b](https://github.com/micke/valid_email2/commit/96ef31bc9e89737f43904f21e57399dad6a62ad1))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Performance Improvements
|
|
18
|
+
|
|
19
|
+
* check the allow list before disposable? in disposable_with_allow_list ([#331](https://github.com/micke/valid_email2/issues/331)) ([6f023d8](https://github.com/micke/valid_email2/commit/6f023d8644caaf2773fad511db439406776f3b4a))
|
|
20
|
+
|
|
3
21
|
## [7.1.0](https://github.com/micke/valid_email2/compare/v7.0.15...v7.1.0) (2026-08-23)
|
|
4
22
|
|
|
5
23
|
### Features
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -165,6 +165,32 @@ If you want to allow multibyte characters, set it explicitly.
|
|
|
165
165
|
ValidEmail2::Address.permitted_multibyte_characters_regex = /[ÆæØøÅåÄäÖöÞþÐð]/
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
### Memory usage of the disposable domains list
|
|
169
|
+
|
|
170
|
+
By default, the disposable domains are loaded into a `Set` (`ValidEmail2.disposable_emails`), which adds about 35 MB to the process for the fastest lookups.
|
|
171
|
+
To trade lookup speed for memory, look them up in the sorted list file instead: it takes about 3 MB, and a lookup takes a few microseconds.
|
|
172
|
+
|
|
173
|
+
```ruby
|
|
174
|
+
# config/initializers/valid_email2.rb
|
|
175
|
+
ValidEmail2.disposable_domains_lookup = :sorted_list
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
With this option, domains added to or removed from `ValidEmail2.disposable_emails` are ignored by the validations.
|
|
179
|
+
|
|
180
|
+
### DNS cache
|
|
181
|
+
|
|
182
|
+
MX and A lookups are cached in memory for the TTL of their DNS records, and the cache is shared by all threads.
|
|
183
|
+
It is an `ActiveSupport::Cache::MemoryStore` capped at 1 MB by default, which holds roughly a thousand domains.
|
|
184
|
+
Once it is full, the least recently used lookups are evicted, and ActiveSupport instruments a `cache_prune.active_support` event.
|
|
185
|
+
|
|
186
|
+
To change the cap, set it in bytes, e.g. in an initializer:
|
|
187
|
+
|
|
188
|
+
```ruby
|
|
189
|
+
ValidEmail2::Dns.cache_size = 8 * 1024 * 1024 # 8 MB
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
To empty the cache, e.g. between tests, call `ValidEmail2::Dns.clear_cache`.
|
|
193
|
+
|
|
168
194
|
### Test environment
|
|
169
195
|
|
|
170
196
|
If you are validating `mx` then your specs will fail without an internet connection.
|