How to Get Removed from Spam Blacklists

How to Get Removed from Spam Blacklists

Reading time
11 min
Published
Last updated
In this post

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.

Bounced email with a 550 error because the sender IP is listed by Spamhaus

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.

The four Spamhaus lists, SBL, XBL, PBL and DBL, and what each one records

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.

Blacklist checker showing the IP listed on Spamhaus and Barracuda

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.

SPF, DKIM and DMARC records for the domain and what each one does

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.

Domain reputation climbing from bad to high after delisting

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.

Linux commands (terminal)
dig +short 25.113.0.203.zen.spamhaus.org
dig +short yourdomain.com.dbl.spamhaus.org

Reviewing 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.

Linux commands (terminal)
dig +short TXT yourdomain.com
dig +short TXT _dmarc.yourdomain.com

Searching 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.

Linux commands (terminal)
grep -rlE "mail\s*\(|PHPMailer|fsockopen|smtp" --include=*.php . | xargs ls -lt 2>/dev/null | head -20

Viewing 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.

Linux commands (terminal)
exim -bpc
mailq | tail -1

Recording 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.

PHP configuration (php.ini)
mail.add_x_header = On
mail.log = /home/username/logs/php-mail.log
Frequently asked questions

Frequently asked questions about spam blacklists

What is a spam blacklist?

It is a database of IP addresses or domains that have sent spam or host malicious content. Mail servers and browsers consult it to reject or flag messages and websites with a bad reputation.

How do I know if my IP address or domain is on a blacklist?

With tools that query many lists at once, such as MXToolbox, or with the Spamhaus reputation checker. For lists of dangerous websites, the Google Safe Browsing transparency report shows whether your domain is flagged.

Why has my domain been added to a blacklist?

Because of spam sent from your server or your infected website, a compromised email account, bulk emails sent to addresses that did not ask for them or sharing an IP address with another hosting customer who sends spam.

How long does it take to get off a blacklist?

It depends on the list. Some remove the entry automatically within hours or days if the problem stops, and others, such as Spamhaus, require a request. Google takes from hours to a few days to review a website after the request in Search Console.

Can I request removal without fixing the problem?

You can, but the entry returns shortly and some lists take longer to accept new requests. First the cause must be found and removed, such as the malware or the compromised account, and then removal requested.

Does a blacklist affect my company's email?

Yes. If the server's IP address or the domain is on lists used by email providers, your messages may be rejected or go to the recipients' spam folder, including customers and suppliers.

Are there paid services for getting off a blacklist?

There are companies that offer to manage removal, but reputable lists such as Spamhaus do not charge for removing an entry. Be wary of anyone promising immediate removal in exchange for money.

How do I avoid ending up on a blacklist again?

By configuring SPF, DKIM and DMARC, keeping the website clean and up to date, monitoring the volume of email the server sends, using a professional sending service for newsletters and sending only to people who have asked for it.

About the author

Javier Afán

WordPress developer specialised in security, WooCommerce, and hacked website recovery.

I work on WordPress from a technical angle focused on security, architecture, and the decisions that really affect a project's continuity.

Conversation

0 comments

Add context, experience or useful nuance. Let us keep the conversation clear and helpful for whoever arrives later.

Leave a comment

Your comment will be reviewed before it is published.

Email and reputation

Your emails are bouncing or ending up in spam

I can check which blacklists your domain or server appears on, locate the source of the spam, fix it and handle the removal request with each list.