Last active
March 11, 2016 12:46
-
-
Save dkrusky/03abc1ad71c6b7d692f3 to your computer and use it in GitHub Desktop.
Set dovecot to generate 2048 bit dhparams on a cPanel/WHM box.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# if no local config for dovecot exists, make one | |
if[ ! -e /var/cpanel/templates/dovecot2.2/main.local ]; then | |
cp /var/cpanel/templates/dovecot2.2/main.default /var/cpanel/templates/dovecot2.2/main.local | |
fi | |
# check if ssl_dh_parameters exists already. if it doesn't exist, insert it | |
if [ -z "$(grep "ssl_dh_parameters_length" /var/cpanel/templates/dovecot2.2/main.local)" ]; then | |
sed -i '/ssl = \[% ssl %\]/,/\[%- ELSE %\]/ {/\[%- ELSE %\]/i ssl_dh_parameters_length = 2048}' /var/cpanel/templates/dovecot2.2/main.local | |
fi | |
# rebuild, and restart dovecot to apply changes | |
/usr/local/cpanel/scripts/builddovecotconf | |
/scripts/restartsrv_dovecot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment