{# Copyright (C) 2020 Émile <emile@bleuchtang.fr>
 # Copyright (C) 2020 DebOps <https://debops.org/>
 # SPDX-License-Identifier: GPL-3.0-only
 #}
# {{ ansible_managed }}
{#

This file follows the upstream default configuration except for the parts
that are configurable via DebOps variables. If you need a more customized
setup, you can provide your own template via lookup mechanism.

#}

{% if 'checkpassword' in dovecot_user_accounts %}
{%   if dovecot_checkpassword_passdb_command is defined and dovecot_checkpassword_passdb_command %}
passdb {
  driver = checkpassword
  args = {{ dovecot_checkpassword_passdb_command }}
}
{%   else %}
# DebOps variable dovecot_checkpassword_passdb_command = {{ dovecot_checkpassword_passdb_command }}
{%   endif %}

{%   if dovecot_checkpassword_userdb_command is defined and dovecot_checkpassword_userdb_command %}
userdb {
  driver = prefetch
}

userdb {
  driver = checkpassword
  args = {{ dovecot_checkpassword_userdb_command }}
}
{%   else %}
# DebOps variable dovecot_checkpassword_userdb_command = {{ dovecot_checkpassword_userdb_command }}
{%   endif %}
{% endif %}
