Skip to content

Commit 511dfa3

Browse files
author
Kristan Kenney
authored
Merge pull request hestiacp#287 from Lupul/bugfix-0504
Webmail bugfixes (syntax errors, php-fpm compatibility)
2 parents 740cd6e + b52bbf2 commit 511dfa3

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

bin/v-add-webmail

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ get_user_ip
4141
# Verifications #
4242
#----------------------------------------------------------#
4343

44-
check_args '3' "$#" 'USER DOMAIN [RESTART]'
44+
check_args '2' "$#" 'USER DOMAIN [RESTART]'
4545
is_format_valid 'user' 'domain'
4646
is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
4747
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'

bin/v-delete-mail-domain-ssl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
# Variable&Function #
99
#----------------------------------------------------------#
1010

11+
# Argument definition
12+
user=$1
13+
domain=$2
14+
1115
# Includes
1216
source $HESTIA/func/main.sh
1317
source $HESTIA/func/domain.sh
1418
source $HESTIA/conf/hestia.conf
1519

16-
# Argument definition
17-
user=$1
18-
domain=$2
19-
2020
# Additional argument formatting
2121
format_domain
2222
format_domain_idn

bin/v-update-web-templates

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ fi
4141
cp -rf $HESTIA/install/$type/templates/web $HESTIA/data/templates/
4242

4343
# Update Multiphp templates
44-
php_versions=$( ls -l /etc/php/ | grep ^d | wc -l )
44+
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
4545
if [ "$php_versions" -gt 1 ]; then
4646
if [ "$WEB_SYSTEM" = "nginx" ]; then
4747
for tplname in $(ls $HESTIA/data/templates/web/$WEB_SYSTEM/ | grep -v 'default'); do
4848
rm -fr $HESTIA/data/templates/web/$WEB_SYSTEM/$tplname
4949
done
5050
fi
5151
for v in $(ls /etc/php/); do
52+
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
53+
continue
54+
fi
5255
v_tpl=$(echo "$v" | sed -e 's/[.]//')
5356
cp -f $HESTIA/install/$type/multiphp/$WEB_SYSTEM/PHP-$v_tpl.* $HESTIA/data/templates/web/$WEB_SYSTEM/
5457
done

install/deb/templates/mail/nginx/web_system.stpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ server {
1919
location / {
2020
try_files $uri $uri/ /index.php?$args;
2121
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
22-
alias /var/lib/roundcube/;
2322
expires 1h;
2423
fastcgi_hide_header "Set-Cookie";
2524
}

install/deb/templates/mail/nginx/web_system.tpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ server {
1919
location / {
2020
try_files $uri $uri/ /index.php?$args;
2121
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
22-
alias /var/lib/roundcube/;
2322
expires 1h;
2423
fastcgi_hide_header "Set-Cookie";
2524
}

install/upgrade/0.10.0-190430.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,13 @@ chmod 751 $HESTIA/data/templates/web/unassigned/js
145145
chmod 751 $HESTIA/data/templates/web/unassigned/webfonts
146146

147147
# Correct other permissions
148-
chown bind:bind /var/cache/bind
149-
chmod 640 /etc/roundcube/debian-db*
150-
chown root:www-data /etc/roundcube/debian-db*
148+
if [ -d "/var/cache/bind" ]; then
149+
chown bind:bind /var/cache/bind
150+
fi
151+
if [ -d "/etc/roundcube" ]; then
152+
chmod 640 /etc/roundcube/debian-db*
153+
chown root:www-data /etc/roundcube/debian-db*
154+
fi
151155

152156
# Add unassigned hosts configuration to Nginx and Apache
153157
if [ "$WEB_SYSTEM" = "apache2" ]; then
@@ -174,9 +178,12 @@ if [ "$PROXY_SYSTEM" = "nginx" ]; then
174178
fi
175179

176180
# Fix empty pool error message for MultiPHP
177-
php_versions=$( ls -l /etc/php/ | grep ^d | wc -l )
181+
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
178182
if [ "$php_versions" -gt 1 ]; then
179183
for v in $(ls /etc/php/); do
184+
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
185+
continue
186+
fi
180187
cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
181188
v1=$(echo "$v" | sed -e 's/[.]//')
182189
sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf

web/edit/mail/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,23 @@
154154

155155
// Add antivirs
156156
if (($v_antivirus == 'no') && (!empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) {
157-
exec (HESTIA_CMD."v-add-mail-domain-antivirus ".$v_username." ".$escapeshellarg($v_domain), $output, $return_var);
157+
exec (HESTIA_CMD."v-add-mail-domain-antivirus ".$v_username." ".escapeshellarg($v_domain), $output, $return_var);
158158
check_return_code($return_var,$output);
159159
$v_antivirus = 'yes';
160160
unset($output);
161161
}
162162

163163
// Delete DKIM
164164
if (($v_dkim == 'yes') && (empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
165-
exec (HESTIA_CMD."v-delete-mail-domain-dkim ".$v_username." ".$escapeshellarg($v_domain), $output, $return_var);
165+
exec (HESTIA_CMD."v-delete-mail-domain-dkim ".$v_username." ".escapeshellarg($v_domain), $output, $return_var);
166166
check_return_code($return_var,$output);
167167
$v_dkim = 'no';
168168
unset($output);
169169
}
170170

171171
// Add DKIM
172172
if (($v_dkim == 'no') && (!empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
173-
exec (HESTIA_CMD."v-add-mail-domain-dkim ".$v_username." ".$escapeshellarg($v_domain), $output, $return_var);
173+
exec (HESTIA_CMD."v-add-mail-domain-dkim ".$v_username." ".escapeshellarg($v_domain), $output, $return_var);
174174
check_return_code($return_var,$output);
175175
$v_dkim = 'yes';
176176
unset($output);

0 commit comments

Comments
 (0)