Skip to content

Commit e7d3bf6

Browse files
authored
Merge pull request hestiacp#1085 from hestiacp/fix/1069-v-restore-user
hestiacp#1069 Fix issue with SSL Certificates due folders not existing
2 parents a00b50a + 25e448a commit e7d3bf6

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
@@ -527,7 +527,11 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
527527
if [ -e "$USER_DATA/ssl/mail.$domain.ca" ]; then
528528
cp -f $USER_DATA/ssl/mail.$domain.ca $HOMEDIR/$user/conf/mail/$domain/ssl/$domain.ca
529529
fi
530-
530+
531+
if [ ! -d /etc/dovecot/conf.d/domains ]; then
532+
mkdir /etc/dovecot/conf.d/domains
533+
fi
534+
531535
# Add domain SSL configuration to dovecot
532536
if [ -f /etc/dovecot/conf.d/domains/$domain.conf ]; then
533537
rm -f /etc/dovecot/conf.d/domains/$domain.conf
@@ -538,6 +542,10 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
538542
echo " ssl_cert = <$HOMEDIR/$user/conf/mail/$domain/ssl/$domain.pem" >> /etc/dovecot/conf.d/domains/$domain.conf
539543
echo " ssl_key = <$HOMEDIR/$user/conf/mail/$domain/ssl/$domain.key" >> /etc/dovecot/conf.d/domains/$domain.conf
540544
echo "}" >> /etc/dovecot/conf.d/domains/$domain.conf
545+
546+
if [ ! -d /usr/local/hestia/ssl/mail ]; then
547+
mkdir /usr/local/hestia/ssl/mail
548+
fi
541549

542550
# Add domain SSL configuration to exim4
543551
# Cleanup broken symlinks

0 commit comments

Comments
 (0)