Next: , Previous: Installation, Up: Top


7 Internals

This chapter describes some of dgrey's internals, including how the greylisting mechanism works and how the nodes communicate and synchronize data.

Most text here is yet to be written. However, dgrey's greylisting mechanism works mostly like that of Postgrey, so I recommend checking out the Postgrey documentation for more information on that subject.

There are two databases, the greylist database and the auto-whitelist database. (XXX Need to describe these databases here. Describe the purposes and format of keys and values.)

There are some concepts specific to dgrey:

poll host
A poll host is a host which dgrey synchronizes database information with.
action log
This a local file which each node stores database changes (actions) in. This is a normal text file which resides in the database directory. It grows as the database is updated. When other poll host nodes connect, they first receive missed lines from this file.

In order to prevent this file from growing too big, it is usually rotated once a week. This can be done through a crontab script. A part of the log file–the recent additions–is usually kept, and the remainder discarded. This means that poll hosts that have been down for a week or more will actually lose some greylisting information.

The first line of this file is special–it contains the poll host offset at which the first log entry in it starts at.

poll host offset
To keep track of synchronization positions between nodes, a simple offset in the action log file is used. Each database change (action) synchronized between the nodes has a poll host offset. Each node keeps track of its last known poll host offset for all other nodes, as well as its poll host offset for the first and last entry in the log file.