Univention Bugzilla – Bug 49274
create check if spamassassin rules are present
Last modified: 2022-01-28 18:24:32 CET
Spamassassin doesn't start if the spamassassin rules are for some reason not downloaded. a new diagnosis plugin should check if spamassassin rules/signatures are missing. Amavis does not even start any more, if the signatures are to missing/old. The diagnosis module should support to update the signatures . check if rules are present, else display button to do "sa-update" and amavis restart.
This Bug was fixed in the following pull request: https://github.com/univention/univention-corporate-server/pull/11 I fixed this together with Christian Castens (an intern of ours).
Looks good! Instead of the dpkg -s spamassasin check you could also simply check if /usr/bin/spamassassin exists. There are some coding style issues: $ flake8 umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:35:1: F401 'ldap' imported but unused umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:36:1: F401 'socket' imported but unused umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:43:1: F401 'univention.admin.modules as udm_modules' imported but unused umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:44:1: F401 'univention.config_registry' imported but unused umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:45:1: F401 'univention.config_registry.handler_set as ucr_set' imported but unused umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:46:1: F401 'univention.config_registry.handler_unset as ucr_unset' imported but unused umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:47:1: F401 'univention.management.console.modules.diagnostic.MODULE' imported but unused $ ucspep8 E 0020-E302: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:57:1: expected 2 blank lines, found 1 E 0020-E305: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:62:1: expected 2 blank lines after class or function definition, found 1 E 0020-E101: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:63:1: indentation contains mixed spaces and tabs E 0020-W293: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:65:1: blank line contains whitespace E 0020-E222: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:74:14: multiple spaces after operator E 0020-E222: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:75:14: multiple spaces after operator E 0020-E226: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:78:48: missing whitespace around arithmetic operator E 0020-E101: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:80:1: indentation contains mixed spaces and tabs W 0020-E126: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:80:25: continuation line over-indented for hanging indent E 0020-E101: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:84:1: indentation contains mixed spaces and tabs E 0020-E226: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:85:44: missing whitespace around arithmetic operator E 0020-E701: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:92:11: multiple statements on one line (colon) E 0020-E305: umc/python/diagnostic/plugins/57_check_spamassassin_rules.py:95:1: expected 2 blank lines after class or function definition, found 1
*** This bug has been marked as a duplicate of bug 48944 ***