From 497b16d311de30a9c6c4fa6892e3827b7f088e9d Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Tue, 12 Nov 2019 15:07:12 +0100 Subject: updating readme --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 1cb1488..7fc5581 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,34 @@ eximstats-cron ============== `eximstats-cron` is a cronjob that runs `eximstats` on your machine. + +`eximstats` is installed with `exim4-base` on Debian/Ubuntu, so ut probably +already exists on your system. Why not use it to generate mailstatistics? :) + +`eximstats-cron` will use `eximstats` to generate daily, weekly, monthly and +yearly statistics in HTML form which you can easily serve using some webserver. + +## Logging in exim4 + +For this script to work, you need to generate daily exim-logs. The following +option will make Exim output logs to `/var/log/exim4/mainlog-YYYYMMDD`. +``` +log_file_path = syslog : /var/log/exim4/%slog-%D +``` +It needs to go into your exim4-config. + +Since I like to find my latest logfiles in a location that doesn't change +every day, I have the following two lines in cron to make sure there is always a +symlink pointing to the latest logfile. +``` +# This just symlinks latest logfiles +# The backslashes before % in `date` escapes %, because they're a special cron-character. +00 00 * * * Debian-exim rm -f /var/log/exim4/mainlog-latest && ln -s /var/log/exim4/mainlog-$(date +\%Y\%m\%d) /var/log/exim4/mainlog-latest && touch /var/log/exim4/mainlog-$(date +\%Y\%m\%d) && chmod 640 /var/log/exim4/mainlog-$(date +\%Y\%m\%d) +00 00 * * * Debian-exim rm -f /var/log/exim4/rejectlog-latest && ln -s /var/log/exim4/rejectlog-$(date +\%Y\%m\%d) /var/log/exim4/rejectlog-latest && touch /var/log/exim4/rejectlog-$(date +\%Y\%m\%d) && chmod 640 /var/log/exim4/rejectlog-$(date +\%Y\%m\%d) +``` + +## Setting up eximstats-cron + +Just clone this repo somewhere, and symlink `eximstats-cron` into +`/etc/cron.daily/`. Easy-peasy. The logs will start to appear in +`/var/log/eximstats` the very next day! -- cgit v1.2.3