diff --git a/deploy-chatmail/src/deploy_chatmail/__init__.py b/deploy-chatmail/src/deploy_chatmail/__init__.py index 5e280fa2..caf3f2b9 100644 --- a/deploy-chatmail/src/deploy_chatmail/__init__.py +++ b/deploy-chatmail/src/deploy_chatmail/__init__.py @@ -138,7 +138,7 @@ def _configure_postfix(domain: str) -> bool: return need_restart -def _configure_dovecot(mail_server: str) -> bool: +def _configure_dovecot(mail_server: str, debug=False) -> bool: """Configures Dovecot IMAP server.""" need_restart = False @@ -149,6 +149,7 @@ def _configure_dovecot(mail_server: str) -> bool: group="root", mode="644", config={"hostname": mail_server}, + debug=debug, ) need_restart |= main_config.changed auth_config = files.put( @@ -215,7 +216,8 @@ def deploy_chatmail(mail_domain: str, mail_server: str, dkim_selector: str) -> N ) _install_chatmaild() - dovecot_need_restart = _configure_dovecot(mail_server) + debug = False + dovecot_need_restart = _configure_dovecot(mail_server, debug=debug) postfix_need_restart = _configure_postfix(mail_domain) opendkim_need_restart = _configure_opendkim(mail_domain, dkim_selector) diff --git a/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 b/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 index 5834e717..996e037c 100644 --- a/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 +++ b/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 @@ -4,13 +4,17 @@ protocols = imap lmtp auth_mechanisms = plain +{% if debug == true %} auth_verbose = yes auth_debug = yes auth_debug_passwords = yes auth_verbose_passwords = plain auth_cache_size = 100M -mail_plugins = quota mail_debug = yes +{% endif %} + + +mail_plugins = quota # Authentication for system users. passdb {