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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c4ed90f1362c3a69141cadeb2e7360b71a7f86c18f74f433990d0760d2bab0d
4
- data.tar.gz: 63d27b1fc2acbf70627757d7a5604c1cf471e2d2f7dc71c80e8e221f663f3a70
3
+ metadata.gz: 3d8d5d903f5d6ec715a2cd5042610d7f28f730981f460baceee5abbc4d6eb916
4
+ data.tar.gz: d6ebe47854a74d046cf47b720ce60cc0598c83d5b529ed665951d45012a504fc
5
5
  SHA512:
6
- metadata.gz: 92f2851179be4e2ee8eaaa542afa87ab6efcb2aed546161001778efda5f41579a78a552b1a30010ff625f877f94cbf08c7b7506ffbdacc06fc1d68c9753ef415
7
- data.tar.gz: 10ad6dc240c07a14705ac06c83388c0981b4476ae03c980323b0d288f69693ea552218b94615524c9c7b8692b521a316157fd0c3fed87f96726acf2dfc7ce4b8
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
@@ -67,13 +67,13 @@ module DMARCator
67
67
  end
68
68
 
69
69
  tag_rule(:auri, 'rua') do
70
- dmarc_uri >> (wsp? >> str(',') >> wsp? >> dmarc_uri).repeat
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 >> (wsp? >> str(',') >> wsp? >> dmarc_uri).repeat
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["^;,! \t@"] }
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") }
@@ -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
@@ -44,7 +44,7 @@ module DMARCator
44
44
  #
45
45
  # @option attributes [:r, :s] :aspf (:r)
46
46
  #
47
- # @option attributes [Array<'0', '1', 'd', 's'>] :fo ('0')
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<'0', '1', 'd', 's'>]
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DMARCator
4
4
  # dmarcator version
5
- VERSION = '0.4.0'
5
+ VERSION = '0.4.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmarcator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman