diff --git a/Dockerfile b/Dockerfile index c2efd19..eccec9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,12 @@ RUN apt-get update && apt-get install -y -q --no-install-recommends \ inotify-tools \ # To enable compression in imap arj bzip2 cabextract cpio file gzip nomarch pax unzip zip \ + # clamav-base 1.4.6 creates its user as a locked system account + # (sysusers.d "u!"), which also sets it to expire on 1970-01-02. cron, like + # su, checks the account through PAM and refuses an expired one, so the + # hourly clamav-unofficial-sigs update is refused. Clear the expiry; the + # password stays locked. + && usermod -e '' clamav \ && rm -rf /var/spool/postfix \ && ln -s /var/mail/postfix/spool /var/spool/postfix \ && apt-get autoremove -y \ diff --git a/test/default.bats b/test/default.bats index 5cf2ace..b206f88 100644 --- a/test/default.bats +++ b/test/default.bats @@ -784,6 +784,14 @@ load 'test_helper/bats-assert/load' assert_success } +# cron checks the account through PAM and refuses an expired one. clamav-base +# 1.4.6 creates clamav already expired (see the Dockerfile). +@test "checking clamav-unofficial-sigs: the clamav account does not expire" { + run docker exec mailserver_default chage -l clamav + assert_success + assert_output --regexp 'Account expires[[:space:]]*: never' +} + # The update runs as clamav, at startup and from cron, and reads the copy of # user.conf that setup makes. The suite's user.conf is readable by its owner # only, as an administrator's may be.