SOLVED -LOCALRELAY Alert for useraccount email SPAM


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:

mkdir /usr/local/src
cd /usr/local/src
tar xfz csf.tgz
cd csf

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”



myserver – WebHost Manager 2016-08-12 08-52-29NEXT:  you need to change 2 more lines, the SMTP_BLOCK and SMTP_ALLOWLOCAL to the following values:



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 .




(2) Navigate to WHM >> Main >> Tweak Settings >> Initial default/catch-all forwarder destination.
  //Set this setting to Bounce / Fail.
Stop open relay in cpanel
An Open relay is SMTP server which is configured in such a way, which allows a third party to send/receive emails that are neither from nor for local users. For that reason, such servers are usually targets for spam senders.
issue the following command to close it
/etc/init.d/exim restart

SOLVED -LOCALRELAY Alert for useraccount email SPAM



About Author

Comments are closed.