Dkim key size (#868)

Allow to change the keysize for the dkim key
This commit is contained in:
Marek Walczak 2018-03-02 22:17:18 +01:00 committed by Johan Smits
parent 2687469f38
commit c505177486

View file

@ -2,6 +2,9 @@
touch /tmp/vhost.tmp touch /tmp/vhost.tmp
# if no keysize is provided, 2048 is default.
keysize=${1:-2048}
# Getting domains from mail accounts # Getting domains from mail accounts
if [ -f /tmp/docker-mailserver/postfix-accounts.cf ]; then if [ -f /tmp/docker-mailserver/postfix-accounts.cf ]; then
while IFS=$'|' read login pass while IFS=$'|' read login pass
@ -39,7 +42,7 @@ grep -vE '^(\s*$|#)' /tmp/vhost | while read domainname; do
if [ ! -f "/tmp/docker-mailserver/opendkim/keys/$domainname/mail.private" ]; then if [ ! -f "/tmp/docker-mailserver/opendkim/keys/$domainname/mail.private" ]; then
echo "Creating DKIM private key /tmp/docker-mailserver/opendkim/keys/$domainname/mail.private" echo "Creating DKIM private key /tmp/docker-mailserver/opendkim/keys/$domainname/mail.private"
opendkim-genkey --subdomains --domain=$domainname --selector=mail -D /tmp/docker-mailserver/opendkim/keys/$domainname opendkim-genkey --bits=$keysize --subdomains --domain=$domainname --selector=mail -D /tmp/docker-mailserver/opendkim/keys/$domainname
fi fi
# Write to KeyTable if necessary # Write to KeyTable if necessary