dmarcator 0.4.0 → 0.4.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 +10 -0
- data/README.md +0 -6
- data/lib/dmarcator/parser.rb +5 -3
- data/lib/dmarcator/query.rb +1 -1
- data/lib/dmarcator/record.rb +2 -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: 3d8d5d903f5d6ec715a2cd5042610d7f28f730981f460baceee5abbc4d6eb916
|
|
4
|
+
data.tar.gz: d6ebe47854a74d046cf47b720ce60cc0598c83d5b529ed665951d45012a504fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7ea01f6b847ccbb11bb6e4e1ead4c972a0c12e404631c462a8d4b249ca7622c7345b17bfbfd1651807fdd3ce269fdb6a0774ee9c8cb9e2d85cec6e7e55d871d
|
|
7
|
+
data.tar.gz: 702597e80f58d060b1a0c6ef334697fa008ba9e0fad70d1096c6b71933901edf68643aa7234195507a12c2011624d5402cb6bc9fb1c7bbbbcb55e7bc914128a6
|
data/ChangeLog.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
### 0.4.1 / 2026-10-28
|
|
2
|
+
|
|
3
|
+
* Accept a case-insensitive `mailto:` scheme in `rua`/`ruf` report URIs.
|
|
4
|
+
* Fix parsing of `rua`/`ruf` lists that mix valid and invalid URIs.
|
|
5
|
+
* Restrict `mailto:` address characters to a safe whitelist.
|
|
6
|
+
* Reject underscores in validated domain names.
|
|
7
|
+
* Remove the dead Alexa Top 500 scraping task and its fixture.
|
|
8
|
+
* Drop the `simplecov` development dependency.
|
|
9
|
+
* Housekeeping: remove dead rescue code, fix documentation typos, add frozen string literals, make `Uri` delegation private, and drop the deprecated `gem.test_files`.
|
|
10
|
+
|
|
1
11
|
### 0.4.0 / 2026-10-26
|
|
2
12
|
|
|
3
13
|
* Add `strict: true` parsing mode to reject unknown tags and invalid tag values.
|
data/README.md
CHANGED
|
@@ -150,12 +150,6 @@ To run the RSpec tests:
|
|
|
150
150
|
rake spec
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
To test the parser against the bundled Alexa Top 500 fixture:
|
|
154
|
-
|
|
155
|
-
```sh
|
|
156
|
-
rake spec:gauntlet
|
|
157
|
-
```
|
|
158
|
-
|
|
159
153
|
## License
|
|
160
154
|
|
|
161
155
|
This project is released under the MIT License. See the [LICENSE.txt] file for
|
data/lib/dmarcator/parser.rb
CHANGED
|
@@ -67,13 +67,13 @@ module DMARCator
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
tag_rule(:auri, 'rua') do
|
|
70
|
-
dmarc_uri >> (
|
|
70
|
+
dmarc_uri >> (uri_list_sep.present? >> uri_list_sep).repeat >> (wsp? >> str(',')).absent?
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
tag_rule(:ainterval,'ri') { digit.repeat(1, 10) >> digit.absent? }
|
|
74
74
|
|
|
75
75
|
tag_rule(:furi,'ruf') do
|
|
76
|
-
dmarc_uri >> (
|
|
76
|
+
dmarc_uri >> (uri_list_sep.present? >> uri_list_sep).repeat >> (wsp? >> str(',')).absent?
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
tag_rule(:fo,'fo') do
|
|
@@ -99,6 +99,8 @@ module DMARCator
|
|
|
99
99
|
).maybe >> str('!').absent?
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
+
rule(:uri_list_sep) { wsp? >> str(',') >> wsp? >> dmarc_uri }
|
|
103
|
+
|
|
102
104
|
rule(:mailto_uri) do
|
|
103
105
|
match['mM'] >> match['aA'] >> match['iI'] >> match['lL'] >> match['tT'] >> match['oO'] >>
|
|
104
106
|
str(':') >> mailto_address
|
|
@@ -110,7 +112,7 @@ module DMARCator
|
|
|
110
112
|
|
|
111
113
|
rule(:mailto_local) { mailto_char.repeat(1) }
|
|
112
114
|
rule(:mailto_domain) { mailto_char.repeat(1) }
|
|
113
|
-
rule(:mailto_char) { match["
|
|
115
|
+
rule(:mailto_char) { match["A-Za-z0-9._%+-"] }
|
|
114
116
|
|
|
115
117
|
rule(:digit) { match('[0-9]') }
|
|
116
118
|
rule(:wsp) { str(' ') | str("\t") }
|
data/lib/dmarcator/query.rb
CHANGED
|
@@ -62,7 +62,7 @@ module DMARCator
|
|
|
62
62
|
domain.length <= 248 &&
|
|
63
63
|
!domain.start_with?('.') &&
|
|
64
64
|
!domain.include?('..') &&
|
|
65
|
-
!domain.match?(/[^A-Za-z0-9
|
|
65
|
+
!domain.match?(/[^A-Za-z0-9.-]/) &&
|
|
66
66
|
domain.split('.').all? { |label| label.length <= 63 && !label.start_with?('-') && !label.end_with?('-') }
|
|
67
67
|
raise ArgumentError, "invalid domain: #{domain.inspect}"
|
|
68
68
|
end
|
data/lib/dmarcator/record.rb
CHANGED
|
@@ -44,7 +44,7 @@ module DMARCator
|
|
|
44
44
|
#
|
|
45
45
|
# @option attributes [:r, :s] :aspf (:r)
|
|
46
46
|
#
|
|
47
|
-
# @option attributes [Array<
|
|
47
|
+
# @option attributes [Array<String>] :fo (['0'])
|
|
48
48
|
#
|
|
49
49
|
# @option attributes [:none, :quarantine, :reject] :p
|
|
50
50
|
#
|
|
@@ -153,7 +153,7 @@ module DMARCator
|
|
|
153
153
|
#
|
|
154
154
|
# `fo` field.
|
|
155
155
|
#
|
|
156
|
-
# @return [Array<
|
|
156
|
+
# @return [Array<String>]
|
|
157
157
|
# The value of the `fo=` field, or `["0"]` if the field was omitted.
|
|
158
158
|
#
|
|
159
159
|
def fo
|
data/lib/dmarcator/version.rb
CHANGED