# Generated by Chef

# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-dict.conf.ext

# Dictionary URI
<%= DovecotCookbook::Conf.attribute(@conf['dict_auth'], 'uri') %>

# Key for passdb lookups
<%= DovecotCookbook::Conf.attribute(@conf['dict_auth'], 'password_key', 'dovecot/passdb/%u') %>

# Key for userdb lookups
<%= DovecotCookbook::Conf.attribute(@conf['dict_auth'], 'user_key', 'dovecot/userdb/%u') %>

# How to parse the value for key=value pairs. Currently we support only JSON
# format with { "key": "value", ... } object.
<%= DovecotCookbook::Conf.attribute(@conf['dict_auth'], 'value_format', 'json') %>

# Default password scheme
<%= DovecotCookbook::Conf.attribute(@conf['dict_auth'], 'default_pass_scheme', 'MD5') %>

# Username iteration prefix. Keys under this are assumed to contain usernames.
<%= DovecotCookbook::Conf.attribute(@conf['dict_auth'], 'iterate_prefix', 'userdb/') %>

# Should iteration be disabled for this userdb? If this userdb acts only as a
# cache there's no reason to try to iterate the (partial & duplicate) users.
<%= DovecotCookbook::Conf.attribute(@conf['dict_auth'], 'iterate_disable', 'no') %>

# TODO (Chef Cookbook): Support the configuration below.

# The example here shows how to do multiple dict lookups and merge the replies.
# The "passdb" and "userdb" keys are JSON objects containing key/value pairs,
# for example: { "uid": 1000, "gid": 1000, "home": "/home/user" }

# key passdb {
#   key = passdb/%u
#   format = json
# }
# key userdb {
#   key = userdb/%u
#   format = json
# }
# key quota {
#   key = userdb/%u/quota
#   #format = value
#   # The default_value is used if the key isn't found. If default_value setting
#   # isn't specified at all (even as empty), the passdb/userdb lookup fails with
#   # "user doesn't exist".
#   default_value = 100M
# }

# Space separated list of keys whose values contain key/value paired objects.
# All the key/value pairs inside the object are added as passdb fields.
# passdb_objects = passdb

#passdb_fields {
#}

# Userdb key/value object list.
# userdb_objects = userdb

# userdb_fields {
#   # dict:<key> refers to key names
#   quota_rule = *:storage=%{dict:quota}
#
#   # dict:<key>.<objkey> refers to the objkey inside (JSON) object
#   mail = maildir:%{dict:userdb.home}/Maildir
# }
