mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 17:44:49 +02:00
scripts: improve CLAMAV_MESSAGE_SIZE_LIMIT
usage (#3332)
* add sanity check for Clam size & adjusted MaxScanSize The second part is of special importance! See <https://askubuntu.com/a/1448525>, which explains that the maximum scan size is important as well. We previously just set the maximum file size, which actually is pretty insecure as we silently not scan mile bigger than `MaxScanSize`. This is corrected now. * add SlamAV size configuration to Rspamd
This commit is contained in:
parent
3340b80972
commit
78b7f0cbea
5 changed files with 33 additions and 2 deletions
|
@ -20,6 +20,7 @@ function setup_file() {
|
|||
--env ENABLE_OPENDMARC=0
|
||||
--env ENABLE_POLICYD_SPF=0
|
||||
--env ENABLE_POSTGREY=0
|
||||
--env CLAMAV_MESSAGE_SIZE_LIMIT=42M
|
||||
--env PERMIT_DOCKER=host
|
||||
--env LOG_LEVEL=trace
|
||||
--env MOVE_SPAM_TO_JUNK=1
|
||||
|
@ -78,6 +79,7 @@ function teardown_file() { _default_teardown ; }
|
|||
run docker logs "${CONTAINER_NAME}"
|
||||
assert_success
|
||||
assert_line --partial 'Enabling ClamAV integration'
|
||||
assert_line --partial 'Adjusting maximum size for ClamAV to 42000000 bytes (42M)'
|
||||
assert_line --partial 'Setting up intelligent learning of spam and ham'
|
||||
assert_line --partial 'Enabling greylisting'
|
||||
assert_line --partial 'Hfilter (group) module is enabled'
|
||||
|
@ -96,6 +98,11 @@ function teardown_file() { _default_teardown ; }
|
|||
_service_log_should_contain_string 'rspamd' 'lua module metric_exporter is disabled in the configuration'
|
||||
}
|
||||
|
||||
@test 'antivirus maximum size was adjusted' {
|
||||
_run_in_container grep 'max_size = 42000000' /etc/rspamd/local.d/antivirus.conf
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test 'normal mail passes fine' {
|
||||
_service_log_should_contain_string 'rspamd' 'F \(no action\)'
|
||||
|
||||
|
|
|
@ -57,6 +57,11 @@ function teardown_file() { _default_teardown ; }
|
|||
assert_line --partial 'Disabling Hfilter (group) module'
|
||||
}
|
||||
|
||||
@test 'antivirus maximum size was not adjusted unnecessarily' {
|
||||
_run_in_container grep 'max_size = 25000000' /etc/rspamd/local.d/antivirus.conf
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test 'learning is properly disabled' {
|
||||
for FILE in learn-{ham,spam}.{sieve,svbin}
|
||||
do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue