Add random created master at each startup to handle SOGo features

This commit is contained in:
andryyy
2016-12-21 08:25:47 +01:00
parent ed9d64bab4
commit eef81c58ae
8 changed files with 20 additions and 6 deletions

View File

@@ -13,4 +13,10 @@ chown -R vmail:vmail /var/vmail/sieve
# Do not do this every start-up, it may take a very long time. So we use a stat check here.
if [[ $(stat -c %U /var/vmail/) != "vmail" ]] ; then chown -R vmail:vmail /var/vmail ; fi
# Create random master for SOGo sieve features
RAND_USER=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
RAND_PASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1)
echo ${RAND_USER}:$(doveadm pw -s PBKDF2 -p ${RAND_PASSWD}) > /etc/dovecot/dovecot-master.passwd
echo ${RAND_USER}:${RAND_PASS} > /etc/sogo/sieve.creds
exec "$@"