From fb5a3da3de6ee72378242bf555854636045c456d Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Mon, 21 Sep 2020 00:39:46 +0200 Subject: [PATCH] Fixing Roundcube to send via authenticated SMTP user instead via php --- src/deb/vesta/postinst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index 0ac3a7c0f..f8452efb6 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -198,6 +198,15 @@ if [ ! -f "/usr/local/vesta/data/upgrades/limit_max_recipients" ]; then fi fi +# Fixing Roundcube to send via authenticated SMTP user instead via php +if [ ! -f "/usr/local/vesta/data/upgrades/roundcube_smtp_auth" ]; then + touch /usr/local/vesta/data/upgrades/roundcube_smtp_auth + if [ -f "/etc/roundcube/defaults.inc.php" ]; then + echo "=== Fixing Roundcube to send via authenticated SMTP user instead via php" + sed -i "s#^\$config\['smtp_user'\].*#\$config\['smtp_user'\] = '%u';#g" /etc/roundcube/defaults.inc.php + sed -i "s#^\$config\['smtp_pass'\].*#\$config\['smtp_pass'\] = '%p';#g" /etc/roundcube/defaults.inc.php + fi +fi # Run custom triggers if [ -x "/root/vesta-patch.sh" ]; then