1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-03-03 06:14:06 +00:00

Compare commits

10 الالتزامات

المؤلف SHA1 الرسالة التاريخ
Adam Cooke
47fbe6a470 chore(release): 2.0.0 2021-08-02 15:30:50 +00:00
Adam Cooke
2a11e0c0a5 fix(logging): fix spelling of graylog 2021-08-02 14:43:06 +00:00
Adam Cooke
32b42af2f9 Merge pull request #1522 from postalserver/dkim-wrapping-part-2 2021-08-01 23:14:17 +01:00
Adam Cooke
476129cc1b fix(dkim): ensure DKIM-Signature headers are appropriately wrapped
closes #339
2021-08-01 21:00:37 +00:00
Adam Cooke
4880eee1d9 docs: add SECURITY.md 2021-07-30 22:52:52 +01:00
Adam Cooke
4404b3e02c fix(docs): update port numbers to specify the actual port number the SMTP server is listening on 2021-07-30 19:57:25 +00:00
Adam Cooke
1247dae2e0 feat(ui): add footer with links to docs and discussions 2021-07-30 19:41:14 +00:00
Adam Cooke
9bcb5993fa chore: remove old scripts 2021-07-30 19:20:44 +00:00
Adam Cooke
419a4e0f46 docs: add link to installation help 2021-07-30 19:20:08 +00:00
Adam Cooke
4ba2195ae0 docs: update links to old docs 2021-07-30 19:16:41 +00:00
20 ملفات معدلة مع 115 إضافات و388 حذوفات

عرض الملف

@@ -1,9 +1,13 @@
blank_issues_enabled: false
contact_links:
- name: 🙏 Help and Support
url: https://github.com/postalhq/postal/discussions/new?category=Help-and-Support
about: Get friendly support from the community on Github Discussions.
- name: 💻 Installation help
url: https://github.com/postalhq/postal/discussions/new?category=Installation-help
about: If you have questions about running Postal on your servers, use GitHub Discussions.
- name: 🙏 Help with using Postal
url: https://github.com/postalserver/postal/discussions/new?category=Help-with-using-Postal
about: If you need help using Postal's features, use GitHub Discussions.
- name: 🦊 Feature Suggestions
url: https://github.com/postalhq/postal/discussions/new?category=Feature-Suggestions
about: Suggest a new feature that should be added to Postal.
about: Suggest a new feature that should be added to Postal.

2
.gitignore مباع
عرض الملف

@@ -28,3 +28,5 @@ public/assets
vendor/bundle
Procfile.local
VERSION

عرض الملف

@@ -2,6 +2,18 @@
This file contains all the latest changes and updates to Postal.
## 2.0.0
### Features
- **ui:** add footer with links to docs and discussions ([1247da](https://github.com/postalserver/postal/commit/1247dae2e060a695a13a30ba072ca5e6dea45202))
### Bug Fixes
- **dkim:** ensure DKIM-Signature headers are appropriately wrapped ([476129](https://github.com/postalserver/postal/commit/476129cc1ba44e9014768d5ba7193587f78cb5d5))
- **docs:** update port numbers to specify the actual port number the SMTP server is listening on ([4404b3](https://github.com/postalserver/postal/commit/4404b3e02c1722808157c3f590310ead9e28641d))
- **logging:** fix spelling of graylog ([2a11e0](https://github.com/postalserver/postal/commit/2a11e0c0a5b7c7f630af28cf4af5511d9bce6dda))
## 2.0.0-beta.1
### Features

عرض الملف

@@ -6,6 +6,6 @@
* [Documentation](https://docs.postalserver.io)
* [Installation Instructions](https://docs.postalserver.io/install/prerequisites)
* [FAQs](https://github.com/atech/postal/wiki/FAQs) & [Features](https://github.com/atech/postal/wiki/Features)
* [FAQs](https://docs.postalserver.io/welcome/faqs) & [Features](https://docs.postalserver.io/welcome/feature-list)
* [Ask for help](https://github.com/postalserver/postal/discussions)
* [Slack Channel](https://slack.k.io)

15
SECURITY.md Normal file
عرض الملف

@@ -0,0 +1,15 @@
# Security Policy
## Supported Versions
We only support updates to the 2.x versions of Postal.
| Version | Supported |
| ------- | ------------------ |
| 2.x.x | :white_check_mark: |
| < 2.0 | :x: |
## Reporting a Vulnerability
If you discover a vulnerability in Postal, please do not post an issue on GitHub. Instead you should send an
e-mail to security@postalserver.io with details. We will get back to you directly.

عرض الملف

@@ -0,0 +1,9 @@
<svg width="180px" height="204px" viewBox="0 0 180 204" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Postal---Solo-Avatar" transform="translate(0.950000, 0.940000)" fill="#999999" fill-rule="nonzero">
<polygon id="Path" points="52.89 202.12 29.89 177.1 29.89 26.8 0 26.8 18.24 118.45 0 202.12"></polygon>
<path d="M118.87,0 L34.97,0 L34.97,175.32 L94.05,175.32 L94.05,118.45 L118.84,118.45 C151.551826,118.45 178.07,91.9318257 178.07,59.22 L178.07,59.22 C178.064484,26.5237913 151.566205,0.0165601674 118.87,0 L118.87,0 Z" id="Path"></path>
<polygon id="Path" points="39.18 179.89 59.62 202.12 59.62 179.89"></polygon>
</g>
</g>
</svg>

بعد

العرض:  |  الارتفاع:  |  الحجم: 830 B

عرض الملف

@@ -0,0 +1,25 @@
.footer__links {
display:flex;
margin-left:auto;
align-items: center;
font-size:13px;
color:#999;
li {
height:24px;
}
li + li {
margin-left:18px;
}
a {
text-decoration: underline;
}
}
.footer__name {
height:16px;
background:image-url('icon.svg') no-repeat 0 0;
background-size:16px;
padding-left:22px;
font-weight:bold;
}

عرض الملف

@@ -12,3 +12,10 @@
overflow-y:scroll;
overflow-x:hidden;
}
.siteContent__footer {
border-top:1px solid #efefef;
margin-top:20px;
padding:25px;
display:flex;
}

عرض الملف

@@ -30,7 +30,7 @@
%p.pageContent__definitionCode= Postal.config.dns.smtp_server_hostname
%dt Port
%dd
%p.pageContent__definitionCode 25 or 2525
%p.pageContent__definitionCode= Postal.config.smtp_server.port
%p.pageContent__definitionText
The SMTP service supports STARTTLS if you wish to send messages securely. Be aware that security
cannot guaranteed all the way to their final destination.
@@ -57,4 +57,4 @@
.u-margin
%h2.pageContent__subTitle Sending over HTTP using our API
%p.pageContent__text
For full information about how to use our HTTP API, please #{link_to 'see the documentation', 'https://github.com/atech/postal/wiki/Using-the-API', :class => "u-link"}.
For full information about how to use our HTTP API, please #{link_to 'see the documentation', 'https://docs.postalserver.io/developer/api', :class => "u-link"}.

عرض الملف

@@ -52,6 +52,10 @@
%section.siteContent__main
= yield
%footer.siteContent__footer
%ul.footer__links
%li.footer__name
Powered by #{link_to "Postal", "https://postalserver.io", target: '_blank'} #{Postal.version}.
%li= link_to "Documentation", "https://docs.postalserver.io", target: '_blank'
%li= link_to "Ask for help", "https://discussions.postalserver.io", target: '_blank'
- if logged_in?
<!--- Postal Version #{Postal.version} -->

عرض الملف

@@ -34,7 +34,7 @@ logging:
root: # Automatically determined based on config root
max_log_file_size: 20
max_log_files: 10
greylog:
graylog:
host:
port: 12201

عرض الملف

@@ -11,7 +11,7 @@ module Postal
def add(severity, message = nil, progname = nil)
super
if severity >= @level && n = self.class.greylog_notifier
if severity >= @level && n = self.class.graylog_notifier
begin
if message.nil?
message = block_given? ? yield : progname
@@ -26,12 +26,12 @@ module Postal
true
end
def self.greylog?
!!Postal.config.logging.greylog&.host
def self.graylog?
!!Postal.config.logging.graylog&.host
end
def self.greylog_notifier
@greylog_notifier ||= greylog? ? GELF::Notifier.new(Postal.config.logging.greylog.host, Postal.config.logging.greylog.port) : nil
def self.graylog_notifier
@graylog_notifier ||= graylog? ? GELF::Notifier.new(Postal.config.logging.graylog.host, Postal.config.logging.graylog.port) : nil
end
end

عرض الملف

@@ -17,7 +17,7 @@ module Postal
end
def dkim_header
"DKIM-Signature: v=1;" + dkim_properties + signature
"DKIM-Signature: v=1; " + dkim_properties.join("\r\n\t") + signature.scan(/.{1,72}/).join("\r\n\t")
end
private
@@ -96,16 +96,18 @@ module Postal
end
def dkim_properties
String.new.tap do |header|
header << " a=rsa-sha256; c=relaxed/relaxed;"
header << " d=#{@domain_name}; s=#{@dkim_identifier}; t=#{Time.now.utc.to_i};"
header << " bh=#{body_hash}; h=#{header_names.join(':')};"
header << " b="
Array.new.tap do |header|
header << "a=rsa-sha256; c=relaxed/relaxed;"
header << "d=#{@domain_name};"
header << "s=#{@dkim_identifier}; t=#{Time.now.utc.to_i};"
header << "bh=#{body_hash};"
header << "h=#{header_names.join(':')};"
header << "b="
end
end
def dkim_header_for_signing
"dkim-signature:v=1;" + dkim_properties
"dkim-signature:v=1; #{dkim_properties.join(' ')}"
end
def signable_header_string

عرض الملف

@@ -1,11 +1,12 @@
module Postal
VERSION = '1.0.0'
REVISION = nil
CHANNEL = 'dev'
VERSION_PATH = File.expand_path('../../VERSION', __dir__)
VERSION = if File.file?(VERSION_PATH)
File.read(VERSION_PATH).strip.delete_prefix('v')
else
'0.0.0-dev'
end
def self.version
[VERSION, REVISION, CHANNEL].compact.join('-')
VERSION
end
end

عرض الملف

@@ -1,75 +0,0 @@
#!/usr/bin/env ruby
# This script will attempt to upgrade a Postal installation automatically.
#
# It can be run as any user that has access to /opt/postal and that can run
# commands as postal.
channel = 'stable'
safe_mode = false
begin
require 'optparse'
OptionParser.new do |opts|
opts.banner = "Usage: postal auto-upgrade [options]"
opts.on("-c", "--channel CHANNEL", "The channel to pull the latest version from") do |v|
channel = v
end
opts.on("--safe", "Stop postal before running the upgrade") do |v|
safe_mode = true
end
end.parse!
rescue OptionParser::InvalidOption => e
puts e.message
exit 1
end
unless ['beta', 'stable'].include?(channel)
puts "Channel must be either 'stable' or 'beta'"
exit 1
end
puts "Upgrading from the \e[32m#{channel}\e[0m channel"
def run(command, options = {})
if system(command)
# Good.
else
puts "Failed to run: #{command}"
exit 128 unless options[:exit_on_failure] == false
end
end
if safe_mode
puts "Stopping current Postal instance"
run "postal stop", :exit_on_failure => false
end
if File.exist?("/opt/postal/app/.git")
puts "Getting latest version of repository"
run "cd /opt/postal/app && git pull"
else
puts "Backing up previous application files"
run "rm -Rf /opt/postal/app.backup"
run "cp -R /opt/postal/app /opt/postal/app.backup"
puts "Downloading latest version of application"
run "wget https://postal.atech.media/packages/#{channel}/latest.tgz -O - | tar zxpv -C /opt/postal/app"
end
puts "Installing dependencies"
run "postal bundle /opt/postal/vendor/bundle"
puts "Upgrading database & assets"
run "postal upgrade"
if safe_mode
puts "Starting Postal"
run "postal start"
else
puts "Restarting Postal"
run "postal restart"
end
puts "\e[32mUpgrade complete\e[0m"

عرض الملف

@@ -1,110 +0,0 @@
#!/usr/bin/env ruby
# This script will build a tgz file containing a copy of Postal with the assets
# ready to go. It will then upload the file to a web server where it can be
# accessed for users who wish to install or upgrade their postal installations.
#
# This script will only be used by the Postal build manager so it's likely of
# little use to most people.
require 'rubygems'
require 'pathname'
require 'fileutils'
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
BUILD_ROOT = Pathname.new("/tmp/postal-build")
WC_PATH = BUILD_ROOT.join('wc')
PACKAGE_PATH = BUILD_ROOT.join('package.tgz')
CHANNEL = ARGV[0]
unless ['beta', 'stable'].include?(CHANNEL)
puts "channel must be beta or stable"
exit 1
end
def system!(c)
if system(c)
true
else
puts "Couldn't execute #{c.inspect}"
exit 1
end
end
# Prepare our build root
FileUtils.mkdir_p(BUILD_ROOT)
# Get a brand new clean copy of the repository
puts "\e[44;37mCloning clean repository\e[0m"
system!("rm -rf #{WC_PATH}")
system!("git clone #{ROOT} #{WC_PATH}")
# Install bundler dependencies so we can compile assets
puts "\e[44;37mInstalling dependencies\e[0m"
system!("cd #{WC_PATH} && bundle install --gemfile #{WC_PATH}/Gemfile --path #{BUILD_ROOT}/vendor/bundle")
# Install some configuration files
puts "\e[44;37mInstalling configuration\e[0m"
system!("cd #{WC_PATH} && ./bin/postal initialize-config")
# Get the last commit reference for the version file
last_commit = `git -C #{WC_PATH} log --pretty=oneline -n 1`.split(/\s+/, 2).first[0,10]
puts "\e[34mGot latest commit was #{last_commit}\e[0m"
# Read the version file for the version number so we it put it in the build
# package filename and update the version file to include the REVISION and
# CHANNEL for this build.
version_file = File.read("#{WC_PATH}/lib/postal/version.rb")
if version_file =~ /VERSION = '(.*)'/
version = $1.to_s
puts "\e[34mGot version as #{version}\e[0m"
else
puts "Could not determine version from version file"
exit 1
end
version_file.gsub!("REVISION = nil", "REVISION = '#{last_commit}'")
version_file.gsub!("CHANNEL = 'dev'", "CHANNEL = '#{CHANNEL}'")
File.open("#{WC_PATH}/lib/postal/version.rb", 'w') { |f| f.write(version_file) }
# Compile all the assets
unless ENV['NO_ASSETS']
puts "\e[44;37mCompiling assets\e[0m"
system!("cd #{WC_PATH} && RAILS_GROUPS=assets bundle exec rake assets:precompile")
system!("touch #{WC_PATH}/public/assets/.prebuilt")
end
# Remove files that shouldn't be distributed
puts "\e[44;37mRemoving unused files\e[0m"
system!("rm -Rf #{WC_PATH}/.git")
system!("rm -f #{WC_PATH}/config/postal.yml")
system!("rm -f #{WC_PATH}/config/*.cert")
system!("rm -f #{WC_PATH}/config/*.key")
system!("rm -f #{WC_PATH}/config/*.pem")
system!("rm -Rf #{WC_PATH}/.bundle")
system!("rm -Rf #{WC_PATH}/.gitignore")
system!("rm -Rf #{WC_PATH}/tmp")
# Build a new tgz file
puts "\e[44;37mCreating build package\e[0m"
system("tar cpzf #{PACKAGE_PATH} -C #{WC_PATH} .")
puts "\e[32mCreated build at #{PACKAGE_PATH}\e[0m"
# What's our filename? This is our filename.
filename = "postal-#{version}-#{last_commit}.tgz"
# Upload the package to the distribution server and symlink it to latest
# for the appropriate channel.
require 'net/ssh'
require 'net/scp'
Net::SSH.start("postal.atech.media") do |ssh|
ssh.exec!("rm -Rf /home/atechmedia/postal.atech.media/packages/#{CHANNEL}/#{filename}")
puts "Uploading..."
ssh.scp.upload!(PACKAGE_PATH.to_s, "/home/atechmedia/postal.atech.media/packages/#{CHANNEL}/#{filename}")
puts "Making latest..."
ssh.exec!("rm -Rf /home/atechmedia/postal.atech.media/packages/#{CHANNEL}/latest.tgz")
ssh.exec!("ln -s /home/atechmedia/postal.atech.media/packages/#{CHANNEL}/#{filename} /home/atechmedia/postal.atech.media/packages/#{CHANNEL}/latest.tgz")
end
puts "\e[32mDone. Package is live at https://postal.atech.media/packages/#{CHANNEL}/latest.tgz\e[0m"
# Yay. We're done.

عرض الملف

@@ -1,77 +0,0 @@
#!/bin/bash
# This will install everything required to run a basic Postal installation.
# This should be run on a clean Ubuntu 16.04 server.
#
# Once the installation has completed you will be able to access the Postal web
# interface on port 443. It will have a self-signed certificate.
#
# * Change the MySQL & RabbitMQ passwords
# * Create your first admin user with 'postal make-user'
# * Replace the self-signed certificate in /etc/nginx/ssl/postal.cert
# * Make appropriate changes to the configuration in /opt/postal/config/postal.yml
# * Setup your DNS [ https://github.com/atech/postal/wiki/Domains-&-DNS-Configuration ]
# * Configure the click & open tracking [ https://github.com/atech/postal/wiki/Click-&-Open-Tracking ]
# * Configure spam & virus checking [ https://github.com/atech/postal/wiki/Spam-&-Virus-Checking ]
set -e
#
# Dependencies
#
apt update
apt install -y software-properties-common
apt-add-repository ppa:brightbox/ruby-ng -y
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.coreix.net/mariadb/repo/10.1/ubuntu xenial main'
curl -sL https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | apt-key add -
add-apt-repository 'deb http://www.rabbitmq.com/debian/ testing main'
apt update
export DEBIAN_FRONTEND=noninteractive
apt install -y ruby2.3 ruby2.3-dev build-essential libssl-dev mariadb-server libmysqlclient-dev rabbitmq-server nodejs git nginx wget nano
gem install bundler procodile --no-rdoc --no-ri
#
# MySQL
#
echo 'CREATE DATABASE `postal` CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;' | mysql -u root
echo 'GRANT ALL ON `postal`.* TO `postal`@`127.0.0.1` IDENTIFIED BY "p0stalpassw0rd";' | mysql -u root
echo 'GRANT ALL PRIVILEGES ON `postal-%` . * to `postal`@`127.0.0.1` IDENTIFIED BY "p0stalpassw0rd";' | mysql -u root
#
# RabbitMQ
#
rabbitmqctl add_vhost /postal
rabbitmqctl add_user postal p0stalpassw0rd
rabbitmqctl set_permissions -p /postal postal ".*" ".*" ".*"
#
# System prep
#
useradd -r -m -d /opt/postal -s /bin/bash postal
setcap 'cap_net_bind_service=+ep' /usr/bin/ruby2.3
#
# Application Setup
#
sudo -i -u postal mkdir -p /opt/postal/app
wget https://postal.atech.media/packages/stable/latest.tgz -O - | sudo -u postal tar zxpv -C /opt/postal/app
ln -s /opt/postal/app/bin/postal /usr/bin/postal
postal bundle /opt/postal/vendor/bundle
postal initialize-config
postal initialize
postal start
#
# nginx
#
cp /opt/postal/app/resource/nginx.cfg /etc/nginx/sites-available/default
mkdir /etc/nginx/ssl/
openssl req -x509 -newkey rsa:4096 -keyout /etc/nginx/ssl/postal.key -out /etc/nginx/ssl/postal.cert -days 365 -nodes -subj "/C=GB/ST=Example/L=Example/O=Example/CN=example.com"
service nginx reload
#
# All done
#
echo
echo "Installation complete"

عرض الملف

@@ -1,78 +0,0 @@
#!/bin/bash
# This will install everything required to run a basic Postal installation.
# This should be run on a clean Ubuntu 18.04 server.
#
# Once the installation has completed you will be able to access the Postal web
# interface on port 443. It will have a self-signed certificate.
#
# * Change the MySQL & RabbitMQ passwords
# * Create your first admin user with 'postal make-user'
# * Replace the self-signed certificate in /etc/nginx/ssl/postal.cert
# * Make appropriate changes to the configuration in /opt/postal/config/postal.yml
# * Setup your DNS [ https://github.com/atech/postal/wiki/Domains-&-DNS-Configuration ]
# * Configure the click & open tracking [ https://github.com/atech/postal/wiki/Click-&-Open-Tracking ]
# * Configure spam & virus checking [ https://github.com/atech/postal/wiki/Spam-&-Virus-Checking ]
set -e
#
# Dependencies
#
apt update
apt install -y software-properties-common
apt-add-repository ppa:brightbox/ruby-ng -y
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.coreix.net/mariadb/repo/10.1/ubuntu bionic main'
curl -sL https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | apt-key add -
add-apt-repository 'deb http://www.rabbitmq.com/debian/ testing main'
apt update
export DEBIAN_FRONTEND=noninteractive
apt install -y ruby2.3 ruby2.3-dev build-essential libssl-dev mariadb-server libmysqlclient-dev rabbitmq-server nodejs git nginx wget nano
gem install bundler procodile --no-rdoc --no-ri
#
# MySQL
#
echo 'CREATE DATABASE `postal` CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;' | mysql -u root
echo 'GRANT ALL ON `postal`.* TO `postal`@`127.0.0.1` IDENTIFIED BY "p0stalpassw0rd";' | mysql -u root
echo 'GRANT ALL PRIVILEGES ON `postal-%` . * to `postal`@`127.0.0.1` IDENTIFIED BY "p0stalpassw0rd";' | mysql -u root
#
# RabbitMQ
#
rabbitmqctl add_vhost /postal
rabbitmqctl add_user postal p0stalpassw0rd
rabbitmqctl set_permissions -p /postal postal ".*" ".*" ".*"
#
# System prep
#
useradd -r -m -d /opt/postal -s /bin/bash postal
setcap 'cap_net_bind_service=+ep' /usr/bin/ruby2.3
#
# Application Setup
#
sudo -i -u postal mkdir -p /opt/postal/app
wget https://postal.atech.media/packages/stable/latest.tgz -O - | sudo -u postal tar zxpv -C /opt/postal/app
ln -s /opt/postal/app/bin/postal /usr/bin/postal
postal bundle /opt/postal/vendor/bundle
postal initialize-config
postal initialize
postal start
#
# nginx
#
cp /opt/postal/app/resource/nginx.cfg /etc/nginx/sites-available/default
mkdir /etc/nginx/ssl/
openssl req -x509 -newkey rsa:4096 -keyout /etc/nginx/ssl/postal.key -out /etc/nginx/ssl/postal.cert -days 365 -nodes -subj "/C=GB/ST=Example/L=Example/O=Example/CN=example.com"
service nginx reload
#
# All done
#
echo
echo "Installation complete"
echo "Now run \e[1mpostal make-user\e[0m to set up your user."

عرض الملف

@@ -1,15 +0,0 @@
#!/usr/bin/env ruby
require File.expand_path('../../lib/postal/config', __FILE__)
worker_quantity = Postal.config.workers&.quantity || 1
hash = {
'root' => Postal.app_root.to_s,
'user' => ENV['USER'],
'processes' => {
'worker' => {
'quantity' => worker_quantity
}
}
}.to_yaml
File.open(Postal.app_root.join('Procfile.local'), 'w') { |f| f.write(hash + "\n")}

عرض الملف

@@ -20,11 +20,12 @@ describe Postal::DKIMHeader do
allow(domain).to receive(:dkim_key).and_return(OpenSSL::PKey::RSA.new(frontmatter['private_key']))
allow(domain).to receive(:dkim_identifier).and_return(frontmatter['dkim_identifier'])
expectation = "DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; " \
"d=#{frontmatter['domain']}; s=#{frontmatter['dkim_identifier']}; t=#{mocked_time.to_i}; " \
"bh=#{frontmatter['bh']}; "\
"h=#{frontmatter['headers']}; " \
"b=#{frontmatter['b']}"
expectation = "DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r\n" \
"\td=#{frontmatter['domain']};\r\n" \
"\ts=#{frontmatter['dkim_identifier']}; t=#{mocked_time.to_i};\r\n" \
"\tbh=#{frontmatter['bh']};\r\n"\
"\th=#{frontmatter['headers']};\r\n" \
"\tb=#{frontmatter['b'].scan(/.{1,72}/).join("\r\n\t")}"
header = described_class.new(domain, email)