<html> <body> <h2>The Database Schema</h2> The <b>slowmilt</b> milter uses Berkeley DB 4.1, which is <i>not</i> a relational database. Althogh two databases can be joined for bidirectional lookups, that approach was not used for <b>slowmilt</b>. <p> The <b>slowmilt</b> milter uses two databases: <ul> <li>The IP address database</li> <li>The Events database</li> </ul> The keys for the <b>IP address</b> database are IP addresses stored in binary in standard network byte order. <p><code><menu> typedef unsigned long PRIMARY_KEY; /* IPv4 IP number in numeric binary */ </menu></code> The keys for the <b>Events</b> database are a combination of an IP address and a date/time, where the date/time is in binary in Unix <i>time_t</i> format. <p><code><pre><menu> typedef struct { PRIMARY_KEY ip; PRIMARY_DATUM date; } SECONDARY_KEY; </menu></pre></code> For version 1 of the database (where no version information is stored) the data for the <b>IP address</b> database is an ever growing aray of date/time entries. <p><code><menu> typedef PRIMARY_DATUM **PRIMARY_DATA; /* FIFO list of date/times */ </menu></code> The next version of the <b>IP address</b> database will use the zeroth date/time as a flag to signal such things as whitelisting and aliases. In this next version, IP address 0.0.0.0 will hold the version number. <p> The data for the <b>Events</b> database is a structure that looks like this: <p><code><pre><menu> # define MAX_MESSAGE_ID (256) typedef struct { BITMAP eventmap; /* See the BIT_ definitions below */ unsigned int envrcpts; /* excess envelope recipients */ unsigned int headrcpts; /* excess header recipients */ unsigned int honeyrcpts; /* total honey pot recipients */ unsigned int badrcpts; /* total bad recipients */ char msgid[MAX_MESSAGE_ID]; } SECONDARY_DATUM; </menu></pre></code> The items in this datum structure (together) define a single event. See the <a href="slowedit/events.html">standard event set</a> for a description of what the items in this structure mean. Also see <i>slow.h</i> in the source distribution to understand the ordering of bits in <code>eventmap</code>. <p> Both databases together constitute the <b>database</b>. The database can be dumped to a file using the <a href="slowedit/list.html">slowedit list</a> command, and that text output can be later be fed back into the <a href="slowedit/rebuild">slowlist rebuild</a> command to recreate the database. </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 4222 | bryan_costales |
Massive rewrite to speed up the database writes. Using a single database now with duplicate keys where the keys are the IP numbers. Added a purge command and removed the garbage command. Fixed some leaking memory bugs and properly closed the database in a few places were it was not properly closed. Updated the docs to reflect this and bumped both the database version and release number. Running on a FreeBSD 3.x machine and a Solaris 9 machine. |
||
#2 | 4052 | bryan_costales |
Implimented: whitelisting AddMXHost for MX servers that lie Converted to thread safe DNS routines garbage collection RunAsUser and RunAsGroup for root startups rebuild the database summarize by IP number Finished all documentation. Moved release from alpha to beta |
||
#1 | 3998 | bryan_costales |
Brought the whole distribution up to V0.9 Added a huge abount of documentation. Added slowedit find Created startup scripts to launch for testing Fixed numerous bugs. Fixed a few portablity issues. Installed hooks for whitelisting and IP aliases. |