mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
This commit is contained in:
parent
b92e2c52c5
commit
60afbe1d16
|
@ -66,8 +66,7 @@ RUN apt-get update -q --fix-missing && \
|
||||||
update-locale && \
|
update-locale && \
|
||||||
rm -f /etc/cron.weekly/fstrim
|
rm -f /etc/cron.weekly/fstrim
|
||||||
|
|
||||||
# Enables Clamav
|
RUN echo "0 0,6,12,18 * * * /usr/bin/freshclam --quiet" > /etc/cron.d/freshclam && \
|
||||||
RUN (echo "0 0,6,12,18 * * * /usr/bin/freshclam --quiet" ; crontab -l) | crontab - && \
|
|
||||||
chmod 644 /etc/clamav/freshclam.conf && \
|
chmod 644 /etc/clamav/freshclam.conf && \
|
||||||
freshclam
|
freshclam
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,9 @@ function register_functions() {
|
||||||
|
|
||||||
_register_fix_function "_fix_var_mail_permissions"
|
_register_fix_function "_fix_var_mail_permissions"
|
||||||
_register_fix_function "_fix_var_amavis_permissions"
|
_register_fix_function "_fix_var_amavis_permissions"
|
||||||
|
if [ "$ENABLE_CLAMAV" = 0 ]; then
|
||||||
|
_register_fix_function "_fix_cleanup_clamav"
|
||||||
|
fi
|
||||||
|
|
||||||
################### << fix funcs
|
################### << fix funcs
|
||||||
|
|
||||||
|
@ -1050,6 +1053,12 @@ function _fix_var_amavis_permissions() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _fix_cleanup_clamav() {
|
||||||
|
notify 'task' 'Cleaning up disabled Clamav'
|
||||||
|
rm -f /etc/logrotate.d/clamav-*
|
||||||
|
rm -f /etc/cron.d/freshclam
|
||||||
|
}
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# << Fix Stack
|
# << Fix Stack
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
|
@ -716,7 +716,7 @@ load 'test_helper/bats-assert/load'
|
||||||
#
|
#
|
||||||
|
|
||||||
@test "checking system: freshclam cron is enabled" {
|
@test "checking system: freshclam cron is enabled" {
|
||||||
run docker exec mail bash -c "crontab -l | grep '/usr/bin/freshclam'"
|
run docker exec mail bash -c "grep '/usr/bin/freshclam' -r /etc/cron.d"
|
||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue