By Farooq Junejo • Tech Expert | Web Hosting & Email Security
Running a shared hosting server (like Plesk or cPanel)? Seeing outbound spam, blacklists, or rejected mail? You're not alone. In this post, I’ll show you how to trace, prevent, and clean up email spam issues effectively.
First, check the email queue for suspicious patterns:
/var/spool/exim/input/
mailq
or Plesk Email Queue ViewerLook for hundreds of emails being sent from a single user.
Run the following to check which scripts are sending email:
grep -Ri "X-PHP-Originating-Script" /var/log/maillog
This shows the exact PHP file used — often a hacked contact form or malware.
Use ClamAV or ImunifyAV to scan suspicious web root folders like:
Delete or quarantine infected files.
To stop abuse in shared hosting:
These DNS records help protect and authenticate emails:
Use tools like:
If blacklisted, request removal after fixing the issue.
Force all clients to use SMTP authentication. Block `PHP mail()` usage unless needed.
Email spam can hurt your server’s reputation. A secure, monitored, and well-configured mail setup keeps your clients happy and your IP clean.