Greylisting Documentation
The greylisting mechanism is controlled by options set in the spasm configuration file: Greylist, GreylistDelay,
GreylistExpire, GreylistUpdate, and GreylistExpireInterval.
Setting the Greylist option (path to the greylist database) turns greylisting on. When a server connects, spasm
first searches the greylist database for a matching IP address.
- If no entry is found, an entry is created with an expire time set to the current time plus GreylistExpire,
and a delay time set to the current time plus GreylistDelay. The connection is then rejected with a
temporary failure.
- If an entry is found, it checks for a delay time.
- If a delay time exists, check the expire time.
- If the expire time has passed, the database entry is updated with a new delay time and expire
time, and the connection is then rejected with a temporary failure.
- If the expire time has not yet passed, check whether the delay time has passed.
- If the delay time has not yet passed, reject the connection with a temporary failure.
- If the delay time has passed, update the database entry with a new expire time set to
the current time plus GreylistUpdate, and no delay time. Accept the connection.
- If no delay time exists, check the expire time.
- If the expire time has passed, the database entry is updated with a new delay time and expire
time, and the connection is then rejected with a temporary failure.
- If the expire time has not yet passed, accept the connection.
Summary: The first time a server connects, it must wait the amount of time specified by GreylistDelay before it
is allowed to send a message. It must resend before the GreylistExpire time has passed. Upon successfully passing
its first greylist delay, it will bypass greylisting for the amount of time specified by GreylistUpdate, at which
point it must undergo another delay. Unlike other greylisting mechanisms, spasm only greylists by IP address. It
does not use the envelope sender or envelope recipient when greylisting. This helps keep the size of the greylist
database to a minimum.
Expired entries are automatically removed at intervals defined by GreylistExpireInterval.