Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configurable DKIM key sizes #3030

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def parent_domains
end

def generate_dkim_key
self.dkim_private_key = OpenSSL::PKey::RSA.new(1024).to_s
self.dkim_private_key = OpenSSL::PKey::RSA.new(Postal::Config.postal.default_dkim_key_size).to_s
end

def dkim_key
Expand Down
2 changes: 2 additions & 0 deletions doc/config/yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ postal:
use_local_ns_for_domain_verification: false
# Append a Resend-Sender header to all outgoing e-mails
use_resent_sender_header: true
# The default size for new DKIM keys
default_dkim_key_size: 1024
# Path to the private key used for signing
signing_key_path: $config-file-root/signing.key
# An array of SMTP relays in the format of smtp://host:port
Expand Down
5 changes: 5 additions & 0 deletions lib/postal/config_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ module Postal
default true
end

integer :default_dkim_key_size do
description "The default size for new DKIM keys"
default 1024
end

string :signing_key_path do
description "Path to the private key used for signing"
default "$config-file-root/signing.key"
Expand Down