Latest Version: 0.3rc3 2006-05-05
Xmail Log Archiver is exactly what it sounds like - a log archival system for XMail mail servers. XMail is a popular multi-platform mail server. The tool not only places the expired logs into an archival directory with the ability to zip them, it can analyze the various types of logs generated via a modular reporting system. Thus, the postmaster can view statistics such as top HELO domains, top senders and so forth.

Written in PHP, the archival tool can be run on the many platforms that the XMail server has been ported to and can even run from an external machine.
This project is actve, yet still in it's infancy. More documentation including HowTos and report module construction is forthcoming. If you would like to help by contributing documentation, proofreading or code, contact Bryn. Thanks to Rob for his contributions and to the creator of the original picture of the petrified log that became the logo.

For now, here is the output of 'xmlogarch --help':
Bash Wrapper Usage: xmlogarch [-a|--allreports] [(-c|--conf) file] [-d|--dots]
  [-da|--dotall] [(-dp|--dotsper) count] [(-dpe|--dotsperentry) multiplier]
  [(-gp|--genpass) password] (-h|--help) [(-l|--login) login-name]
  [-m|--movelogs] [(-mm|--maxmem) memorylimit] [-n|--noreports] [-nl|--nolog]
  [(-p|--pass) xmailpassword] [-q|--quiet] [-qs|--quietskip]
  [--{reportdirective}] [(-s|--stale) hours] [(-t|--top) number] [-u|--memuse]
  [-v|--verbose] [(-xp|--xmailport) number]
Archive, report and/or zip XMail log files. All command line parameters and
  more oprions are available inside a config file. This is meant to be run by a
  scheduled cron job but may be run manually for testing and debugging. Please
  be aware that if you have anything that modifies, moves or removes log files
  specified in a configuration file, you must override the settings with command
  line options to avoid affecting your log files.
  -a, --allreports           Report Directive. Run all available reports.
                               Individual reoprts may be enabled or disabled by
                               passing further report directives after passing
                               this option to customize reporting on the
                               command line.
  -c, --conf                 Specify a location to load the initial
                               configuration file from. These settings may be
                               overridden by options passed at runtime. The
                               original configuration file is used as default
                               settings. REQUIRED: file
  -d, --dots                 Prints a character for every few operations. See
                               -da, -dp and -dpe for more information.
  -da, --dotall              Prints a character for every option in verbose
                               mode. See -v, -dp and -dpe for more information.
  -dp, --dotsper             Specifies the number of operations to count per
                               character displayed in verbose operations. A
                               setting of zero (0) will disable dots. See -v,
                               -da and -dpe for more information. REQUIRED:
  -dpe, --dotsperentry       Specifies a multiplier to -dp for very large
                               operations such as reading individual log lines.
                               See -v, -da and -dp for more information.
                               REQUIRED: multiplier
  -gp, --genpass             Generate encrypted XMail Server password to store
                               in a config file for performing Server Status
                               Reporting. Network characteristics of the
                               machine the script is currently runing on and
                               the XMail server settings are used to seed the
                               encryption, so when either of these change the
                               encrypted password in config files needs to be
                               updated. When specifying an XMail server at
                               runtime, please also provide a password with the
                               -p option. The script will exit after the
                               encrypted password is output. For more
                               information see -p. REQUIRED: password
  -h, --help                 Display help text and exit.
  -l, --login                Uses provided XMail Server user name for
                               performing Server Status Reporting. REQUIRED:
  -m, --movelogs             Enable movement of stale logs if disabled in
                               config file.
  -mm, --maxmem              Specify memory limit for PHP. The default is 32
                               Megabytes, but large and/or plentiful logs will
                               require more or PHP exits with an error.
                               REQUIRED: memorylimit
  -n, --noreports            Do not process any report modules. This may
                               prevent archival depending on other passed or
                               config file options.
  -nl, --nolog               Do not write information to current
                               xmlogarch-YYYYMMDDHHHH log file.
  -p, --pass                 Uses provided XMail Server password for performing
                               Server Status Reporting. REQUIRED: xmailpassword
  -q, --quiet                Do not print any output to the console. This will
                               also disable -v. If other options are enabled,
                               information may still be mailed or written to
                               xmlogarch-YYYYMMDDHHHH log file.
  -qs, --quietskip           Do not announce skipped report modules. This
                               option does not change which reports will be
                               run. Using a named report directive will also
                               trigger this option. For more information,
                               please see the report directives section.
  --{reportdirective}        See the section about report directives below..
  -s, --stale                Number of hours old a log must be before it is
                               archived or reported on. REQUIRED: hours
  -t, --top                  Number to High Score items to display in reports.
                               A setting of zero (0) will disable High Scores.
                               Not all reports calculate High Scores. Items
                               listed in High Scores depend on the Report
                               Module. See the individual Report Module for
                               specific details of what will be shown.
                               REQUIRED: number
  -u, --memuse               Display memory usage during processing. Memory
                               usage information is NOT written to the
                               xmlogarch-YYYYMMDDHHHH log file. This option is
                               for performance tuning and debugging.
  -v, --verbose              Verbose output enhances regular output by printing
                               progress of file operations to the console as a
                               series of characters. the number of characters
                               per operation depend on other settings. This
                               option also enables the -u option and like that
                               option produces no logged output. Please see -u,
                               -d -dp and -dpe for more information.
  -xp, --xmailport           Specifies the administrative port number for the
                               XMail server. This is used for Server Status
                               reporting. REQUIRED: number
Report Directives: There are three types of report directives - 'named' ,
  'only' and 'no'. 'Only' and 'no' are exactly what they seem. Using a 'no'
  report directive will skip the given report and using an 'only' directive will
  run only that report. The 'named' report is identical to running an 'only'
  report except that skipped reports are not announced (the -qs option). The
  format to specify a report directive is to start with the directive, add the
  report name and lastly add the word report. For example, the 'Zipped Log
  Files' (named 'zip') report can be skipped with the directive '--nozipreport'.
  The 'named' directive has no prefix, hence the term 'named'. So, running the
  'Zipped Logged Files' report in 'named' mode would simply be '--zipreport'.
  The effects of the report directives are stackable as well. For example, you
  may specify report directives such as '--smtpreport --zipreport' to only run
  the 'SMTP Requests' and 'Zipped Log Files' reports without skipped reports.
Alternate Usage: This script can also be run directly from a shell with the
  CLI version of PHP.
PHP CLI Usage: php -f xmlogarch.php -- [-a|--allreports] [(-c|--conf) file]
  [-d|--dots] [-da|--dotall] [(-dp|--dotsper) count] [(-dpe|--dotsperentry)
  multiplier] [(-gp|--genpass) password] (-h|--help) [(-l|--login) login-name]
  [-m|--movelogs] [(-mm|--maxmem) memorylimit] [-n|--noreports] [-nl|--nolog]
  [(-p|--pass) xmailpassword] [-q|--quiet] [-qs|--quietskip]
  [--{reportdirective}] [(-s|--stale) hours] [(-t|--top) number] [-u|--memuse]
  [-v|--verbose] [(-xp|--xmailport) number]