Package: exim4-base Version: 4.71-3ubuntu1 Severity: minor Tags: patch Hi,
Because there's a request for patches in /etc/cron.daily/exim4-base regarding rotated logs attached is my take on this. It's been written on Ubuntu but (hence the version) but I hope there's not too much difference. Please note that I've moved exim4-base from /etc/cron.daily to /etc/cron.weekly as I've got no interest in daily exim logs, which is also the reason for the `seq 1 7`. If you apply this patch to the package, please consider leaving the for-loop (with `seq 1 1`) in so that people with weekly logs can easily patch it. thanks, Mrten.
--- exim4-base-old 2010-12-20 10:39:55.000000000 +0100 +++ exim4-base 2010-12-20 12:33:44.000000000 +0100 @@ -40,8 +40,10 @@ if [ -n "$E4BCD_DAILY_REPORT_TO" ]; then if [ -x "$(command -v eximstats)" ] && [ -x "$(command -v mail)" ]; then - if [ "$(< /var/log/exim4/mainlog.1 grep -v "$E4BCD_MAINLOG_NOISE" | wc -l)" -gt "0" ]; then - < /var/log/exim4/mainlog.1 grep -v "$E4BCD_MAINLOG_NOISE" \ + + if [ "$(for i in `seq 1 7`; do date +%Y-%m-%d -d "$i days ago" | grep -shf- /var/log/exim4/mainlog /var/log/exim4/mainlog.1 ; done | grep -v "$E4BCD_MAINLOG_NOISE" | wc -l)" -gt "0" ]; then + for i in `seq 1 7`; do date +%Y-%m-%d -d "$i days ago" | grep -shf- /var/log/exim4/mainlog /var/log/exim4/mainlog.1 ; done \ + | grep -v "$E4BCD_MAINLOG_NOISE" \ | eximstats $E4BCD_DAILY_REPORT_OPTIONS \ | mail $E4BCD_DAILY_REPORT_TO -s"$(hostname --fqdn) Daily e-mail activity report" else