The solution below will help you solve the problem of spam from your server. You normally get alert email messges suc as this –lfd on <serverurl>: LOCALRELAY Alert for <useraccount> if you have CSF Firwall installed on your server. I had this problem for months. I removed all plugins, changed theme, and infact i even reinstall the wordpress and yet the spam email kept coming.In this article i am assuming that you have CSF firewall installed on your server to get this alert. if you don’t have csf installed then start from step 1 otherwise go to step 2 if you have already installed the CSF firwall on your server
Firstly ssh into your server and install CSF firewall. Follow the usual instructions below to install CSF Firewall:
tar xfz csf.tgz
On a cPanel based server, all the default settings are what you want, with 2 exceptions:
Open the configuration file in your favorite text editor (/etc/csf.conf) and change the following lines:
TESTING = “1” change to TESTING = “0”
SMTP_BLOCK = “1”
SMTP_ALLOWLOCAL = “0”
This will block outbound emails from anyone other than the mail server software, and prevent any unauthorized access to the mail daemon from local scripts. Your web hosting clients, and web pages will still be able to send email like before .
//Set this setting to Bounce / Fail.
/scripts/fixrelayd /etc/init.d/exim restart
SOLVED -LOCALRELAY Alert for useraccount email SPAM