Skip to content

Commit 8ecd4c8

Browse files
committed
set webmail system on upgrade
1 parent e999769 commit 8ecd4c8

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

bin/v-rebuild-mail-domain

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ rebuild_mail_domain_conf
6868
if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
6969
if [ ! -z "$IMAP_SYSTEM" ]; then
7070
WEBMAIL=$(get_object_value 'web' 'DOMAIN' "$domain" "$WEBMAIL")
71-
if [ -z "$WEBMAIL" ]; then WEBMAIL='roundcube'; fi
72-
$BIN/v-delete-mail-domain-webmail $user $domain '' $restart 'yes'
73-
$BIN/v-add-mail-domain-webmail $user $domain $WEBMAIL '' $restart 'yes'
71+
if [ ! -z "$WEBMAIL" ]; then
72+
$BIN/v-delete-mail-domain-webmail $user $domain '' $restart 'yes'
73+
$BIN/v-add-mail-domain-webmail $user $domain $WEBMAIL '' $restart 'yes'
74+
fi
7475
fi
7576
fi
7677

install/upgrade/versions/1.4.0.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ if [ "$MAIL_SYSTEM" == "exim4" ]; then
110110
fi
111111
fi
112112

113+
# Set default webmail system for mail domains
114+
if [ ! -z "$WEBMAIL_SYSTEM" ]; then
115+
for user in $($BIN/v-list-users plain | cut -f1); do
116+
for domain in $($BIN/v-list-mail-domains $user plain | cut -f1); do
117+
$BIN/v-add-mail-domain-webmail $user $domain
118+
done
119+
done
120+
fi
121+
113122
# Fix PostgreSQL repo
114123
if [ -f /etc/apt/sources.list.d/postgresql.list ]; then
115124
echo "[ * ] Updating PostgreSQL repository..."

0 commit comments

Comments
 (0)