Bug 49274 - create check if spamassassin rules are present
create check if spamassassin rules are present
Status: RESOLVED DUPLICATE of bug 48944
Product: UCS
Classification: Unclassified
Component: UMC - System diagnostic
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-10 11:21 CEST by Jannik Ahlers
Modified: 2022-01-28 18:24 CET (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jannik Ahlers univentionstaff 2019-04-10 11:21:48 CEST
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.
Comment 1 Jannik Ahlers univentionstaff 2019-04-10 11:43:26 CEST
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).
Comment 2 Florian Best univentionstaff 2019-04-10 11:52:10 CEST
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
Comment 3 Florian Best univentionstaff 2022-01-28 18:24:32 CET

*** This bug has been marked as a duplicate of bug 48944 ***