This is a rough overview of the file and directory structure of the project.

--

The following modules are in the main source directory:

Makefile - main makefile.  There is a configuration option at the top
to enable using a database.  This should be off for the opensource
version since the database schema isn't documented.

magic-smtpd.c - main module of the program, which contains the smtp
callback handler functions and qmail specific emulation code.

smtp.[ch] - generic SMTP handler library providing basic logic and
callbacks for each command for additional data handling.  Doesn't do
much by itself but allows the daemon to provide different callbacks the
help with emulation of different SMTP daemons.

config_msd.c
config_keys.h
config_defaults.h - Magic SMTP daemon configuration loading code,
data structure, control/env names and default values.

config_qmail.[ch] - Qmail configuration loading code and data
structure.

config_spam_rule.c - spam rule loading code.  Uses file system
routines when compat_type is 0, or database routines if compat type is
1 or 2.

spam_rules.in - main 'source' file for the spam rules.  This contains
the documentation for the spam rules and is used to generate
config_spam_rule.h and some of the dbscripts.   Think of it as
structured documentation which lists key names, dependancies and
defaults for all the rules.  It will (hopefully) be used to generate
spam_check.c later.

spam_check.[ch] - main spam rule checking code.

smtp_checks.[ch] - routines to handle the available smtp spam checks.

check_user.[ch] - main code for checking the validity of users which
are passed during the RCPT SMTP command.  Split into
two files, one for checking the user with qmail's
algorithms on the file system, and another much
simpler version which uses a database that holds
user information.
check_user_fs.c - driver for check user which uses the file system
(like qmail does) for finding existing users.  Used when compat_type
is 0 (qmail)
check_user_db.c - database driver for the check user function.  Used
when compat type is 1 or 2 (non-qmail).

cdb.[ch] - code for reading qmail CDB (constant data base) files.

auth.[ch] - general driver code to handle SMTP AUTH command.
auth_chkp.c - auth driver code for the checkpassword program (not
working)
auth_db.c - auth driver for postgres database.

b64.c - base64 conversion routines.

db.[ch] - database connection information for the application.

strlist.[ch] - simple string list class which performs string
searches.  Very simple now but can be upgraded to hash table easily
later.

utils.[ch] - utility functions for various parts of the code.

dbscripts/*.sh - simple scripts for updating an external postgres
database.  If you're clever you can search through the code and these
scripts to find out the db schema, or you can wait until we have time
to document it, which is probably a better idea if you want to use the
database version (without paying for it).  

--

The following modules are part of lmlibs:

lmstring.[ch] - string class library

lmalloc.[ch] - memory allocation and debugging library

lmlogger.[ch] - program message logging module

lmconfig.[ch] - configuration file loading library

