Skip to content

Commit 25e448a

Browse files
committed
hestiacp#1069 Fix issue with SSL Certificates due folders not existing
1 parent 2e05ab4 commit 25e448a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bin/v-restore-user

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,11 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
636636
if [ -e "$USER_DATA/ssl/mail.$domain.ca" ]; then
637637
cp -f $USER_DATA/ssl/mail.$domain.ca $HOMEDIR/$user/conf/mail/$domain/ssl/$domain.ca
638638
fi
639-
639+
640+
if [ ! -d /etc/dovecot/conf.d/domains ]; then
641+
mkdir /etc/dovecot/conf.d/domains
642+
fi
643+
640644
# Add domain SSL configuration to dovecot
641645
if [ -f /etc/dovecot/conf.d/domains/$domain.conf ]; then
642646
rm -f /etc/dovecot/conf.d/domains/$domain.conf
@@ -647,6 +651,10 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
647651
echo " ssl_cert = <$HOMEDIR/$user/conf/mail/$domain/ssl/$domain.pem" >> /etc/dovecot/conf.d/domains/$domain.conf
648652
echo " ssl_key = <$HOMEDIR/$user/conf/mail/$domain/ssl/$domain.key" >> /etc/dovecot/conf.d/domains/$domain.conf
649653
echo "}" >> /etc/dovecot/conf.d/domains/$domain.conf
654+
655+
if [ ! -d /usr/local/hestia/ssl/mail ]; then
656+
mkdir /usr/local/hestia/ssl/mail
657+
fi
650658

651659
# Add domain SSL configuration to exim4
652660
# Cleanup broken symlinks

0 commit comments

Comments
 (0)