File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1313user=$1
1414domain=$2
1515aliases=$3
16- mail=$3
16+ mail=$4
1717
1818# LE API
1919LE_API='https://acme-v02.api.letsencrypt.org'
8686# Rework domain and alieses for mail.
8787if [ ! -z "$mail" ]; then
8888 original_domain=$domain
89- aliases="webmail.$domain ,autodiscover.$domain "
89+ aliases="webmail.$original_domain ,autodiscover.$original_domain "
9090 domain="mail.$domain"
9191fi
9292
@@ -163,8 +163,14 @@ for auth in $authz; do
163163 check_result $? "DNS _acme-challenge record wasn't created"
164164 else
165165 if [ "$WEB_SYSTEM" = 'nginx' ] || [ ! -z "$PROXY_SYSTEM" ]; then
166- conf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf_letsencrypt"
167- sconf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf_letsencrypt"
166+ if [ -z "$mail" ]; then
167+ conf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf_letsencrypt"
168+ sconf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf_letsencrypt"
169+ else
170+ conf="$HOMEDIR/$user/conf/web/$original_domain/$PROXY_SYSTEM.conf_letsencryptmail"
171+ sconf="$HOMEDIR/$user/conf/web/$original_domain/$PROXY_SYSTEM.ssl.conf_letsencryptmail"
172+ fi
173+
168174 if [ ! -e "$conf" ]; then
169175 echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' \
170176 > $conf
Original file line number Diff line number Diff line change @@ -629,6 +629,10 @@ add_mail_ssl_config() {
629629
630630# Delete SSL support for mail domain
631631del_mail_ssl_config() {
632+
633+ # Remove old mail certificates
634+ rm -f $HOMEDIR/$user/conf/mail/$domain/ssl/*
635+
632636 # Remove dovecot configuration
633637 rm -f /etc/dovecot/conf.d/domains/mail.$domain.conf
634638
Original file line number Diff line number Diff line change @@ -498,6 +498,7 @@ rebuild_mail_domain_conf() {
498498
499499 # Remove and recreate SSL configuration
500500 if [ "$SSL" = 'yes' ]; then
501+ del_mail_ssl_config
501502 add_mail_ssl_config
502503
503504 # Update counters
Original file line number Diff line number Diff line change @@ -188,11 +188,10 @@ if [ -f /etc/dovecot/dovecot.conf ]; then
188188fi
189189
190190# Update Roundcube webmail configuration
191- if [ -f /etc/ apache2/conf.d/roundcube.conf ]; then
191+ if [ "$WEB_SYSTEM" = ' apache2' ]; then
192192 echo "(*) Updating Roundcube global subdomain configuration for apache2..."
193193 cp -f $HESTIA/install/deb/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
194194fi
195-
196195if [ ! -z "$PROXY_SYSTEM" ]; then
197196 echo "(*) Updating Roundcube global subdomain configuration for nginx..."
198197 if [ -f /etc/nginx/conf.d/webmail.inc ]; then
You can’t perform that action at this time.
0 commit comments