Which Hosting Account Is Sending Spam? How to Find It on cPanel and Plesk
Spam from one account on a shared server can get every site on it blacklisted. How to find the account in the mail logs, stop it, and catch the next one sooner.
By Frabs · 15 November 2026 · 3 min read
The short answer: look in the mail server's log for the account or script that is handing over the most mail, check the queue for what it is sending, then stop it at the source: change the account's passwords, remove the script and clear the queued spam. On a shared server, one compromised site can get the server's address blacklisted for every customer on it.
How Spam Starts on a Hosting Server
The usual causes are:
- A compromised mailbox password, used to send through SMTP with authentication.
- A hacked website, usually an outdated CMS or plugin, with a script that sends mail through PHP.
- A form with no protection, abused to send mail to other people.
Each one shows up differently in the logs, so it helps to know which you are looking for.
Check the Queue First
A queue that is suddenly large is often the first sign. On Exim (cPanel, DirectAdmin):
exim -bpc
exim -bp | exiqsumm | head -20On Postfix (Plesk and most others):
mailq | tail -1Find the Account on Exim
Exim records who sent each message. Count messages by the user that handed them over:
grep '<=' /var/log/exim_mainlog | grep -o 'U=[^ ]*' | sort | uniq -c | sort -rn | headFor mail sent with a password over SMTP, count by the authenticated login:
grep '<=' /var/log/exim_mainlog | grep -o 'A=[^ ]*' | sort | uniq -c | sort -rn | headFor mail sent by a website script, find which folder it came from:
grep 'cwd=' /var/log/exim_mainlog | grep -o 'cwd=[^ ]*' | sort | uniq -c | sort -rn | headA web folder with hundreds of messages is usually the script to look at.
Find the Account on Postfix
Postfix logs the user ID of mail submitted locally:
grep 'pickup' /var/log/maillog | grep -o 'uid=[0-9]*' | sort | uniq -c | sort -rn | headMatch the user ID to an account with getent passwd <uid>. For authenticated SMTP, count by login:
grep 'sasl_username' /var/log/maillog | grep -o 'sasl_username=[^ ,]*' | sort | uniq -c | sort -rn | headOn some systems the log is /var/log/mail.log instead.
Stop It Properly
- Stop the sending. Suspend the mailbox or account, or remove the script.
- Clear the spam from the queue so it does not go out after you fix the cause.
- Find how they got in. Change passwords, update the CMS and plugins, and check for other files the attacker left.
- Check the server's address with the IP blacklist check and request removal once the spam has stopped.
Limits on how much mail each account may send per hour make the next outbreak smaller. cPanel and Plesk both have them.
How Frabs Host Finds It
Frabs Host watches the server at network level and names the account behind abuse, with its domains, traffic and storage. For outgoing mail, which leaves through the mail server rather than the account's own processes, it reads the mail log to name the account that handed the spam over, so you see the account, not just "the server is sending spam".
It supports cPanel, Plesk, DirectAdmin and CyberPanel, with Exim and Postfix, and works alongside the security tools already on the server. For other kinds of outgoing abuse, such as scans and floods from one account, Frabs Host can limit that account alone while every other site carries on.
Frequently Asked Questions
How do I find which cPanel account is sending spam?
Search /var/log/exim_mainlog for messages received (<=) and count them by U= for the local user, A= for an SMTP login, or cwd= for the folder a script ran from.
How do I find the account sending spam on Plesk or Postfix?
Count pickup lines in the mail log by uid= to find locally submitted mail, and by sasl_username= for SMTP logins. Match the uid to an account with getent passwd.
Why does one account's spam affect every site on the server?
They share the server's address. When a blocklist lists that address, mail from every account on it is affected.
Which panels does Frabs Host support?
cPanel, Plesk, DirectAdmin and CyberPanel, with Exim and Postfix. Servers on other panels can use Frabs Server instead.