Skip to content

Commit 8202dd4

Browse files
author
Kristan Kenney
committed
Add mail SSL variables to user configuration
1 parent a417434 commit 8202dd4

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

bin/v-add-user

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ U_DNS_RECORDS='0'
179179
U_MAIL_DOMAINS='0'
180180
U_MAIL_DKIM='0'
181181
U_MAIL_ACCOUNTS='0'
182+
U_MAIL_SSL='0'
182183
U_DATABASES='0'
183184
U_CRON_JOBS='0'
184185
U_BACKUPS='0'

install/upgrade/0.9.8-29.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,29 @@ if [ -f /etc/dovecot/dovecot.conf ]; then
160160
sleep 0.5
161161
fi
162162

163+
# Update user information for mail domain SSL configuration
164+
userlist=$(ls --sort=time $HESTIA/data/users/)
165+
for user in $userlist; do
166+
USER_DATA="$HESTIA/data/users/$user"
167+
# Update user counter if SSL variable doesn't exist
168+
if [ -z "$(grep "U_MAIL_SSL" $USER_DATA/user.conf)" ]; then
169+
echo "(*) Adding missing variable for per-domain mail SSL..."
170+
echo "U_MAIL_SSL='0'" >> $USER_DATA/user.conf
171+
fi
172+
173+
# Update mail configuration file
174+
conf="$USER_DATA/mail.conf"
175+
while read line ; do
176+
eval $line
177+
178+
add_object_key "mail" 'DOMAIN' "$DOMAIN" 'SSL' 'SUSPENDED'
179+
update_object_value 'mail' 'DOMAIN' "$DOMAIN" '$SSL' 'no'
180+
181+
add_object_key "mail" 'DOMAIN' "$DOMAIN" 'LETSENCRYPT' 'SUSPENDED'
182+
update_object_value 'mail' 'DOMAIN' "$DOMAIN" '$LETSENCRYPT' 'no'
183+
done < $conf
184+
done
185+
163186
# Add IMAP system variable to configuration if dovecot is installed
164187
if [ -z "$IMAP_SYSTEM" ]; then
165188
if [ -f /usr/bin/dovecot ]; then
@@ -174,6 +197,7 @@ for user in `ls /usr/local/hestia/data/users/`; do
174197
v-rebuild-mail-domains $user
175198
done
176199

200+
177201
# Remove Webalizer and replace it with awstats as default
178202
echo "(*) Setting awstats as default web statistics backend..."
179203
apt purge webalizer -y > /dev/null 2>&1

0 commit comments

Comments
 (0)