mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 01:55:29 +02:00
scripts: Rspamd stabilization pt. 2 (#3282)
* move modules adjustment file to new location Because we link `/tmp/docker-mailserver/rspamd/override.d` to `/etc/rspamd/override.d`, I think it makes sense to move the modules adjustment file into `/tmp/docker-mailserver/rspamd/` as well. I write the code in a way that it is backwards compatible for now, so this is NOT a breaking change. * minor improvement to `__rspamd__handle_user_modules_adjustments` The expansion of `ARGUMENT3` is now done in a way that only adds the whitespace in case the variable is set and not null. * move test file structure to respect latest changes Because we're now linking `rspamd/override.d/`, we can simplify the setup a bit. But this requires a change in directory structure. The current Rspamd test will be renamed to `rspamd_full.bats`, because I plan on adding more tests in different files for different feature sets. This is done to make this feature well-tested! * improved and added tests to Rspamd-full FYI: The line ```bats _run_in_container grep 'sieve_global_extensions.*\+vnd\.dovecot\.pipe' "${SIEVE_CONFIG_FILE}" ``` was testing a condition that should actually not be met, but when I started working on this feature, I thought this was the correct configuration. Adding the `assert_success` statements revealed this wrong line. I also added tests to check whether `override.d` is linked correctly. * renamed: `rspamd.bats` => `rspamd_full.bats` * added new tests for incomplete Rspamd feature set We now test that warnings are emitted & features are disabled correctly. * update documentation
This commit is contained in:
parent
638975922e
commit
cd1721334c
10 changed files with 155 additions and 31 deletions
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
cat >/etc/rspamd/override.d/testmodule_complicated.conf << EOF
|
||||
complicated {
|
||||
anOption = someValue;
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "enable_test_patterns = true;" >>/etc/rspamd/local.d/options.inc
|
||||
|
||||
echo 'mail_debug = yes' >>/etc/dovecot/dovecot.conf
|
||||
sed -i -E '/^}/d' /etc/dovecot/conf.d/90-sieve.conf
|
||||
echo -e 'sieve_trace_debug = yes\n}' >>/etc/dovecot/conf.d/90-sieve.conf
|
|
@ -0,0 +1,3 @@
|
|||
complicated {
|
||||
anOption = someValue;
|
||||
}
|
16
test/config/rspamd_full/user-patches.sh
Normal file
16
test/config/rspamd_full/user-patches.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Enable GTUBE test patterns so we can properly check whether
|
||||
# Rspamd is rejecting mail, adding headers, etc.
|
||||
#
|
||||
# We do not use `custom-commands.conf` because this a feature
|
||||
# we are testing too.
|
||||
echo "enable_test_patterns = true;" >>/etc/rspamd/local.d/options.inc
|
||||
|
||||
# We want Dovecot to be very detailed about what it is doing,
|
||||
# specificially for Sieve because we need to check whether the
|
||||
# Sieve scripts are executed so Rspamd is trained when using
|
||||
# `RSPAMD_LEARN=1`.
|
||||
echo 'mail_debug = yes' >>/etc/dovecot/dovecot.conf
|
||||
sed -i -E '/^}/d' /etc/dovecot/conf.d/90-sieve.conf
|
||||
echo -e '\n sieve_trace_debug = yes\n}' >>/etc/dovecot/conf.d/90-sieve.conf
|
Loading…
Add table
Add a link
Reference in a new issue