Skip to content

Commit 5a9ab87

Browse files
authored
Fix issue with Global SMTP settings not updating (hestiacp#3730)
* Allow edit smtp global settings on password change + Patch XSS * Fix issue with exim config todo prepare patch for existing instals * Fix existing broken installs * Update versions depencies Roundcube / Snappymail * Fix issue with Debug panel * Fix error * Fix issue with password reset module
1 parent 34b781f commit 5a9ab87

File tree

8 files changed

+60
-29
lines changed

8 files changed

+60
-29
lines changed

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

install/deb/exim/exim4.conf.4.95.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ add_environment = <; PATH=/bin:/usr/bin
1515
keep_environment =
1616
disable_ipv6 = true
1717

18-
SRS_SECRET = readfile{/etc/exim4/srs.conf}
18+
SRS_SECRET = ${readfile{/etc/exim4/srs.conf}}
1919

2020
smtputf8_advertise_hosts =
2121
domainlist local_domains = dsearch;/etc/exim4/domains/

install/upgrade/upgrade.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ pga_v='7.14.4'
5050

5151
# Set version of RoundCube (Webmail) to update during upgrade if not already installed
5252
# Note: only applies to "non-apt installs >= 1.4.0 or manually phased out"
53-
rc_v='1.6.1'
53+
rc_v='1.6.2'
5454

5555
# Set version of SnappyMail (Webmail) to update during upgrade if not already installed
56-
sm_v='2.27.3'
56+
sm_v='2.28.3'
5757

5858
# Update the File Manager or it's configuration file
5959
# Check if Filegator requires an update based on current version and setting below

install/upgrade/versions/1.8.0.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,16 +248,18 @@ elif [ "$PROXY_SYSTEM" = "nginx" ]; then
248248
done < <(ls "$HESTIA"/data/ips/ 2> /dev/null)
249249
fi
250250

251-
exim_version=$(exim4 --version | head -1 | awk '{print $3}' | cut -f -2 -d .)
252-
# if Exim version > 4.95 or greater!
253-
if version_ge "$exim_version" "4.95"; then
254-
if ! grep -q 'SRS_SECRET' /etc/exim4/exim4.conf.template; then
255-
srs=$(generate_password)
256-
echo $srs > /etc/exim4/srs.conf
257-
chmod 640 /etc/exim4/srs.conf
258-
echo "[ * ] Update exim4.conf.template ..."
259-
patch /etc/exim4/exim4.conf.template $HESTIA/install/upgrade/patch/3661-exim-srs-support.patch
251+
if [ "$MAIL_SYSTEM" = "exim4" ]; then
252+
exim_version=$(exim4 --version | head -1 | awk '{print $3}' | cut -f -2 -d .)
253+
# if Exim version > 4.95 or greater!
254+
if version_ge "$exim_version" "4.95"; then
255+
if ! grep -q 'SRS_SECRET' /etc/exim4/exim4.conf.template; then
256+
srs=$(generate_password)
257+
echo $srs > /etc/exim4/srs.conf
258+
chmod 640 /etc/exim4/srs.conf
259+
echo "[ * ] Update exim4.conf.template ..."
260+
patch /etc/exim4/exim4.conf.template $HESTIA/install/upgrade/patch/3661-exim-srs-support.patch
261+
else
262+
sed -i "s/SRS_SECRET = readfile{\/etc\/exim4\/srs.conf}/SRS_SECRET = \${readfile{\/etc\/exim4\/srs.conf}}/g" /etc/exim4/exim4.conf.template
263+
fi
260264
fi
261-
else
262-
echo $exim_version
263265
fi

web/edit/mail/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,11 +701,11 @@
701701
quoteshellarg($v_domain) .
702702
" " .
703703
$v_smtp_relay_host .
704-
" '" .
704+
" " .
705705
$v_smtp_relay_user .
706-
"' '" .
706+
" " .
707707
$v_smtp_relay_pass .
708-
"' " .
708+
" " .
709709
$v_smtp_relay_port,
710710
$output,
711711
$return_var,

web/edit/server/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@
613613
if (
614614
$_POST["v_smtp_relay_host"] != $v_smtp_relay_host ||
615615
$_POST["v_smtp_relay_user"] != $v_smtp_relay_user ||
616-
$_POST["v_smtp_relay_port"] != $v_smtp_relay_port
616+
$_POST["v_smtp_relay_port"] != $v_smtp_relay_port ||
617+
!empty($_POST["v_smtp_relay_pass"])
617618
) {
618619
$v_smtp_relay = true;
619620
$v_smtp_relay_host = quoteshellarg($_POST["v_smtp_relay_host"]);

web/reset/index.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@
101101
$_SERVER["HTTP_HOST"],
102102
);
103103
if ($port_is_defined) {
104-
$port = preg_replace(
105-
"/(\[?[^]]*\]?):([0-9]{1,5})$/",
106-
"$2",
107-
$_SERVER["HTTP_HOST"],
108-
);
104+
$port =
105+
":" .
106+
preg_replace(
107+
"/(\[?[^]]*\]?):([0-9]{1,5})$/",
108+
"$2",
109+
$_SERVER["HTTP_HOST"],
110+
);
109111
} else {
110112
$port = "";
111113
}
@@ -121,7 +123,6 @@
121123

122124
putenv("LANGUAGE=" . $data[$user]["LANGUAGE"]);
123125
$name = empty($data[$user]["NAME"]) ? $user : $data[$user]["NAME"];
124-
125126
$mailtext = translate_email($template, [
126127
"name" => htmlentities($name),
127128
"hostname" => htmlentities($hostname . $port),

web/templates/pages/debug_panel.php

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<?php
2+
if( !defined("HESTIA_DIR_BIN") ){
3+
die("Direct access disabled");
4+
}
5+
?>
16
<div x-data="{ open: false }" class="debug-panel">
27
<button
38
type="button"
@@ -10,25 +15,48 @@ class="debug-panel-toggle"
1015
<?php
1116
echo "<h3 class=\"u-mb10\">Server Variables</h3>";
1217
foreach ($_SERVER as $key => $val) {
13-
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
18+
if(is_string($val)){
19+
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
20+
}
1421
}
1522
?>
1623
<?php
1724
echo "<h3 class=\"u-mb10 u-mt10\">Session Variables</h3>";
1825
foreach ($_SESSION as $key => $val) {
19-
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
26+
if(is_string($val)){
27+
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
28+
}else if(is_array($val)){
29+
array_walk_recursive($lang, function (&$value) {
30+
$value = htmlentities($value);
31+
});
32+
echo "<span class=\"u-text-bold\">" . $key . "= </span> " .var_dump($val). " ";
33+
}
2034
}
2135
?>
2236
<?php
2337
echo "<h3 class=\"u-mb10 u-mt10\">POST Variables</h3>";
2438
foreach ($_POST as $key => $val) {
25-
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
39+
if(is_string($val)){
40+
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
41+
}else if(is_array($val)){
42+
array_walk_recursive($lang, function (&$value) {
43+
$value = htmlentities($value);
44+
});
45+
echo "<span class=\"u-text-bold\">" . $key . "= </span> " .var_dump($val). " ";
46+
}
2647
}
2748
?>
2849
<?php
2950
echo "<h3 class=\"u-mb10 u-mt10\">GET Variables</h3>";
3051
foreach ($_GET as $key => $val) {
31-
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
52+
if(is_string($val)){
53+
echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
54+
}else if(is_array($val)){
55+
array_walk_recursive($lang, function (&$value) {
56+
$value = htmlentities($value);
57+
});
58+
echo "<span class=\"u-text-bold\">" . $key . "= </span> " .var_dump($val). " ";
59+
}
3260
}
3361
?>
3462
</div>

0 commit comments

Comments
 (0)