Bookmarks

Greylisting

An anti-spam technique: the server temporarily rejects an unfamiliar sender, and the message gets through only on a retry.

Also: greylist, graylisting, grey list

checked 9 Nov

All terms

A genuine mail server that receives a temporary error retries a few minutes later, whereas a crude bulk-mailing tool usually does not. Greylisting exploits this difference: the first message from an unfamiliar sender is rejected with a 4xx code, and the retry is accepted.

How it works

  1. A message arrives from a sender the server has not seen before.
  2. The server records details of the sender and replies with a temporary rejection (under RFC 6647, a 421 reply that closes the connection, or another 4yz reply).
  3. A legitimate MTA queues the message and tries again.
  4. The retry arrives after the minimum delay; the server accepts the message and remembers the sender.

Which details are recorded depends on the implementation: in the simplest case only the client’s IP address, in more elaborate ones the IP address, sender and recipient. Rspamd stores two hashes per message in Redis, one for the envelope and one for the content, and masks the IP address to /19 for IPv4 and /64 for IPv6.

Rspamd parameterDefaultMeaning
timeout5 minuteshow long a message is rejected after the first attempt
expire1 dayhow long the sender’s record is kept

The cost

The first message to a new correspondent arrives at least five minutes late, and if the record is tied to the IP address, a retry from a different address counts as a new message and is rejected again. By default Rspamd delays only messages whose score has already exceeded the greylist action threshold. RFC 6647 (2012) calls greylisting an established anti-spam technique, but notes that some bulk-mailing tools do retry.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • DNSBLDNS-based blocklist

    A DNS blocklist rejects an address on known bad reputation; greylisting temporarily rejects any unfamiliar one.

In depth in the references

where the topic is covered in detail