protocols = " imap lmtp pop3"
auth_debug = yes
auth_mechanisms = plain login
auth_username_format = %n
auth_verbose = yes
base_dir = {{ directory['run-dovecot'] }}
state_dir = {{directory['var-dovecot'] }}
mail_temp_dir = {{directory['tmp-dovecot'] }}

default_internal_user = {{ slap_configuration['user-name'] }}
default_login_user = {{ slap_configuration['user-name'] }}
default_internal_group = {{ slap_configuration['user-name'] }}

disable_plaintext_auth = no
mail_location = maildir:~/Maildir
mail_debug = yes

service anvil {
  chroot =
}
service imap-login {
  chroot =
}
service pop3-login {
  chroot =
  inet_listener pop3 {
    port = 10110
  }
  inet_listener pop3s {
    port = 10995
  }
}
service imap-login {
  inet_listener imap {
    port = 10143
  }
  inet_listener imaps {
    port = 10993
  }
}
service auth {
  unix_listener {{ postfix_auth }} {
    mode = 0660
    user = {{ slap_configuration['user-name'] }}
    group = {{ slap_configuration['user-name'] }}
  }
}
service lmtp {
  unix_listener {{ postfix_dovecot_lmtp }} {
    user = {{ slap_configuration['user-name'] }}
    group = {{ slap_configuration['user-name'] }}
    mode = 0600
  }
}
log_path = {{ directory['log'] }}/dovecot.log


namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}

ssl = no

passdb {
  driver = lua
  args = file={{ dovecot_passdb_lua }} blocking=yes
}
userdb {
  driver = static
  args = uid={{ slap_configuration['user-name'] }} gid={{ slap_configuration['user-name'] }} home={{ directory['home-dovecot'] }}/%u
}
