Plesk sendmail_path für jeden Vhost
Jeder dessen Plesk Server schon mal als Spam Source missbraucht wurde, wird eine wichtige Funktion in Plesk missen: Ein separaten sendmail_path für jeden Vhost, um den User oder das Script dass für den Spam verantwortlich ist, auf einen Blick mittels “qmail-qread” zu finden.
Der Grund liegt darin dass es dem User bzw. dem PHP Script dann nurnoch sehr schwer möglich ist den Return-Path der E-Mail zu ändern, der bei Plesk Standardmäßig anonymous@servername.tld lautet.
Auf einem Debian sarge Plesk Server sorgt nachfolgendes Script dafür, dass jeder Vhost seinen individuelle Return-Path erhält.
Mit einem Aufruf von Pleks websrvmgr sorgt man anschließend dafür, dass die Änderungen aktiv genommen werden.
#!/bin/bash VHOST_PATH="/var/www/vhosts" HTTPD_ROOT="httpdocs" CONF_DIR="conf" for i in $(find $VHOST_PATH -maxdepth 1 -type d -name \*.\*); do if [ -f $i/$CONF_DIR/httpd.include ]; then DOUBLE1=$(grep "sendmail_path" $i/$CONF_DIR/httpd.include) else DOUBLE1="" fi if [ -f $i/$CONF_DIR/vhost.conf ]; then DOUBLE2=$(grep "sendmail_path" $i/$CONF_DIR/vhost.conf) else DOUBLE2="" fi if [ "$DOUBLE1" == "" ]; then if [ "$DOUBLE2" == "" ]; then echo "<directory>" >> $i/$CONF_DIR/vhost.conf echo 'php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f'$RANDOM'"' >> $i/$CONF_DIR/vhost.conf echo "</directory>" >> $i/$CONF_DIR/vhost.conf echo "$i/$CONF_DIR/vhost.conf edited" else echo "$i/$CONF_DIR/vhost.conf is already configured with a sendmail_path" fi else echo "$i/$CONF_DIR/httpd.include is already configured with a sendmail_path" fi done exit 0