dkim 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +20 -0
- data/CHANGELOG.md +10 -0
- data/README.md +0 -3
- data/lib/dkim/options.rb +6 -0
- data/lib/dkim/signed_mail.rb +1 -0
- data/lib/dkim/version.rb +1 -1
- data/test/dkim/signed_mail_test.rb +13 -0
- metadata +7 -8
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f9ac50ad199771571d27da93d35d17d404e6cf24b18642856b8d8e3574ecb7f9
|
4
|
+
data.tar.gz: 7d1248e2086cea45176e60867ac15c4de7eb39f8cd5767c04e682f406e7901eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0161d656b0d464c2dced244ce241077181700c42451178bb7e6ccc5af5d63790b993e15f0d7f4cec579830b9e52bbde1aafa80d7ee908ea3310fdaba821884e8
|
7
|
+
data.tar.gz: 9d6d1b6218d2fdf7e1a7935c72de032fe7db7f2178f257f3bfa9ebc2ae810dde46988416e6a40b711616b328b30f2762412b796b403459738f2aa534fdc811f8
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v1
|
12
|
+
- name: Set up Ruby 2.6
|
13
|
+
uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 2.6.x
|
16
|
+
- name: Build and test with Rake
|
17
|
+
run: |
|
18
|
+
gem install bundler
|
19
|
+
bundle install --jobs 4 --retry 3
|
20
|
+
bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# dkim Changelog
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
## 1.1.0 (2021-12-05)
|
6
|
+
* Add support for DKIM expiration tag
|
7
|
+
|
8
|
+
## 1.0.1 (2013-01-15)
|
9
|
+
* Fix Minitest
|
10
|
+
* Add support for identity, the "i=" tag
|
11
|
+
* Fix problem with `strip_field` in mail gem 2.7.0
|
12
|
+
|
3
13
|
## 1.0.0 (2013-01-15)
|
4
14
|
* DKIM-Signature header is now prepended rather than appended
|
5
15
|
* Headers are signed in the order they appear
|
data/README.md
CHANGED
@@ -2,8 +2,6 @@ dkim
|
|
2
2
|
====
|
3
3
|
A DKIM signing library in ruby.
|
4
4
|
|
5
|
-
[![Build Status](https://secure.travis-ci.org/jhawthorn/dkim.png?branch=master)](http://travis-ci.org/jhawthorn/dkim)
|
6
|
-
|
7
5
|
[Documentation](http://rubydoc.info/github/jhawthorn/dkim)
|
8
6
|
|
9
7
|
Installation
|
@@ -96,7 +94,6 @@ Limitations
|
|
96
94
|
* No support for the older Yahoo! DomainKeys standard ([RFC 4870](http://tools.ietf.org/html/rfc4870)) *(none planned)*
|
97
95
|
* No support for specifying DKIM identity `i=` *(planned)*
|
98
96
|
* No support for body length `l=` *(planned)*
|
99
|
-
* No support for signature expiration `x=` *(planned)*
|
100
97
|
* No support for copied header fields `z=` *(not immediately planned)*
|
101
98
|
|
102
99
|
Resources
|
data/lib/dkim/options.rb
CHANGED
@@ -21,6 +21,12 @@ module Dkim
|
|
21
21
|
# @return [Time,#to_i] A Time object or seconds since the epoch
|
22
22
|
define_option_method :time
|
23
23
|
|
24
|
+
# @attribute [rw]
|
25
|
+
# Signature expiration.
|
26
|
+
# This corresponds to the x= tag in the dkim header.
|
27
|
+
# @return [Time,#to_i] A Time object or seconds since the epoch
|
28
|
+
define_option_method :expire
|
29
|
+
|
24
30
|
# @attribute [rw]
|
25
31
|
# The signing algorithm for dkim. Valid values are 'rsa-sha1' and 'rsa-sha256' (default).
|
26
32
|
# This corresponds to the a= tag in the dkim header.
|
data/lib/dkim/signed_mail.rb
CHANGED
@@ -63,6 +63,7 @@ module Dkim
|
|
63
63
|
dkim_header['q'] = 'dns/txt'
|
64
64
|
dkim_header['s'] = selector
|
65
65
|
dkim_header['t'] = (time || Time.now).to_i
|
66
|
+
dkim_header['x'] = expire.to_i if expire
|
66
67
|
|
67
68
|
# Add body hash and blank signature
|
68
69
|
dkim_header['bh']= digest_alg.digest(canonical_body)
|
data/lib/dkim/version.rb
CHANGED
@@ -46,6 +46,19 @@ module Dkim
|
|
46
46
|
assert_equal 't+dk4yxTI2ByZxxRzkwhZhM4WzTZjGWHiWnS2t4pg7oT7fAIlMrfihJ/CIvGmYqYv4lbq4LStHqHx9TmEgxrkjLevHtuqhxkN55xJ2vA2QzTzFi2fMDZ4fFqWy4QtvlLjBAhevG+LXpmjPYec1cyeMlHlPAthq5+RNi6NHErJiM=', dkim_header['b']
|
47
47
|
end
|
48
48
|
|
49
|
+
def test_expire
|
50
|
+
options = {
|
51
|
+
:time => Time.at(1234567890),
|
52
|
+
:expire => Time.at(1234567990)
|
53
|
+
}
|
54
|
+
signed_mail = SignedMail.new(@mail, options)
|
55
|
+
dkim_header = signed_mail.dkim_header.list
|
56
|
+
|
57
|
+
assert_equal 1234567990, dkim_header['x']
|
58
|
+
assert_equal '2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=', dkim_header['bh']
|
59
|
+
assert_equal 'dn2Y5rSXQNRBy904vwpvri6xcmlrwKDmDX4XtBgyABQw9jLTulgD/G61TeyqinwgaHiatQaYt4pnpzYQGMaCCg7MepkkpZAR4IggAnHo/qB4JRx5OYBslKCCwpeb70YOPdukVopEnaCoUfkCGJ5vvu3xXG1N+ajKWqYiZ0n4z+o=', dkim_header['b']
|
60
|
+
end
|
61
|
+
|
49
62
|
def test_identity
|
50
63
|
options = {
|
51
64
|
:domain => 'example.org',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dkim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Hawthorn
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -74,8 +74,8 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".github/workflows/test.yml"
|
77
78
|
- ".gitignore"
|
78
|
-
- ".travis.yml"
|
79
79
|
- Appraisals
|
80
80
|
- CHANGELOG.md
|
81
81
|
- Gemfile
|
@@ -113,7 +113,7 @@ files:
|
|
113
113
|
homepage: https://github.com/jhawthorn/dkim
|
114
114
|
licenses: []
|
115
115
|
metadata: {}
|
116
|
-
post_install_message:
|
116
|
+
post_install_message:
|
117
117
|
rdoc_options: []
|
118
118
|
require_paths:
|
119
119
|
- lib
|
@@ -128,9 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
|
-
|
132
|
-
|
133
|
-
signing_key:
|
131
|
+
rubygems_version: 3.1.4
|
132
|
+
signing_key:
|
134
133
|
specification_version: 4
|
135
134
|
summary: DKIM library in ruby
|
136
135
|
test_files:
|