Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle masked spamassasin #73

Merged
merged 5 commits into from
Sep 13, 2024
Merged

Handle masked spamassasin #73

merged 5 commits into from
Sep 13, 2024

Conversation

SandakovMM
Copy link
Contributor

No description provided.

On some operating systems, systemctl returned "masked" with a new line, so we now handle this case as well
@SandakovMM SandakovMM self-assigned this Sep 11, 2024
@@ -69,8 +75,8 @@ def _post_action(self) -> action.ActionResult:
return action.ActionResult()

def _revert_action(self) -> action.ActionResult:
util.logged_check_call(["/usr/bin/systemctl", "enable", "spamassassin.service"])
util.logged_check_call(["/usr/bin/systemctl", "start", "spamassassin.service"])
util.logged_check_call(["/usr/bin/systemctl", "enable", self.spamassasin_service_name])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it fail here if the service is masked?

# Make sure the trick is preformed before any call of 'systemctl daemon-reload'
# because we change spamassassin.service configuration in scope of this action.
def __init__(self) -> None:
self.name = "handle spamassassin configuration update"
self.spamassasin_service_name = "spamassassin.service"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service has been renamed to spamd in SpamAssassin 4, available e.g. on Debian 12, so to be future-proof it's better to make the name at least configurable.

Mikhail Sandakov added 2 commits September 12, 2024 09:32
The service has been renamed to "spamd" on some operating systems,
such as Debian 12, so we need to provide an option to change the name accordingly.
Copy link
Contributor

@kpushkaryov kpushkaryov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase before merge.

@SandakovMM SandakovMM merged commit 8a71a4b into main Sep 13, 2024
3 checks passed
@SandakovMM SandakovMM deleted the handle-masked-spamassasin branch September 13, 2024 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants