When a company’s emails start bouncing or landing in its customers’ spam folders, the most frequent cause is that its IP address or domain has been added to a blacklist. These lists are consulted by mail servers all over the world before accepting a message, and being on one of the important ones is enough for a large share of emails not to reach their destination. Getting removed from spam blacklists requires finding the reason for the listing, fixing it and requesting removal from each list following its procedure.

In this article you will see what spam blacklists are and which ones matter, why an IP address or domain ends up on them, how to check which lists you are on, what to fix before requesting removal, how to make the request with the main lists and how long it takes, and how to avoid being listed again. At the end there are the commands to query the lists and look for the source of spam on a server.
What a spam blacklist is
A spam blacklist, also called a blocklist, is a database of IP addresses or domains that have sent spam or show signs of abuse. Mail servers consult it every time they receive a message, and if the sender appears on it, they reject it, mark it as spam or deduct trust points. Most work through DNS queries, which is why they are known as DNSBLs, and the answer arrives in milliseconds.
These lists are maintained by independent organisations, security companies and the email providers themselves. Each has its own criteria for adding and removing entries, and they do not all carry the same weight. A listing on Spamhaus affects millions of mailboxes, whereas many small lists are hardly consulted by anyone.
IP address lists and domain lists
There are two main types of blacklist. IP address lists record the server emails are sent from, and affect every domain sending from that address, which is important on shared hosting where hundreds of websites share an IP address. Domain lists record domain names that appear in spam messages, either as the sender or as links within the text, and affect the domain even if the email is sent from another server.
The most important blacklists
Spamhaus is the leading organisation and maintains several lists. The SBL includes verified spam source addresses, the XBL collects infected or compromised machines, the PBL groups address ranges that should not send email directly, such as home connections, and the DBL records domains used in spam or attacks. Other lists that carry weight are Barracuda BRBL, SpamCop and UCEPROTECT, the latter with levels that block a provider’s entire ranges.
The large providers, such as Gmail, Outlook or Yahoo, also use internal reputation systems that are not public lists. There is no removal form as such, but they offer tools for senders, such as Google Postmaster Tools or Microsoft’s SNDS programme, where you can see the reputation of an IP address or domain.

Why an IP address or domain ends up on a blacklist
An IP address or domain is added to a blacklist because email with the characteristics of spam is sent from it or because it is associated with malicious activity. The most common causes come up again and again.
A compromised website or server sending spam
One of the most common causes is a hacked website. An attacker who gets into a CMS such as WordPress, Joomla or PrestaShop usually uploads PHP scripts that send thousands of spam or phishing emails from the server, using PHP’s mail function. The owner does not find out until the hosting provider warns them or legitimate emails stop arriving. A single bulk mailing script is enough for the server’s IP address to be added to several lists within a few hours.
An email account with a stolen password
Another frequent cause is an email account whose password has leaked or been guessed. The attacker connects to the mail server with that account and sends spam as if they were the legitimate user. It is hard to detect without reviewing the server logs, and it usually affects both the IP address and the domain’s reputation.
Poor sending practices and incomplete configuration
Blacklists also pick up legitimate senders with poor practices. Sending to bought or uncleaned lists, with many non-existent addresses, causes bounces and complaints that trigger the lists. Sudden high-volume sending from a new domain, missing SPF, DKIM and DMARC records or a server configured as an open relay, which accepts email from anyone for sending, are other common causes.
Neighbours on a shared IP address
On shared hosting, the server’s IP address is used by many websites at once. If one of them sends spam, the IP address is listed and it affects all of them, even if the others have done nothing. In that case the solution depends on the provider, who must locate the account responsible or assign another outgoing IP address.
How to check whether you are on a spam blacklist
The first signs of a listing are usually bounces. Returned messages include an error code and text naming the list, for example a reference to Spamhaus or Barracuda. Other signs are a sudden drop in opens on newsletter mailings or complaints from customers who find the emails in spam.
To confirm it, there are free tools that query dozens of lists at once, such as MXToolbox Blacklist Check or MultiRBL, to which you give the mail server’s IP address or the domain. Spamhaus has its own reputation checker, which shows which list the address appears on and why. To find out which IP address to check, you look at the domain’s MX records or at the headers of a sent email, where the address of the server that delivered it appears.

Knowing the reason for the listing is as important as knowing which list you are on. Spamhaus and most reputable lists explain in their record why the address was included, with references such as an infected machine, mail sent to spam traps or a domain used in phishing. That reason indicates where to look for the problem.
What to fix before requesting removal
Requesting removal without fixing the cause is pointless. The list adds the address again as soon as it detects the next mailing, and on many lists each repeat offence lengthens the waiting time or prevents automatic removal.
Locating and removing the source of the spam
If the cause is a compromised website, you have to locate the scripts that send email, remove them, close the entry point and check that no backdoors remain. The server’s mail queue shows whether messages are still going out, and the mail logs show which script or account is sending them. If the cause is a compromised email account, you have to change its password, close its sessions and review the forwarding rules the attacker may have created. Emptying the queue of pending spam stops the server from continuing to send accumulated messages after the cleanup.
The domain’s SPF, DKIM and DMARC
SPF, DKIM and DMARC records show destination servers that an email comes from a server authorised by the domain. SPF indicates which servers can send on behalf of the domain, DKIM signs each message with a key and DMARC indicates what to do with emails that fail those checks. All three are public standards, and DMARC, for example, is described in the IETF document RFC 7489. Since 2024, Gmail and Yahoo have required these records from anyone sending large volumes, and having them correctly configured helps to recover reputation after a listing.

How to request removal from a blacklist
Each list has its own removal procedure, and it is best to follow it to the letter. At Spamhaus, the reputation checker shows the address’s record and, once the problem is resolved, offers a removal form. XBL entries can usually be removed directly after fixing the infection, whereas SBL entries are reviewed by the Spamhaus team and sometimes require the request to come from the server provider. The PBL is not a penalty, but a list of ranges that should not send email directly, and if the IP address belongs to a legitimate server, its exclusion can be requested.
Barracuda has a removal request form on its website, and SpamCop removes addresses automatically after twenty-four hours if reports stop arriving. UCEPROTECT automatically removes level 1 after seven days without incidents and offers a paid express removal, which is not necessary. The old SORBS list closed in 2024, so warnings that still mention it can be ignored.
What to write in the request
The request should be short and specific. It is advisable to state the IP address or domain, explain in one or two sentences the cause found, for example a mailing script uploaded through a vulnerable plugin, describe what has been done to fix it and the measures taken to prevent it from happening again. Vague requests or ones that deny the problem are usually rejected. A clear explanation of the corrected cause speeds up removal.
How long removal takes
Timescales vary according to the list. Automatic removals from SpamCop or the Spamhaus XBL can be completed within hours, whereas manual reviews take from one to several days. After removal, reputation with Gmail or Outlook takes longer to recover, sometimes weeks, because it depends on the behaviour of subsequent mailings. In the meantime, urgent emails can be sent through an external sending service with a good reputation.
How to avoid being listed again
Avoiding a new listing depends on monitoring email sending and keeping the systems that can send it secure. It is advisable to check the blacklists periodically with a monitoring service that alerts you by email, review the domain’s reputation in Google Postmaster Tools and keep the SPF, DKIM and DMARC records with an increasingly strict policy.
On the server, it is recommended to limit how many emails per hour each account or website can send, disable PHP’s mail function on websites that do not need it and send application emails through an authenticated SMTP service instead of PHP’s mail function. Websites must be kept up to date and monitored, because an outdated website ends up sending spam as soon as someone compromises it. And for newsletter mailings, use only lists with consent and remove addresses that bounce. If the spam comes from a hacked website, an urgent WordPress repair service can remove the mailing scripts and close the entry point before removal is requested.

Commands to query blacklists and find the source of spam
These commands run in a Linux or macOS terminal, on the server itself over SSH or on your computer as indicated. Replace the example IP address and domain with your own.
Querying Spamhaus for an IP address and a domain
These commands query by DNS the combined Spamhaus ZEN list for an IP address, which is written with its four numbers reversed, and the DBL domain list. If the answer is an address beginning with 127.0.0, the IP address or domain is listed. Spamhaus blocks queries made from public resolvers, so it is best to run them from the server.
dig +short 25.113.0.203.zen.spamhaus.org
dig +short yourdomain.com.dbl.spamhaus.orgReviewing the domain’s SPF and DMARC records
These commands show the domain’s TXT records, where the SPF is, and the DMARC record. They can be run from any computer.
dig +short TXT yourdomain.com
dig +short TXT _dmarc.yourdomain.comSearching for PHP scripts that send email
This command runs on the server inside the website’s folder. It looks for PHP files with email sending functions and sorts them by modification date, because spam scripts are usually recent.
grep -rlE "mail\s*\(|PHPMailer|fsockopen|smtp" --include=*.php . | xargs ls -lt 2>/dev/null | head -20Viewing the server’s mail queue
These commands show how many messages are in the mail queue, the first on servers with Exim, which is common with cPanel, and the second on servers with Postfix. A queue with thousands of messages indicates that spam sending is still active.
exim -bpc
mailq | tail -1Recording which script sends each PHP email
This PHP configuration, for the php.ini file or the control panel’s PHP editor, makes every email sent with the mail function be recorded in a log with the script that sent it, which makes it possible to locate the source of the spam.
mail.add_x_header = On
mail.log = /home/username/logs/php-mail.log
0 comments
Add context, experience or useful nuance. Let us keep the conversation clear and helpful for whoever arrives later.