Greylisting
How Greylisting Works Against Spam
Greylisting is an anti-spam technique in which a receiving mail server temporarily rejects email from a sender it has not seen before, then accepts it only if the sender tries again after a short wait.
The receiving server records each combination of sending server address, sender address and recipient address. The first attempt is refused with a temporary error code (see SMTP error codes explained), which tells the sending server to retry later. If the same combination tries again after the waiting period, usually a few minutes, the message is accepted and the combination is remembered, so later mail from it is not delayed.
The method is cheap to run because it does not need to read the message. Its main weakness is that some spam software does retry failed deliveries, so greylisting does not stop it.
Why Legitimate Email Arrives Late
The delay is the cost of greylisting. A normal mail server queues a refused message and retries automatically, so the sender usually sees no error. The recipient may simply receive the message minutes later than expected, which is often the only sign that a site uses greylisting.
Some senders are affected more than others. A large mail service may send from a pool of servers and use a different address on each retry. Because the wait applies to each new combination, mail from such senders can be delayed for longer. Urgent messages, such as a one-time login code that expires in ten minutes, are the most sensitive to this. For that reason many greylisting systems keep allow lists of known good senders.
Greylisting is only one layer of filtering. Other methods, which check content, reputation and authentication, are described in how spam filters work.
A Greylisting Delay in Practice
A small firm runs its own mail server with greylisting enabled. A supplier sends an invoice from a mail server the firm has never received from before. The first attempt is deferred with a temporary error. The supplier's server retries about fifteen minutes later, the invoice is accepted, and it appears in the inbox a little later than usual. Neither side sees a hard failure, and the next message from the same supplier arrives without a delay.
Frequently asked questions
Does greylisting stop all spam?
No. Greylisting blocks many spam programs that do not retry failed deliveries, but it does not stop senders that retry correctly. Mail that gets past it is still handled by content filtering, reputation checks and authentication checks.
Can senders avoid greylisting delays?
Senders cannot switch greylisting off at the recipient's end, but they can reduce delays. Sending from consistent, correctly configured mail servers, with proper authentication, gives greylisting systems fewer reasons to hold the message. Some systems also keep allow lists for well-known providers, which skip the wait entirely.