feat/enable custom dkim selector (#1811)

* let dkim generator accept selector as parameter

* test dkim-generator with selector parameter

* fix: correct name of domain argument in usage

* fix: adapt command to new syntax

* tests: use different quotes

* tests: use different quotes

* tests: remove domains that were never added

* style: change test name

* refactor: dkim setup

* style: remove trailing whitespace

* tests: remove test of removed dummy file

Co-authored-by: Frederic Werner <20406381+wernerfred@users.noreply.github.com>
This commit is contained in:
Astro 2021-02-22 06:05:35 +09:00 committed by GitHub
parent 9efa94ce6f
commit a7ecb0ea8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 33 deletions

View file

@ -1106,9 +1106,9 @@ function _setup_dkim
{
_notify 'task' 'Setting up DKIM'
mkdir -p /etc/opendkim && touch /etc/opendkim/SigningTable
mkdir -p /etc/opendkim
# Check if keys are already available
# Check if any keys are available
if [[ -e "/tmp/docker-mailserver/opendkim/KeyTable" ]]
then
cp -a /tmp/docker-mailserver/opendkim/* /etc/opendkim/
@ -1117,12 +1117,9 @@ function _setup_dkim
_notify 'inf' "Changing permissions on /etc/opendkim"
chown -R opendkim:opendkim /etc/opendkim/
chmod -R 0700 /etc/opendkim/keys/ # make sure permissions are right
chmod -R 0700 /etc/opendkim/keys/
else
_notify 'warn' "No DKIM key provided. Check the documentation to find how to get your keys."
local KEYTABLE_FILE="/etc/opendkim/KeyTable"
[[ ! -f ${KEYTABLE_FILE} ]] && touch "${KEYTABLE_FILE}"
_notify 'warn' "No DKIM key provided. Check the documentation on how to get your keys."
fi
# setup nameservers paramater from /etc/resolv.conf if not defined