##
##  dovecot.conf -- Dovecot server configuration
##

protocols                  = imap pop3 sieve

service imap-login {
    protocol               = imap
    inet_listener imap {
        address            = 127.0.0.1
        port               = 143
    }
    inet_listener imaps {
        address            = 127.0.0.1
        port               = 993
    }
    client_limit           = 256
    process_limit          = 128
    process_min_avail      = 4
    user                   = @l_musr@
}

service pop3-login {
    protocol               = pop3
    inet_listener pop3 {
        address            = 127.0.0.1
        port               = 110
    }
    inet_listener pop3s {
        address            = 127.0.0.1
        port               = 995
    }
    client_limit           = 256
    process_limit          = 128
    process_min_avail      = 4
    user                   = @l_musr@
}

service managesieve-login {
    protocol               = sieve
    inet_listener sieve {
        address            = 127.0.0.1
        port               = 4190
    }
    client_limit           = 256
    process_limit          = 128
    process_min_avail      = 4
    user                   = @l_musr@
}

service auth {
    unix_listener auth-master {
        mode               = 0660
    }
    unix_listener auth-client {
        mode               = 0660
    }
    unix_listener auth-userdb {
        mode               = 0660
    }
}

ssl                        = yes
ssl_ca                     = <@l_prefix@/etc/x509/example-ca.crt.pem
ssl_cert                   = <@l_prefix@/etc/x509/example-server.crt.pem
ssl_key                    = <@l_prefix@/etc/x509/example-server.key.pem

mail_location              = mbox:~/.mail:INBOX=~/.mail/inbox:INDEX=~/.mail
mail_uid                   = @l_rusr@
mail_gid                   = @l_rusr@
mail_privileged_group      = @l_rusr@
mbox_read_locks            = fcntl
mbox_write_locks           = fcntl

plugin {
    sieve_dir              = ~/.mail/.sieve
    sieve                  = ~/.mail/.sieve.active
}

auth_realms                = example.com
auth_verbose               = yes
disable_plaintext_auth     = no

auth_mechanisms            = plain login
auth_debug                 = no
auth_debug_passwords       = no
mail_debug                 = no
verbose_ssl                = no

default_login_user         = @l_musr@
default_internal_user      = @l_rusr@
default_internal_group     = @l_rgrp@

protocol lda {
    postmaster_address     = postmaster
}

passdb {
    driver                 = passwd
}

userdb {
    driver                 = passwd
}

