Updated for 2.2

This commit is contained in:
Spitap
2023-04-25 17:57:47 +02:00
parent e537794af2
commit 0b0e2a4e6a
8 changed files with 86 additions and 7 deletions

View File

@@ -30,6 +30,17 @@ class Dovecot(base.Installer):
"conf.d/10-master.conf", "conf.d/20-lmtp.conf", "conf.d/10-ssl-keys.try"]
with_user = True
def __init__(self, *args, **kwargs):
super.__init__(*args, **kwargs)
# Check if modoboa version > 2.2
self.modoboa_2_2_or_greater = False
condition = (
(modoboa_version[0] == 2 and modoboa_version[1] >= 2) or
modoboa_version[0] > 2
)
if condition:
self.modoboa_2_2_or_greater = True
def setup_user(self):
"""Setup mailbox user."""
super().setup_user()
@@ -83,6 +94,7 @@ class Dovecot(base.Installer):
else:
# Protocols are automatically guessed on debian/ubuntu
protocols = ""
context.update({
"db_driver": self.db_driver,
"mailboxes_owner_uid": pw_mailbox[2],
@@ -97,7 +109,9 @@ class Dovecot(base.Installer):
"ssl_protocol_parameter": ssl_protocol_parameter,
"radicale_user": self.config.get("radicale", "user"),
"radicale_auth_socket_path": os.path.basename(
self.config.get("dovecot", "radicale_auth_socket_path"))
self.config.get("dovecot", "radicale_auth_socket_path")),
"modoboa_2_2_or_greater": "" if self.modoboa_2_2_or_greater else "#",
"not_modoboa_2_2_or_greater": "" if not self.modoboa_2_2_or_greater else "#"
})
return context