dovecot-example.conf revision 39afc7584d935b2dc7332c21966a7b20da03f1ec
45312f52ff3a3d4c137447be4c7556500c2f8bf2Timo Sirainen## Dovecot configuration file
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# "dovecot -n" command gives a clean output of the changed settings. Use it
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# instead of copy&pasting this file when posting to the Dovecot mailing list.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# '#' character and everything after it is treated as comments. Extra spaces
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# and tabs are ignored. If you want to use either of these explicitly, put the
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# value inside quotes, eg.: key = "# char and trailing whitespace "
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Default values are shown for each setting, it's not required to uncomment
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# any of the lines. Exception to this are paths, they're just examples with
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# the real defaults being based on configure options. The paths listed here
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# --with-ssldir=/etc/ssl
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Base directory where to store runtime data.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Protocols we want to be serving: imap imaps pop3 pop3s
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# If you only want to use dovecot-auth, you can set this to "none".
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#protocols = imap imaps
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# A space separated list of IP or host addresses where to listen in for
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# interfaces. Use "*, [::]" for listening both IPv4 and IPv6.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# If you want to specify ports for each service, you will need to configure
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# these settings inside the protocol imap/pop3 { ... } section, so you can
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# specify different ports for IMAP/POP3. For example:
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# protocol imap {
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# listen = *:10143
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# ssl_listen = *:10943
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# protocol pop3 {
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# listen = *:10100
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Disable LOGIN command and all other plaintext authentications unless
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# matches the local IP (ie. you're connecting from the same computer), the
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# connection is considered secure and plaintext authentication is allowed.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#disable_plaintext_auth = yes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Should all IMAP and POP3 processes be killed when Dovecot master process
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# shuts down. Setting this to "no" means that Dovecot can be upgraded without
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# forcing existing client connections to close (although that could also be
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# a problem if the upgrade is eg. because of a security fix). This however
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# means that after master process has died, the client processes can't write
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# to log files anymore.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#shutdown_clients = yes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Log file to use for error messages, instead of sending them to syslog.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# /dev/stderr can be used to log into stderr.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen# Log file to use for informational and debug messages.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen# Default is the same as log_path.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen#info_log_path =
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Prefix for each line written to log file. % codes are in strftime(3)
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#log_timestamp = "%b %d %H:%M:%S "
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Syslog facility to use if you're logging to syslog. Usually if you don't
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# want to use "mail", you'll use local0..local7. Also other standard
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# facilities are supported.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#syslog_facility = mail
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen## SSL settings
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# IP or host address where to listen in for SSL connections. Remember to also
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# add imaps and/or pop3s to protocols setting. Defaults to same as "listen"
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# setting if not specified.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Disable SSL/TLS support. <doc/wiki/SSL>
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#ssl_disable = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# dropping root privileges, so keep the key file unreadable by anyone but
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# root. Included doc/mkcert.sh can be used to easily generate self-signed
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# certificate, just make sure to update the domains in dovecot-openssl.cnf
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#ssl_cert_file = /etc/ssl/certs/dovecot.pem
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#ssl_key_file = /etc/ssl/private/dovecot.pem
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# If key file is password protected, give the password here. Alternatively
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# give it when starting dovecot with -p parameter. Since this file is often
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# world-readable, you may want to place this setting instead to a different
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# root owned 0600 file by using !include_try <path>.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#ssl_key_password =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# File containing trusted SSL certificate authorities. Set this only if you
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# intend to use ssl_verify_client_cert=yes. The CAfile should contain the
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# CA-certificate(s) followed by the matching CRL(s).
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#ssl_ca_file =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Request client to send a certificate. If you also want to require it, set
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# ssl_require_client_cert=yes in auth section.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#ssl_verify_client_cert = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Which field from certificate to use for username. commonName and
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# x500UniqueIdentifier are the usual choices. You'll also need to set
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# ssl_username_from_cert=yes.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#ssl_cert_username_field = commonName
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# How often to regenerate the SSL parameters file. Generation is quite CPU
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# intensive operation. The value is in hours, 0 disables regeneration
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#ssl_parameters_regenerate = 168
7a24bdc1a5e2d5368c2569b4852192f2bdb5a31fTimo Sirainen# SSL ciphers to use
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#ssl_cipher_list = ALL:!LOW:!SSLv2
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Show protocol level SSL errors.
7a24bdc1a5e2d5368c2569b4852192f2bdb5a31fTimo Sirainen#verbose_ssl = no
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen## Login processes
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Directory where authentication process places authentication UNIX sockets
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# which login needs to be able to connect to. The sockets are created when
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# running as root, so you don't have to worry about permissions. Note that
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# everything in this directory is deleted when Dovecot is started.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# chroot login process to the login_dir. Only reason not to do this is if you
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# wish to run the whole Dovecot without roots. <doc/wiki/Rootless.txt>
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_chroot = yes
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# User to use for the login process. Create a completely new user for this,
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# and don't use it anywhere else. The user must also belong to a group where
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# only it has access, it's used to control access for authentication process.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Note that this user is NOT used to access mails. <doc/wiki/UserIds.txt>
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_user = dovecot
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Set max. process size in megabytes. If you don't use
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# login_process_per_connection you might need to grow this.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_process_size = 64
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Should each login be processed in it's own process (yes), or should one
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# login process be allowed to process multiple connections (no)? Yes is more
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# secure, espcially with SSL/TLS enabled. No is faster since there's no need
7e209b78ca757294dbbc15604c88673b3a6b0c39Timo Sirainen# to create processes all the time.
7e209b78ca757294dbbc15604c88673b3a6b0c39Timo Sirainen#login_process_per_connection = yes
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Number of login processes to keep for listening new connections.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_processes_count = 3
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Maximum number of login processes to create. The listening process count
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# usually stays at login_processes_count, but when multiple users start logging
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# in at the same time more extra processes are created. To prevent fork-bombing
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# we check only once in a second if new processes should be created - if all
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# of them are used at the time, we double their amount until the limit set by
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# this setting is reached.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_max_processes_count = 128
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Maximum number of connections allowed per each login process. This setting
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# is used only if login_process_per_connection=no. Once the limit is reached,
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# the process notifies master so that it can create a new login process.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_max_connections = 256
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Greeting message for clients.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_greeting = Dovecot ready.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Space separated list of trusted network ranges. Connections from these
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# IPs are allowed to override their IP addresses and ports (for logging and
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# for authentication checks). disable_plaintext_auth is also ignored for
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# these networks. Typically you'd specify your IMAP proxy servers here.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_trusted_networks =
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Space-separated list of elements we want to log. The elements which have
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# a non-empty variable value are joined together to form a comma-separated
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Login log format. %$ contains login_log_format_elements string, %s contains
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# the data we want to log.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#login_log_format = %$: %s
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen## Mailbox locations and namespaces
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Location for users' mailboxes. This is the same as the old default_mail_env
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# setting. The default is empty, which means that Dovecot tries to find the
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# mailboxes automatically. This won't work if the user doesn't have any mail
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# yet, so you should explicitly tell Dovecot the full location.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# isn't enough. You'll also need to tell Dovecot where the other mailboxes are
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# kept. This is called the "root mail directory", and it must be the first
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# path given in the mail_location setting.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# There are a few special variables you can use, eg.:
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# %u - username
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# %n - user part in user@domain, same as %u if there's no domain
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# %d - domain part in user@domain, empty if there's no domain
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# %h - home directory
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# See doc/wiki/Variables.txt for full list. Some examples:
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# mail_location = maildir:~/Maildir
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# mail_location = mbox:~/mail:INBOX=/var/mail/%u
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#mail_location =
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# If you need to set multiple mailbox locations or want to change default
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# namespace settings, you can do it by defining namespace sections.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# You can have private, shared and public namespaces. Private namespaces
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# are for user's personal mails. Shared namespaces are for accessing other
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# users' mailboxes that have been shared. Public namespaces are for shared
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# mailboxes that are managed by sysadmin. If you create any shared or public
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# namespaces you'll typically want to enable ACL plugin also, otherwise all
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# users can access all the shared mailboxes, assuming they have permissions
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# on filesystem level to do so.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# REMEMBER: If you add any namespaces, the default namespace must be added
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# explicitly, ie. mail_location does nothing unless you have a namespace
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# without a location setting. Default namespace is simply done by having a
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# namespace with empty prefix.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#namespace private {
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Hierarchy separator to use. You should use the same separator for all
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # namespaces or some clients get confused. '/' is usually a good one.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # The default however depends on the underlying mail storage format.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Prefix required to access this namespace. This needs to be different for
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # all namespaces. For example "Public/".
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Physical location of the mailbox. This is in same format as
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # mail_location, which is also the default for it.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # There can be only one INBOX, and this setting defines which namespace
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # If namespace is hidden, it's not advertised to clients via NAMESPACE
7e209b78ca757294dbbc15604c88673b3a6b0c39Timo Sirainen # extension. You'll most likely also want to set list=no. This is mostly
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # useful when converting from another server with different namespaces which
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # you want to deprecate but still keep working. For example you can create
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen #hidden = yes
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Show the mailboxes under this namespace with LIST command. This makes the
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # namespace visible for clients that don't support NAMESPACE extension.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # "children" value lists child mailboxes, but hides the namespace prefix.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Namespace handles its own subscriptions. If set to "no", the parent
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # namespace handles them (empty prefix should always have this as "yes")
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen #subscriptions = yes
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Example shared namespace configuration
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#namespace shared {
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen #separator = /
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Mailboxes are visible under "shared/user@domain/"
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # %%n, %%d and %%u are expanded to the destination user.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen #prefix = shared/%%u/
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Mail location for other users' mailboxes. Note that %variables and ~/
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # expands to the logged in user's data. %%n, %%d, %%u and %%h expand to the
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # destination user's data.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen #location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Use the default namespace for saving subscriptions.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen #subscriptions = no
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # List the shared/ namespace only if there are visible shared mailboxes.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen #list = children
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# System user and group used to access mails. If you use multiple, userdb
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# can override these by returning uid or gid fields. You can use either numbers
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Group to enable temporarily for privileged operations. Currently this is
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# used only with INBOX when either its initial creation or dotlocking fails.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Typically this is set to "mail" to give access to /var/mail.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#mail_privileged_group =
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Grant access to these supplementary groups for mail processes. Typically
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# these are used to set up access to shared mailboxes. Note that it may be
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# dangerous to set these if users can create symlinks (e.g. if "mail" group is
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# set here, ln -s /var/mail ~/mail/var could allow a user to delete others'
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it).
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_access_groups =
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Allow full filesystem access to clients. There's no access checks other than
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# what the operating system does for the active UID/GID. It works with both
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_full_filesystem_access = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen## Mail processes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Enable mail process debugging. This can help you figure out why Dovecot
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# isn't finding your mails.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_debug = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Log prefix for mail processes. See doc/wiki/Variables.txt for list of
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# possible variables you can use.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_log_prefix = "%Us(%u): "
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Max. number of lines a mail process is allowed to log per second before it's
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# throttled. 0 means unlimited. Typically there's no need to change this
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# unless you're using mail_log plugin, which may log a lot. This setting is
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# ignored while mail_debug=yes to avoid pointless throttling.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_log_max_lines_per_sec = 10
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Don't use mmap() at all. This is required if you store indexes to shared
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# filesystems (NFS or clustered filesystem).
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mmap_disable = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# since version 3, so this should be safe to use nowadays by default.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#dotlock_use_excl = yes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Don't use fsync() or fdatasync() calls. This makes the performance better
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# at the cost of potential data loss if the server (or the file server)
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#fsync_disable = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS caches
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# whenever needed. If you're using only a single mail server this isn't needed.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_nfs_storage = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Mail index files also exist in NFS. Setting this to yes requires
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# mmap_disable=yes and fsync_disable=no.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_nfs_index = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Locking method for index files. Alternatives are fcntl, flock and dotlock.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Dotlocking uses some tricks which may create more disk I/O than other locking
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# methods. NFS users: flock doesn't work, remember to change mmap_disable.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#lock_method = fcntl
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Drop all privileges before exec()ing the mail process. This is mostly
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# meant for debugging, otherwise you don't get core dumps. It could be a small
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# security risk if you use single UID for multiple users, as the users could
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# ptrace() each others processes then.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_drop_priv_before_exec = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Show more verbose process titles (in ps). Currently shows user name and
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# IP address. Useful for seeing who are actually using the IMAP processes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# (eg. shared mailboxes or if same uid is used for multiple accounts).
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#verbose_proctitle = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Valid UID range for users, defaults to 500 and above. This is mostly
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# to make sure that users can't log in as daemons or other system users.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Note that denying root logins is hardcoded to dovecot binary and can't
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# be done even if first_valid_uid is set to 0.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#first_valid_uid = 500
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#last_valid_uid = 0
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Valid GID range for users, defaults to non-root/wheel. Users having
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# non-valid GID as primary group ID aren't allowed to log in. If user
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# belongs to supplementary groups with non-valid GIDs, those groups are
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#first_valid_gid = 1
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#last_valid_gid = 0
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Maximum number of running mail processes. When this limit is reached,
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# new users aren't allowed to log in.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#max_mail_processes = 512
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Set max. process size in megabytes. Most of the memory goes to mmap()ing
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# files, so it shouldn't harm much even if this limit is set pretty high.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_process_size = 256
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Maximum allowed length for mail keyword name. It's only forced when trying
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# to create new keywords.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mail_max_keyword_length = 50
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# ':' separated list of directories under which chrooting is allowed for mail
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too).
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# This setting doesn't affect login_chroot, mail_chroot or auth chroot
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# WARNING: Never add directories here which local users can modify, that
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# may lead to root exploit. Usually this should be done only if you don't
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# allow shell access for users. <doc/wiki/Chrooting.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#valid_chroot_dirs =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Default chroot directory for mail processes. This can be overridden for
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# specific users in user database by giving /./ in user's home directory
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# (eg. /home/./user chroots into /home). Note that usually there is no real
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# need to do chrooting, Dovecot doesn't allow users to access files outside
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# their mail directory anyway. If your home directories are prefixed with
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# the chroot directory, append "/." to mail_chroot. <doc/wiki/Chrooting.txt>
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_chroot =
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen## Mailbox handling optimizations
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# The minimum number of mails in a mailbox before updates are done to cache
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# file. This allows optimizing Dovecot's behavior to do less disk writes at
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# the cost of more disk reads.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_cache_min_mail_count = 0
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# When IDLE command is running, mailbox is checked once in a while to see if
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# there are any new mails or other changes. This setting defines the minimum
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# time in seconds to wait between those checks. Dovecot can also use dnotify,
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# inotify and kqueue to find out immediately when changes occur.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#mailbox_idle_check_interval = 30
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Save mails with CR+LF instead of plain LF. This makes sending those mails
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# take less CPU, especially with sendfile() syscall with Linux and FreeBSD.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# But it also creates a bit more disk I/O which may just make it slower.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Also note that if other software reads the mboxes/maildirs, they may handle
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# the extra CRs wrong and cause problems.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#mail_save_crlf = no
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen## Maildir-specific settings
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# By default LIST command returns all entries in maildir beginning with a dot.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# Enabling this option makes Dovecot return only entries which are directories.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# This is done by stat()ing each entry, so it causes more disk I/O.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# (For systems setting struct dirent->d_type, this check is free and it's
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# done always regardless of this setting)
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen#maildir_stat_dirs = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# When copying a message, do it with hard links whenever possible. This makes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# the performance much better, and it's unlikely to have any side effects.
db0735f9b388c5bcfb781b1b25015e898d63d953Timo Sirainen#maildir_copy_with_hardlinks = yes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# When copying a message, try to preserve the base filename. Only if the
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# destination mailbox already contains the same name (ie. the mail is being
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# copied there twice), a new name is given. The destination filename check is
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# done only by looking at dovecot-uidlist file, so if something outside
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Dovecot does similar filename preserving copies, you may run into problems.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# NOTE: This setting requires maildir_copy_with_hardlinks = yes to work.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#maildir_copy_preserve_filename = no
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen## mbox-specific settings
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Which locking methods to use for locking mbox. There are four available:
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# dotlock: Create <mailbox>.lock file. This is the oldest and most NFS-safe
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# solution. If you want to use /var/mail/ like directory, the users
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# will need write access to that directory.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# dotlock_try: Same as dotlock, but if it fails because of permissions or
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# because there isn't enough disk space, just skip it.
db0735f9b388c5bcfb781b1b25015e898d63d953Timo Sirainen# fcntl : Use this if possible. Works with NFS too if lockd is used.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# flock : May not exist in all systems. Doesn't work with NFS.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# lockf : May not exist in all systems. Doesn't work with NFS.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen# You can use multiple locking methods; if you do the order they're declared
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# in is important to avoid deadlocks if other MTAs/MUAs are using multiple
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# locking methods as well. Some operating systems don't allow using some of
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# them simultaneously.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_read_locks = fcntl
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_write_locks = dotlock fcntl
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Maximum time in seconds to wait for lock (all of them) before aborting.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_lock_timeout = 300
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# If dotlock exists but the mailbox isn't modified in any way, override the
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# lock file after this many seconds.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_dotlock_change_timeout = 120
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# When mbox changes unexpectedly we have to fully read it to find out what
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# changed. If the mbox is large this can take a long time. Since the change
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# is usually just a newly appended mail, it'd be faster to simply read the
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# new mails. If this setting is enabled, Dovecot does this but still safely
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# fallbacks to re-reading the whole mbox file whenever something in mbox isn't
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# how it's expected to be. The only real downside to this setting is that if
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# some other MUA changes message flags, Dovecot doesn't notice it immediately.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_dirty_syncs = yes
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE,
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_very_dirty_syncs = no
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# commands and when closing the mailbox). This is especially useful for POP3
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# where clients often delete all mails. The downside is that our changes
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# aren't immediately visible to other MUAs.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_lazy_writes = yes
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# If mbox size is smaller than this (in kilobytes), don't write index files.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# If an index file already exists it's still read, just not updated.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#mbox_min_index_size = 0
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen## dbox-specific settings
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Maximum dbox file size in kilobytes until it's rotated.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#dbox_rotate_size = 2048
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Minimum dbox file size in kilobytes before it's rotated
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# (overrides dbox_rotate_days)
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#dbox_rotate_min_size = 16
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Maximum dbox file age in days until it's rotated. Day always begins from
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen# midnight, so 1 = today, 2 = yesterday, etc. 0 = check disabled.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#dbox_rotate_days = 0
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen## IMAP specific settings
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen #login_executable = /usr/libexec/dovecot/imap-login
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # IMAP executable location. Changing this allows you to execute other
a21823d90cee6a18aeab0378637472c7e3fbbab2Timo Sirainen # binaries before the imap process is executed.
a21823d90cee6a18aeab0378637472c7e3fbbab2Timo Sirainen # This would write rawlogs into ~/dovecot.rawlog/ directory:
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # mail_executable = /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap
a21823d90cee6a18aeab0378637472c7e3fbbab2Timo Sirainen # This would attach gdb into the imap process and write backtraces into
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap
a21823d90cee6a18aeab0378637472c7e3fbbab2Timo Sirainen # Maximum IMAP command line length in bytes. Some clients generate very long
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # command lines with huge mailboxes, so you may need to raise this if you get
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # "Too long argument" or "IMAP command line too large" errors often.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Maximum number of IMAP connections allowed for a user from each IP address.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # NOTE: The username is compared case-sensitively.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Support for dynamically loadable plugins. mail_plugins is a space separated
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # ID field names and values to send to clients. Using * as the value makes
a21823d90cee6a18aeab0378637472c7e3fbbab2Timo Sirainen # Dovecot use the default value. The following fields have default values
a21823d90cee6a18aeab0378637472c7e3fbbab2Timo Sirainen # currently: name, version, os, os-version, support-url, support-email.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # ID fields sent by client to log. * means everything.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Send EXISTS/RECENT new mail notifications only when replying to NOOP
d516e6848ecfbc7381abe9414fd8011fdf9d8c95Timo Sirainen # and CHECK commands. Some clients ignore them otherwise, for example OSX
a21823d90cee6a18aeab0378637472c7e3fbbab2Timo Sirainen # Mail (<v2.1). Outlook Express breaks more badly though, without this it
d516e6848ecfbc7381abe9414fd8011fdf9d8c95Timo Sirainen # may show user "Message no longer in server" errors. Note that OE6 still
d516e6848ecfbc7381abe9414fd8011fdf9d8c95Timo Sirainen # breaks even with this workaround if synchronization is set to
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Netscape 4.x breaks if message headers don't end with the empty "end of
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # headers" line. Normally all messages have this, but setting this
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # workaround makes sure that Netscape never breaks by adding the line if
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # it doesn't exist. This is done only for FETCH BODY[HEADER.FIELDS..]
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # commands. Note that RFC says this shouldn't be done.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # With mbox storage a mailbox can contain either mails or submailboxes,
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # but not both. Thunderbird separates these two by forcing server to
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # accept '/' suffix in mailbox names in subscriptions list.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen## POP3 specific settings
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen #login_executable = /usr/libexec/dovecot/pop3-login
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # POP3 executable location. See IMAP's mail_executable above for examples
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Don't try to set mails non-recent or seen with POP3 sessions. This is
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # mostly intended to reduce disk I/O. With maildir it doesn't move files
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # from new/ to cur/, with mbox it doesn't write Status-header.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Support LAST command which exists in old POP3 specs, but has been removed
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # from new ones. Some clients still wish to use this though. Enabling this
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # makes RSET command clear all \Seen flags from messages.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # If mail has X-UIDL header, use it as the mail's UIDL.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Keep the mailbox locked for the entire POP3 session.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # POP3 UIDL (unique mail identifier) format to use. You can use following
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # variables, along with the variable modifiers described in
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # doc/wiki/Variables.txt (e.g. %Uf for the filename in uppercase)
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # %m - MD5 sum of the mailbox headers in hex (mbox only)
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # If you want UIDL compatibility with other POP3 servers, use:
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Courier : %f or %v-%u (both might be used simultaneosly)
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Note that Outlook 2003 seems to have problems with %v.%u format which was
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Dovecot's default, so if you're building a new server it would be a good
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # idea to change this. %08Xu%08Xv should be pretty fail-safe.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # %p - number of bytes sent to client as a result of TOP command
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # %b - number of bytes sent to client as a result of RETR command
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # %s - mailbox size in bytes (before deletion)
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen #pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Maximum number of POP3 connections allowed for a user from each IP address.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # NOTE: The username is compared case-sensitively.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Support for dynamically loadable plugins. mail_plugins is a space separated
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Outlook and Outlook Express hang if mails contain NUL characters.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # This setting replaces them with 0x80 character.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Outlook Express and Netscape Mail breaks if end of headers-line is
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # missing. This option simply sends it if it's missing.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen## LDA specific settings
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Address to use when sending rejection mails.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Hostname to use in various parts of sent mails, eg. in Message-Id.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # Support for dynamically loadable plugins. mail_plugins is a space separated
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # If user is over quota, return with temporary failure instead of
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Format to use for logging mail deliveries. You can use variables:
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # %$ - Delivery status message (e.g. "saved to INBOX")
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Human readable error message for rejection mails. Use can use variables:
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # %n = CRLF, %r = reason, %s = subject, %t = recipient
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen #rejection_reason = Your message to <%t> was automatically rejected:%n%r
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # UNIX socket path to master authentication server to find users.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen #auth_socket_path = /var/run/dovecot/auth-master
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen## Authentication processes
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Executable location
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_executable = /usr/libexec/dovecot/dovecot-auth
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Set max. process size in megabytes.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_process_size = 256
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Authentication cache size in kilobytes. 0 means it's disabled.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Note that bsdauth, PAM and vpopmail require cache_key to be set for caching
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_cache_size = 0
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Time to live in seconds for cached data. After this many seconds the cached
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# record is no longer used, *except* if the main database lookup returns
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# internal failure. We also try to handle password changes automatically: If
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# user's previous authentication was successful, but this one wasn't, the
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# cache isn't used. For now this works only with plaintext authentication.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_cache_ttl = 3600
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# TTL for negative hits (user not found). 0 disables caching them completely.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_cache_negative_ttl = 3600
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Space separated list of realms for SASL authentication mechanisms that need
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# them. You can leave it empty if you don't want to support multiple realms.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Many clients simply use the first one listed here, so keep the default realm
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_realms =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Default realm/domain to use if none was specified. This is used for both
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# SASL realms and appending @domain to username in plaintext logins.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_default_realm =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# List of allowed characters in username. If the user-given username contains
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# a character not listed in here, the login automatically fails. This is just
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# an extra check to make sure user can't exploit any potential quote escaping
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# set this value to empty.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Username character translations before it's looked up from databases. The
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# value contains series of from -> to characters. For example "#@/@" means
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# that '#' and '/' characters are translated to '@'.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_username_translation =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Username formatting before it's looked up from databases. You can use
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# the standard variables here, eg. %Lu would lowercase the username, %n would
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# "-AT-". This translation is done after auth_username_translation changes.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_username_format =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# If you want to allow master users to log in by specifying the master
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# username within the normal username string (ie. not using SASL mechanism's
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# support for it), you can specify the separator character here. The format
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen# is then <username><separator><master username>. UW-IMAP uses "*" as the
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# separator, so that could be a good choice.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_master_user_separator =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Username to use for users logging in with ANONYMOUS SASL mechanism
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen#auth_anonymous_username = anonymous
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# More verbose logging. Useful for figuring out why authentication isn't
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_verbose = no
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Even more verbose logging for debugging purposes. Shows for example SQL
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_debug = no
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# In case of password mismatches, log the passwords and used scheme so the
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen# problem can be debugged. Enabling this also enables auth_debug.
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen#auth_debug_passwords = no
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen# Maximum number of dovecot-auth worker processes. They're used to execute
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# blocking passdb and userdb queries (eg. MySQL and PAM). They're
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# automatically created and destroyed as needed.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_worker_max_count = 30
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Number of auth requests to handle before destroying the process. This may
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# be useful if PAM plugins leak memory.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_worker_max_request_count = 0
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Host name to use in GSSAPI principal names. The default is to use the
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# name returned by gethostname(). Use "$ALL" to allow all keytab entries.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_gssapi_hostname =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Kerberos keytab to use for the GSSAPI mechanism. Will use the system
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# default (usually /etc/krb5.keytab) if not specified.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_krb5_keytab =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# ntlm_auth helper. <doc/wiki/Authentication/Mechanisms/Winbind.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_use_winbind = no
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Path for Samba's ntlm_auth helper binary.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth_winbind_helper_path = /usr/bin/ntlm_auth
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen# Number of seconds to delay before replying to failed authentications.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen#auth_failure_delay = 2
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Space separated list of wanted authentication mechanisms:
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # NOTE: See also disable_plaintext_auth setting.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Password database is used to verify user's password (and nothing more).
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # You can have multiple passdbs and userdbs. This is useful if you want to
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # allow both system users (/etc/passwd) and virtual users to login without
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # duplicating the system users into virtual database.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # By adding master=yes setting inside a passdb you make the passdb a list
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # of "master users", who can log in as anyone else. Unless you're using PAM,
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # you probably still want the destination user to be looked up from passdb
5b486fdbf2077a994337dc8bd4477ec51d5daf4eTimo Sirainen # that it really exists. This can be done by adding pass=yes setting to the
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # master passdb. <doc/wiki/Authentication.MasterUsers.txt>
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Users can be temporarily disabled by adding a passdb with deny=yes.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # If the user is found from that database, authentication will fail.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # The deny passdb should always be specified before others, so it gets
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # File contains a list of usernames, one per line
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # PAM authentication. Preferred nowadays by most systems.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Note that PAM can only be used to verify if user's password is correct,
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # so it can't be used as userdb. If you don't want to use a separate user
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # database (passwd usually), you can use static userdb.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # authentication to actually work. <doc/wiki/PasswordDatabase.PAM.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [session=yes] [setcred=yes] [failure_show_msg=yes]
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # session=yes makes Dovecot open and immediately close PAM session. Some
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # PAM plugins need this to work, such as pam_mkhomedir.
3c097377e865689723c8737537886b01a5ebd3d9Timo Sirainen # setcred=yes makes Dovecot establish PAM credentials if some PAM plugins
3c097377e865689723c8737537886b01a5ebd3d9Timo Sirainen # need that. They aren't ever deleted though, so this isn't enabled by
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # cache_key can be used to enable authentication caching for PAM
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # (auth_cache_size also needs to be set). It isn't enabled by default
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # because PAM modules can do all kinds of checks besides checking password,
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # such as checking IP address. Dovecot can't know about these checks
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # without some help. cache_key is simply a list of variables (see
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # doc/wiki/Variables.txt) which must match for the cached data to be used.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # %u - Username must match. Probably sufficient for most uses.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # %u%r - Username and remote IP address must match.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # %u%s - Username and service (ie. IMAP, POP3) must match.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # The service name can contain variables, for example %Ls expands to
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # System users (NSS, /etc/passwd, or similiar)
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # In many systems nowadays this uses Name Service Switch, which is
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # configured in /etc/nsswitch.conf. <doc/wiki/AuthDatabase.Passwd.txt>
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # [blocking=yes] - See userdb passwd for explanation
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Shadow passwords for system users (NSS, /etc/shadow or similiar).
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [blocking=yes] - See userdb passwd for explanation
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [cache_key=<key>] - See cache_key in PAM for explanation.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [scheme=<default password scheme>] [username_format=<format>]
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # NOTE: You will probably want to use "userdb prefetch" with this.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # SQL database <doc/wiki/AuthDatabase.SQL.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Path for SQL configuration file, see doc/dovecot-sql-example.conf
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # vpopmail authentication <doc/wiki/AuthDatabase.VPopMail.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [cache_key=<key>] - See cache_key in PAM for explanation.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [quota_template=<template>] - %q expands to Maildir++ quota
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # (eg. quota_template=quota_rule=*:backend=%q)
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # User database specifies where mails are located and what user/group IDs
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # own them. For single-UID configuration use "static".
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # System users (NSS, /etc/passwd, or similiar). In many systems nowadays this
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # uses Name Service Switch, which is configured in /etc/nsswitch.conf.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [blocking=yes] - By default the lookups are done in the main dovecot-auth
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # process. This setting causes the lookups to be done in auth worker
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # proceses. Useful with remote NSS lookups that may block.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # NOTE: Be sure to use this setting with nss_ldap or users might get
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # [username_format=<format>] <Path for passwd-file>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # checkpassword executable user database lookup
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen # static settings generated from template <doc/wiki/UserDatabase.Static.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Template for the fields. Can return anything a userdb could normally
2b9fd042e701cfe7d79c4294a5ab401d6ec9ce18Timo Sirainen # If you use deliver, it needs to look up users only from the userdb. This
2b9fd042e701cfe7d79c4294a5ab401d6ec9ce18Timo Sirainen # of course doesn't work with static because there is no list of users.
2b9fd042e701cfe7d79c4294a5ab401d6ec9ce18Timo Sirainen # Normally static userdb handles this by doing a passdb lookup. This works
2b9fd042e701cfe7d79c4294a5ab401d6ec9ce18Timo Sirainen # with most passdbs, with PAM being the most notable exception. If you do
2b9fd042e701cfe7d79c4294a5ab401d6ec9ce18Timo Sirainen # the user verification another way, you can add allow_all_users=yes to
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # the args in which case the passdb lookup is skipped.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # SQL database <doc/wiki/AuthDatabase.SQL.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Path for SQL configuration file, see doc/dovecot-sql-example.conf
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # vpopmail <doc/wiki/AuthDatabase.VPopMail.txt>
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # "prefetch" user database means that the passdb already provided the
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # needed information and there's no need to do a separate userdb lookup.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # This can be made to work with SQL and LDAP databases, see their example
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # configuration files for more information how to do it.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # User to use for the process. This user needs access to only user and
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # password databases, nothing else. Only shadow and pam authentication
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # requires roots, so use something else if possible. Note that passwd
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # authentication with BSDs internally accesses shadow files, which also
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # requires roots. Note that this user is NOT used to access mails.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Directory where to chroot the process. Most authentication backends don't
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # work if this is set, and there's no point chrooting if auth_user is root.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Note that valid_chroot_dirs isn't needed to use this setting.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Number of authentication processes to create
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Require a valid SSL client certificate or the authentication fails.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Take the username from client's SSL certificate, using
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # X509_NAME_get_text_by_NID() which returns the subject's DN's
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # It's possible to export the authentication interface to other programs:
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Master socket provides access to userdb information. It's typically
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # used to give Dovecot's local delivery agent access to userdb so it
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Default user/group is the one who started dovecot-auth (root)
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # The client socket is generally safe to export to everyone. Typical use
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # is to export it to your SMTP server so it can do SMTP AUTH lookups
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# If you wish to use another authentication server than dovecot-auth, you can
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# use connect sockets. They are assumed to be already running, Dovecot's master
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# process only tries to connect to them. They don't need any other settings
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# than the path for the master socket, as the configuration is done elsewhere.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Note that the client sockets must exist in the login_dir.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#auth external {
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# socket connect {
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen## Dictionary server settings
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Dictionary can be used by some plugins to store key=value lists.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Currently this is only used by dict quota backend. The dictionary can be
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# used either directly or though a dictionary server. The following dict block
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# maps dictionary names to URIs when the server is used. These can then be
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# referenced using URIs in format "proxy::<name>".
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen# Path to Berkeley DB's configuration file. See doc/dovecot-db-example.conf
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen#dict_db_config =
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen## Plugin settings
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Here you can give some extra environment variables to mail processes.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # This is mostly meant for passing parameters to plugins. %variable
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Quota plugin. Multiple backends are supported:
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # dirsize: Find and sum all the files found from mail directory.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # Extremely SLOW with Maildir. It'll eat your CPU and disk I/O.
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen # dict: Keep quota stored in dictionary (eg. SQL)
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # Quota limits are set using "quota_rule" parameters, either in here or in
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # userdb. It's also possible to give mailbox-specific limits, for example:
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # User has now 1GB quota, but when saving to Trash mailbox the user gets
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Multiple quota roots are also possible, for example:
942302b0247403645394d848b3c620ead262a2a5Timo Sirainen # Gives each user their own 100MB quota and one shared 1GB quota within
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # You can execute a given command when user exceeds a specified quota limit.
942302b0247403645394d848b3c620ead262a2a5Timo Sirainen # Each quota root has separate limits. Only the command for the first
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # exceeded limit is excecuted, so put the highest limit first.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Note that % needs to be escaped as %%, otherwise "% " expands to empty.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # ACL plugin. vfile backend reads ACLs from "dovecot-acl" file from maildir
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # directory. You can also optionally give a global ACL directory path where
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # ACLs are applied to all users' mailboxes. The global ACL directory contains
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # specifies how many seconds to wait between stat()ing dovecot-acl file
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # To let users LIST mailboxes shared by other users, Dovecot needs a
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen #acl_dict = file:/var/lib/dovecot/shared-mailboxes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Convert plugin. If set, specifies the source storage path which is
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # converted to destination storage (mail_location) when the user logs in.
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen # The existing mail directory is renamed to <dir>-converted.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Skip mailboxes which we can't open successfully instead of aborting.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # If source storage has mailbox names with destination storage's hierarchy
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # separators, replace them with this character.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Trash plugin. When saving a message would make user go over quota, this
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # plugin automatically deletes the oldest mails from configured mailboxes
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # until the message can be saved within quota limits. The configuration file
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # is a text file where each line is in format: <priority> <mailbox name>
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Mails are first deleted in lowest -> highest priority number order
942302b0247403645394d848b3c620ead262a2a5Timo Sirainen # Expire plugin. Mails are expunged from mailboxes after being there the
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # configurable time. The first expiration date for each mailbox is stored in
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # a dictionary so it can be quickly determined which mailboxes contain
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # expired mails. The actual expunging is done in a nightly cronjob, which
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Lazy expunge plugin. Currently works only with maildirs. When a user
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # expunges mails, the mails are moved to a mailbox in another namespace
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # (1st). When a mailbox is deleted, the mailbox is moved to another namespace
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # (2nd) as well. Also if the deleted mailbox had any expunged messages,
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # they're moved to a 3rd namespace. The mails won't be counted in quota,
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # and they're not deleted automatically (use a cronjob or something).
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen #lazy_expunge = .EXPUNGED/ .DELETED/ .DELETED/.EXPUNGED/
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen #mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Group events within a transaction to one line.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # Available fields: uid, box, msgid, from, subject, size, vsize, flags
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen # size and vsize are available only for expunge and copy events.