Do not enable cron job if dovecot is disabled.

This commit is contained in:
Antoine Nguyen
2020-03-04 11:14:39 +01:00
parent 63c29c34b9
commit b5aa1bc7e7
2 changed files with 5 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ PYTHON=%{venv_path}/bin/python
INSTANCE=%{instance_path}
# Operations on mailboxes
* * * * * %{dovecot_mailboxes_owner} $PYTHON $INSTANCE/manage.py handle_mailbox_operations
%{dovecot_enabled}* * * * * %{dovecot_mailboxes_owner} $PYTHON $INSTANCE/manage.py handle_mailbox_operations
# Sessions table cleanup
0 0 * * * root $PYTHON $INSTANCE/manage.py clearsessions

View File

@@ -55,6 +55,7 @@ class Modoboa(base.Installer):
if "modoboa-radicale" in self.extensions:
if not self.config.getboolean("radicale", "enabled"):
self.extensions.remove("modoboa-radicale")
self.dovecot_enabled = self.config.getboolean("dovecot", "enabled")
def is_extension_ok_for_version(self, extension, version):
"""Check if extension can be installed with this modo version."""
@@ -104,7 +105,9 @@ class Modoboa(base.Installer):
packages += [
"https://github.com/modoboa/caldav/tarball/master#egg=caldav"]
python.install_packages(
packages, self.venv_path, upgrade=self.upgrade, sudo_user=self.user)
packages, self.venv_path, upgrade=self.upgrade,
sudo_user=self.user
)
if self.devmode:
# FIXME: use dev-requirements instead
python.install_packages(