The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

sastatd - SpamAssassin statistic collecting server

SYNOPSIS

sastatd [ options ] spamd-log-file

DESCRIPTION

This script (running as a daemon) permanent watching for SpamAssassin spamd log file and increment internal counters for any spam and clean message. Log rotating events detected automatically, no special actions required. Accumulated statistic flushed to persistent file based storage periodically. Statistic dump is available via simple TCP based protocol.

PROTOCOL

Communication protocol is line oriented (like HTTP or SMTP). Any command followed by a new line character.

Available commands (case independent): brief - print out only counters and rate for clean/spam/total messages stats - print out statistic in easily parsable format reset - clear all accumulated statistic dump - print out statistic and clear it immediately quit - force close connection

CLIENT EXAMPLE

echo brief | nc 127.0.0.1 4321 | awk -F: '/^clean/ { print $2 }'

OPTIONS

 -b, --heartbeat=SECONDS     Heartbeat period for saving statistic in a permanent storage
                             Default values is 10 seconds.

 -g, --debug                 Running in debug mode:
                               - no detach (run in foreground)
                               - no set user (run with permissions of current user)
                               - logging information as much as possible to stderr

 -d, --database=FILE         Path to database file keeping statistic (created automatically).
                             Default setting is C<sastatd.db> file in current directory.

 -h, --help                  Show short help message about options format.

 -l, --listen=[ADDR:]PORT    Address with port or just port (* supposed for address)
                             for listen socket binding.

 -p, --pid-file=FILE         Path to file with process id (guarantee only one daemon running).

 -u, --user=LOGIN            Account name for changing process privileges to.

AUTHOR

Oleg A. Mamontov (oleg@mamontov.net)

COPYRIGHT

Copyright (C) 2010 Oleg A. Mamontov. All rights reserved.

This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.