# Generated by Chef

# Authentication for passwd-file users. Included from 10-auth.conf.
#
# passwd-like file with specified location.
# <doc/wiki/AuthDatabase.PasswdFile.txt>

<% if DovecotCookbook::Auth.passdb?(@auth['passwdfile']) -%>
<%=  DovecotCookbook::Conf.authdb('passwd-file', 'passdb', @auth['passwdfile']['passdb']) %>
<% else -%>
passdb {
  driver = passwd-file
  args = scheme=CRYPT username_format=%u /etc/dovecot/users
}
<% end -%>

<% if DovecotCookbook::Auth.userdb?(@auth['passwdfile']) -%>
<%=  DovecotCookbook::Conf.authdb('passwd-file', 'userdb', @auth['passwdfile']['userdb']) %>
<% else -%>
userdb {
  driver = passwd-file
  args = username_format=%u /etc/dovecot/users

  # Default fields that can be overridden by passwd-file
  #default_fields = quota_rule=*:storage=1G

  # Override fields from passwd-file
  #override_fields = home=/home/virtual/%u
}
<% end -%>
