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