First enable logging
i.e. simple edit your php.ini
/root/remove_mailers.sh script (add it to cron)
i.e. simple edit your php.ini
mail.add_x_header = On mail.log = /var/log/phpmail.log
/root/remove_mailers.sh script (add it to cron)
#!/bin/bash date=$(date) logfile="${0%%.*}.log" logfile="/var/log/${logfile##*/}" echo $date >> $logfile for i in $(grep "eval()'d code" /var/log/phpmail.log | grep -oP '(?<=\[).*?(?=\()'| sort | uniq) do #echo "Spam script found: $i" #echo "removing..." echo $i >> $logfile rm -f $i done :> /var/log/phpmail.logggg