mailresolver 0.5.1 → 0.6.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/CHANGELOG.md +4 -0
- data/README.md +5 -4
- data/lib/mailresolver/resolver.rb +4 -0
- data/lib/mailresolver/testing.rb +4 -0
- data/lib/mailresolver/version.rb +1 -1
- data/mailresolver.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 694ac605361e95bb9ab69d00ea9e01ea3b06ca7d510f3bc8b4dfc776902abf4d
|
|
4
|
+
data.tar.gz: 38ba126c1aac2766dffe47b453371121896c3e0f262690d01c74a0c908266a75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b659fde78f316410de238debb7241e564fa4fc545badafb41207e8964386fad11706b662e4f68e2d93ca83b092d129ff126f206b9f1dda215d97cf04db722d6
|
|
7
|
+
data.tar.gz: 673b4bed0f68ae4243c3ddafdcf1205f4a57a7ec84f4b4adaba502acecc604fda80ce9201af5436697c461241b0c849d64f8e7d8979f710ec56b32b65141f882
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
🔍 DNS resolution for mail, in Ruby.
|
|
4
4
|
|
|
5
|
-
**mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, and
|
|
5
|
+
**mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, CNAME, and NS lookups.
|
|
6
6
|
|
|
7
7
|
For mail libraries and the apps that use them: SPF/DKIM/DMARC/MTA-STS checks that need a missing record told apart from a server that couldn't answer, apps running several mail libraries that want one shared resolver instead of one apiece, test suites that want to fake DNS without touching a network.
|
|
8
8
|
|
|
9
9
|
**mailresolver** handles:
|
|
10
10
|
|
|
11
|
-
- TXT, A, AAAA, MX, PTR, and
|
|
11
|
+
- TXT, A, AAAA, MX, PTR, CNAME, and NS lookups, plus a merged `addresses` for A+AAAA
|
|
12
12
|
- a three-way error taxonomy — `NotFound`, `ServerFailure`, `Timeout` — instead of collapsing every failure into an empty answer
|
|
13
13
|
- one shared resolver across every mail library in your app, multiplexed over dnsruby's single I/O thread
|
|
14
14
|
- configurable retry/timeout schedule
|
|
15
15
|
- DNSSEC validation and answer caching off, unconditionally, for callers that have no way to act on either
|
|
16
16
|
- test doubles — a hash-backed fake and a real loopback nameserver — so a suite never needs the network
|
|
17
17
|
|
|
18
|
-
> Not a general-purpose DNS client —
|
|
18
|
+
> Not a general-purpose DNS client — six record types and three errors, built for what mail authentication needs.
|
|
19
19
|
|
|
20
20
|
## Contents
|
|
21
21
|
|
|
@@ -57,6 +57,7 @@ resolver.addresses("example.com") # => ["203.0.113.10", "2001:db8::1"]
|
|
|
57
57
|
resolver.mx("example.com") # => ["mx1.example.com", "mx2.example.com"], sorted by preference
|
|
58
58
|
resolver.ptr("203.0.113.10") # => ["mail.example.com"]
|
|
59
59
|
resolver.cname("www.example.com") # => ["example.com"]
|
|
60
|
+
resolver.ns("example.com") # => ["ns1.example.net", "ns2.example.net"]
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
`addresses` merges A and AAAA. A family the name doesn't publish contributes nothing to it rather than ending the lookup — but a name that doesn't exist at all raises `NoSuchName`, and a nameserver that couldn't answer still raises, same as every other method here.
|
|
@@ -106,7 +107,7 @@ DNSSEC validation and dnsruby's answer cache are both off, unconditionally. DNSS
|
|
|
106
107
|
|
|
107
108
|
## Custom Resolvers
|
|
108
109
|
|
|
109
|
-
Anything that responds to `txt`, `a`, `aaaa`, `addresses`, `mx`, `ptr`, and `
|
|
110
|
+
Anything that responds to `txt`, `a`, `aaaa`, `addresses`, `mx`, `ptr`, `cname`, and `ns` — raising the three errors above — is a drop-in replacement. You don't have to write one: see [Test Doubles](#test-doubles).
|
|
110
111
|
|
|
111
112
|
## Test Doubles
|
|
112
113
|
|
|
@@ -57,6 +57,10 @@ module MailResolver
|
|
|
57
57
|
records("CNAME", name).map { |record| record.domainname.to_s }
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
def ns(name)
|
|
61
|
+
records("NS", name).map { |record| record.domainname.to_s }
|
|
62
|
+
end
|
|
63
|
+
|
|
60
64
|
private
|
|
61
65
|
def family(type, name)
|
|
62
66
|
records(type, name).map { |record| record.address.to_s.downcase }
|
data/lib/mailresolver/testing.rb
CHANGED
data/lib/mailresolver/version.rb
CHANGED
data/mailresolver.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = [ "Simon Lev" ]
|
|
9
9
|
|
|
10
10
|
spec.summary = "DNS resolution for mail, in Ruby."
|
|
11
|
-
spec.description = "DNS resolution for mail, in Ruby. **mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, and
|
|
11
|
+
spec.description = "DNS resolution for mail, in Ruby. **mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, CNAME, and NS lookups."
|
|
12
12
|
|
|
13
13
|
spec.homepage = "https://github.com/mailpiece/mailresolver"
|
|
14
14
|
spec.license = "MIT"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mailresolver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Simon Lev
|
|
@@ -24,7 +24,7 @@ dependencies:
|
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '1.74'
|
|
26
26
|
description: DNS resolution for mail, in Ruby. **mailresolver** is a small, injectable
|
|
27
|
-
DNS client for mail libraries — TXT, A/AAAA, MX, PTR, and
|
|
27
|
+
DNS client for mail libraries — TXT, A/AAAA, MX, PTR, CNAME, and NS lookups.
|
|
28
28
|
executables: []
|
|
29
29
|
extensions: []
|
|
30
30
|
extra_rdoc_files: []
|