dmarcator 1.2.0 → 1.2.1
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 +7 -0
- data/README.md +15 -0
- data/lib/dmarcator/resolver/plain.rb +7 -2
- data/lib/dmarcator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c588b9e28df99c70cd55c29c83854064092e2ff74436c9be680afc2b2a77824c
|
|
4
|
+
data.tar.gz: 3e6692aa15ea2aa28fa451dc847c3cadbd0cb36cdaf237e8bcb6e591206f92d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 890fe93593dd8ae6cc2888910070d73606f2700ce3e6548b09cbfcca29f86067788894dbdd23d984a23a7662059514564f955ffdf476656d94110289603b8d4c
|
|
7
|
+
data.tar.gz: b3357457dbeb21bcd40dee7a412eacc9df9d60b148eae9b0f753c2ca6534d299f4ff6bd7585fcfcf67d4482eabc4f6227ac0878af1d839721de1e2cd7334853f
|
data/ChangeLog.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
### 1.2.1 / 2026-10-30
|
|
2
|
+
|
|
3
|
+
* Add a record-parser corpus regression net: 143 records (published real-world records plus edge cases) with their accepted outcomes in lenient and strict mode, replayed by the test suite. A parser change that alters how any record parses now fails with a diff. Regenerate with `script/generate_record_corpus.rb`.
|
|
4
|
+
* Report a TCP response body shorter than its declared length as `short DNS response (expected N bytes, got M)`, instead of the opaque `malformed DNS response: limit exceeded`.
|
|
5
|
+
|
|
6
|
+
No public API changes.
|
|
7
|
+
|
|
1
8
|
### 1.2.0 / 2026-10-30
|
|
2
9
|
|
|
3
10
|
* Plaintext lookups now use DNS over TCP (`DMARCator::Resolver::Plain`) instead of `Resolv::DNS`. `Resolv` reads UDP replies into a 512-byte buffer, so a larger answer cannot be decoded, is discarded, and the resulting timeout is swallowed. Any TXT set over 512 bytes — common for SPF and for domains with several DKIM keys — was therefore returned as an empty array, which is indistinguishable from "no records published". TCP has no such limit, and failures raise `ResolutionError`.
|
data/README.md
CHANGED
|
@@ -367,6 +367,21 @@ To run the RSpec tests:
|
|
|
367
367
|
rake spec
|
|
368
368
|
```
|
|
369
369
|
|
|
370
|
+
### Record parser corpus
|
|
371
|
+
|
|
372
|
+
`spec/support/record_corpus.txt` holds representative records — real-world
|
|
373
|
+
published records and edge cases — and `spec/support/record_corpus.json` the
|
|
374
|
+
outcomes they produced when the corpus was last accepted. The suite replays both
|
|
375
|
+
in lenient and strict mode, so a parser change that alters how any of them parses
|
|
376
|
+
fails with a diff.
|
|
377
|
+
|
|
378
|
+
If such a change is intentional, regenerate the file and review the JSON diff in
|
|
379
|
+
the commit:
|
|
380
|
+
|
|
381
|
+
```sh
|
|
382
|
+
ruby -Ilib script/generate_record_corpus.rb
|
|
383
|
+
```
|
|
384
|
+
|
|
370
385
|
## Releasing
|
|
371
386
|
|
|
372
387
|
Every published version must have an annotated tag pointing at the commit that
|
|
@@ -107,8 +107,13 @@ module DMARCator
|
|
|
107
107
|
header = socket.read(2)
|
|
108
108
|
raise ResolutionError, 'short DNS response' if header.nil? || header.bytesize < 2
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
length = header.unpack1('n')
|
|
111
|
+
body = socket.read(length)
|
|
112
|
+
|
|
113
|
+
if body.nil? || body.bytesize != length
|
|
114
|
+
raise ResolutionError,
|
|
115
|
+
"short DNS response (expected #{length} bytes, got #{body&.bytesize || 0})"
|
|
116
|
+
end
|
|
112
117
|
|
|
113
118
|
body
|
|
114
119
|
ensure
|
data/lib/dmarcator/version.rb
CHANGED