From c2881024c776f141c8e211b34df4dcab8ab81af0 Mon Sep 17 00:00:00 2001 From: angus Date: Fri, 8 Apr 2016 00:23:12 +0200 Subject: [PATCH] Clamav, Imap, Pop3, Dovecot, Postfix services are now logging into /var/log/mail directory. Fail2ban jails and logrotate config files have been updated accordingly. Integration tests have been extended to include a check of the new path. --- start-mailserver.sh | 3 +++ test/tests.bats | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/start-mailserver.sh b/start-mailserver.sh index cff93be2..80054489 100644 --- a/start-mailserver.sh +++ b/start-mailserver.sh @@ -259,6 +259,9 @@ touch /var/log/mail/freshclam.log && chown -R clamav:root /var/log/mail/freshcl sed -i -r 's|/var/log/mail|/var/log/mail/mail|g' /etc/rsyslog.d/50-default.conf sed -i -r 's|LogFile /var/log/clamav/|LogFile /var/log/mail/|g' /etc/clamav/clamd.conf sed -i -r 's|UpdateLogFile /var/log/clamav/|UpdateLogFile /var/log/mail/|g' /etc/clamav/freshclam.conf +sed -i -r 's|/var/log/clamav|/var/log/mail|g' /etc/logrotate.d/clamav-daemon +sed -i -r 's|/var/log/clamav|/var/log/mail|g' /etc/logrotate.d/clamav-freshclam +sed -i -r 's|/var/log/mail|/var/log/mail/mail|g' /etc/logrotate.d/rsyslog echo "Starting daemons" cron diff --git a/test/tests.bats b/test/tests.bats index 3aadc551..709fcae5 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -115,6 +115,16 @@ [ "$status" -eq 0 ] } +# +# logs +# + +@test "checking logs: mail related logs should be located in a subdirectory" { + run docker exec mail /bin/sh -c "ls -1 /var/log/mail/ | grep -E 'clamav|freshclam|mail'|wc -l" + [ "$status" -eq 0 ] + [ "$output" = 3 ] +} + # # smtp #