Skip to content

Commit fb0d960

Browse files
author
Kristan Kenney
committed
Remove global webmail configuration
1 parent 9fc6a00 commit fb0d960

File tree

4 files changed

+21
-223
lines changed

4 files changed

+21
-223
lines changed

func/domain.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,7 @@ is_mail_new() {
584584
fi
585585
}
586586

587-
588-
589-
# Add web config
587+
# Add webmail config
590588
add_webmail_config() {
591589
mkdir -p "$HOMEDIR/$user/conf/mail/$domain"
592590
conf="$HOMEDIR/$user/conf/mail/$domain/$1.conf"

install/deb/nginx/webmail.conf

Lines changed: 0 additions & 82 deletions
This file was deleted.

install/deb/roundcube/apache.conf

Lines changed: 0 additions & 90 deletions
This file was deleted.

install/upgrade/0.9.8-29.sh

Lines changed: 20 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ if [ -f /etc/dovecot/conf.d/15-mailboxes.conf ]; then
166166
# Remove mailboxes configuration if it exists
167167
rm -f /etc/dovecot/conf.d/15-mailboxes.conf
168168
fi
169+
if [ -f /etc/dovecot/dovecot.conf ]; then
170+
# Update dovecot configuration and restart dovecot service
171+
cp -f $HESTIA/install/deb/dovecot/dovecot.conf /etc/dovecot/dovecot.conf
172+
systemctl restart dovecot
173+
sleep 0.5
174+
fi
169175

170176
# Fix exim configuration
171177
if [ -f /etc/exim4/exim4.conf.template ]; then
@@ -180,54 +186,6 @@ if [ -f /etc/exim4/exim4.conf.template ]; then
180186
fi
181187
fi
182188

183-
if [ -f /etc/dovecot/dovecot.conf ]; then
184-
# Update dovecot configuration and restart dovecot service
185-
cp -f $HESTIA/install/deb/dovecot/dovecot.conf /etc/dovecot/dovecot.conf
186-
systemctl restart dovecot
187-
sleep 0.5
188-
fi
189-
190-
# Update Roundcube webmail configuration
191-
if [ "$WEB_SYSTEM" = 'apache2' ]; then
192-
echo "(*) Updating Roundcube global subdomain configuration for apache2..."
193-
cp -f $HESTIA/install/deb/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
194-
fi
195-
if [ ! -z "$PROXY_SYSTEM" ]; then
196-
echo "(*) Updating Roundcube global subdomain configuration for nginx..."
197-
if [ -f /etc/nginx/conf.d/webmail.inc ]; then
198-
rm -f /etc/nginx/conf.d/webmail.inc
199-
fi
200-
cp -f $HESTIA/install/deb/nginx/webmail.conf /etc/nginx/conf.d/webmail.conf
201-
fi
202-
203-
# Write web server configuration
204-
sed -i 's|%webmail_alias%|'$WEBMAIL_ALIAS'|g' /etc/apache2/conf.d/roundcube.conf
205-
sed -i 's|%domain%|'$domain'|g' /etc/apache2/conf.d/roundcube.conf
206-
sed -i 's|%domain_idn%|'$domain'|g' /etc/apache2/conf.d/roundcube.conf
207-
sed -i 's|%home%|'$HOMEDIR'|g' /etc/apache2/conf.d/roundcube.conf
208-
sed -i 's|%user%|'$user'|g' /etc/apache2/conf.d/roundcube.conf
209-
sed -i 's|%group%|'$user'|g' /etc/apache2/conf.d/roundcube.conf
210-
sed -i 's|%ip%|'$ipaddr'|g' /etc/apache2/conf.d/roundcube.conf
211-
sed -i 's|%web_port%|'$WEB_PORT'|g' /etc/apache2/conf.d/roundcube.conf
212-
sed -i 's|%proxy_port%|'$PROXY_PORT'|g' /etc/apache2/conf.d/roundcube.conf
213-
sed -i 's|%web_ssl_port%|'$WEB_SSL_PORT'|g' /etc/apache2/conf.d/roundcube.conf
214-
sed -i 's|%proxy_ssl_port%|'$PROXY_SSL_PORT'|g' /etc/apache2/conf.d/roundcube.conf
215-
sed -i 's|%web_system%|'$WEB_SYSTEM'|g' /etc/apache2/conf.d/roundcube.conf
216-
217-
# Write proxy server configurationls
218-
sed -i 's|%webmail_alias%|'$WEBMAIL_ALIAS'|g' /etc/nginx/conf.d/webmail.conf
219-
sed -i 's|%domain%|'$domain'|g' /etc/nginx/conf.d/webmail.conf
220-
sed -i 's|%domain_idn%|'$domain'|g' /etc/nginx/conf.d/webmail.conf
221-
sed -i 's|%home%|'$HOMEDIR'|g' /etc/nginx/conf.d/webmail.conf
222-
sed -i 's|%user%|'$user'|g' /etc/nginx/conf.d/webmail.conf
223-
sed -i 's|%group%|'$user'|g' /etc/nginx/conf.d/webmail.conf
224-
sed -i 's|%ip%|'$ipaddr'|g' /etc/nginx/conf.d/webmail.conf
225-
sed -i 's|%web_port%|'$WEB_PORT'|g' /etc/nginx/conf.d/webmail.conf
226-
sed -i 's|%proxy_port%|'$PROXY_PORT'|g' /etc/nginx/conf.d/webmail.conf
227-
sed -i 's|%web_ssl_port%|'$WEB_SSL_PORT'|g' /etc/nginx/conf.d/webmail.conf
228-
sed -i 's|%proxy_ssl_port%|'$PROXY_SSL_PORT'|g' /etc/nginx/conf.d/webmail.conf
229-
sed -i 's|%web_system%|'$WEB_SYSTEM'|g' /etc/nginx/conf.d/webmail.conf
230-
231189
# Add IMAP system variable to configuration if dovecot is installed
232190
if [ -z "$IMAP_SYSTEM" ]; then
233191
if [ -f /usr/bin/dovecot ]; then
@@ -236,6 +194,20 @@ if [ -z "$IMAP_SYSTEM" ]; then
236194
fi
237195
fi
238196

197+
# Remove global webmail configuration files in favor of per-domain vhosts
198+
if [ -f /etc/apache2/conf.d/roundcube.conf ]; then
199+
echo "(*) Removing global webmail configuration files for Apache2..."
200+
rm -f /etc/apache2/conf.d/roundcube.conf
201+
fi
202+
if [ -f /etc/nginx/conf.d/webmail.inc ]; then
203+
echo "(*) Removing global webmail configuration files for nginx..."
204+
rm -f /etc/nginx/conf.d/webmail.inc
205+
fi
206+
if [ -f /etc/nginx/conf.d/webmail.conf ]; then
207+
echo "(*) Removing global webmail configuration files for nginx..."
208+
rm -f /etc/nginx/conf.d/webmail.conf
209+
fi
210+
239211
# Remove Webalizer and replace it with awstats as default
240212
echo "(*) Setting awstats as default web statistics backend..."
241213
apt purge webalizer -y > /dev/null 2>&1

0 commit comments

Comments
 (0)