· 9 years ago · Oct 25, 2016, 06:50 AM
1/etc/dovecot/dovecot.conf
2## Dovecot configuration file
3
4# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration
5
6# "doveconf -n" command gives a clean output of the changed settings. Use it
7# instead of copy&pasting files when posting to the Dovecot mailing list.
8
9# '#' character and everything after it is treated as comments. Extra spaces
10# and tabs are ignored. If you want to use either of these explicitly, put the
11# value inside quotes, eg.: key = "# char and trailing whitespace "
12
13# Most (but not all) settings can be overridden by different protocols and/or
14# source/destination IPs by placing the settings inside sections, for example:
15# protocol imap { }, local 127.0.0.1 { }, remote 10.0.0.0/8 { }
16
17# Default values are shown for each setting, it's not required to uncomment
18# those. These are exceptions to this though: No sections (e.g. namespace {})
19# or plugin settings are added by default, they're listed only as examples.
20# Paths are also just examples with the real defaults being based on configure
21# options. The paths listed here are for configure --prefix=/usr
22# --sysconfdir=/etc --localstatedir=/var
23
24namespace inbox {
25inbox = yes
26}
27
28# Enable installed protocols
29!include_try /usr/share/dovecot/protocols.d/*.protocol
30protocols = imap pop3 lmtp
31
32# A comma separated list of IPs or hosts where to listen in for connections.
33# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
34# If you want to specify non-default ports or anything more complex,
35# edit conf.d/master.conf.
36listen = *
37
38# Base directory where to store runtime data.
39base_dir = /var/run/dovecot/
40
41# Name of this instance. In multi-instance setup doveadm and other commands
42# can use -i <instance_name> to select which instance is used (an alternative
43# to -c <config_path>). The instance name is also added to Dovecot processes
44# in ps output.
45#instance_name = dovecot
46
47# Greeting message for clients.
48#login_greeting = Dovecot ready.
49
50# Space separated list of trusted network ranges. Connections from these
51# IPs are allowed to override their IP addresses and ports (for logging and
52# for authentication checks). disable_plaintext_auth is also ignored for
53# these networks. Typically you'd specify your IMAP proxy servers here.
54#login_trusted_networks =
55
56# Space separated list of login access check sockets (e.g. tcpwrap)
57#login_access_sockets =
58
59# With proxy_maybe=yes if proxy destination matches any of these IPs, don't do
60# proxying. This isn't necessary normally, but may be useful if the destination
61# IP is e.g. a load balancer's IP.
62#auth_proxy_self =
63
64# Show more verbose process titles (in ps). Currently shows user name and
65# IP address. Useful for seeing who are actually using the IMAP processes
66# (eg. shared mailboxes or if same uid is used for multiple accounts).
67#verbose_proctitle = no
68
69# Should all processes be killed when Dovecot master process shuts down.
70# Setting this to "no" means that Dovecot can be upgraded without
71# forcing existing client connections to close (although that could also be
72# a problem if the upgrade is e.g. because of a security fix).
73#shutdown_clients = yes
74
75# If non-zero, run mail commands via this many connections to doveadm server,
76# instead of running them directly in the same process.
77#doveadm_worker_count = 0
78# UNIX socket or host:port used for connecting to doveadm server
79#doveadm_socket_path = doveadm-server
80
81# Space separated list of environment variables that are preserved on Dovecot
82# startup and passed down to all of its child processes. You can also give
83# key=value pairs to always set specific settings.
84#import_environment = TZ
85
86##
87## Dictionary server settings
88##
89
90# Dictionary can be used to store key=value lists. This is used by several
91# plugins. The dictionary can be accessed either directly or though a
92# dictionary server. The following dict block maps dictionary names to URIs
93# when the server is used. These can then be referenced using URIs in format
94# "proxy::<name>".
95
96dict {
97 #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
98 #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
99}
100
101# Most of the actual configuration gets included below. The filenames are
102# first sorted by their ASCII value and parsed in that order. The 00-prefixes
103# in filenames are intended to make it easier to understand the ordering.
104!include conf.d/*.conf
105
106# A config file can also tried to be included without giving an error if
107# it's not found:
108!include_try local.conf
109
110
111/etc/dovecot/dovecot-sql.conf.ext
112# This file is opened as root, so it should be owned by root and mode 0600.
113#
114# http://wiki2.dovecot.org/AuthDatabase/SQL
115#
116# For the sql passdb module, you'll need a database with a table that
117# contains fields for at least the username and password. If you want to
118# use the user@domain syntax, you might want to have a separate domain
119# field as well.
120#
121# If your users all have the same uig/gid, and have predictable home
122# directories, you can use the static userdb module to generate the home
123# dir based on the username and domain. In this case, you won't need fields
124# for home, uid, or gid in the database.
125#
126# If you prefer to use the sql userdb module, you'll want to add fields
127# for home, uid, and gid. Here is an example table:
128#
129# CREATE TABLE users (
130# username VARCHAR(128) NOT NULL,
131# domain VARCHAR(128) NOT NULL,
132# password VARCHAR(64) NOT NULL,
133# home VARCHAR(255) NOT NULL,
134# uid INTEGER NOT NULL,
135# gid INTEGER NOT NULL,
136# active CHAR(1) DEFAULT 'Y' NOT NULL
137# );
138
139# Database driver: mysql, pgsql, sqlite
140driver = mysql
141
142# Database connection string. This is driver-specific setting.
143#
144# HA / round-robin load-balancing is supported by giving multiple host
145# settings, like: host=sql1.host.org host=sql2.host.org
146#
147# pgsql:
148# For available options, see the PostgreSQL documention for the
149# PQconnectdb function of libpq.
150# Use maxconns=n (default 5) to change how many connections Dovecot can
151# create to pgsql.
152#
153# mysql:
154# Basic options emulate PostgreSQL option names:
155# host, port, user, password, dbname
156#
157# But also adds some new settings:
158# client_flags - See MySQL manual
159# ssl_ca, ssl_ca_path - Set either one or both to enable SSL
160# ssl_cert, ssl_key - For sending client-side certificates to server
161# ssl_cipher - Set minimum allowed cipher security (default: HIGH)
162# option_file - Read options from the given file instead of
163# the default my.cnf location
164# option_group - Read options from the given group (default: client)
165#
166# You can connect to UNIX sockets by using host: host=/var/run/mysql.sock
167# Note that currently you can't use spaces in parameters.
168#
169# sqlite:
170# The path to the database file.
171#
172# Examples:
173# connect = host=192.168.1.1 dbname=users
174# connect = host=sql.example.com dbname=virtual user=virtual password=blarg
175# connect = /etc/dovecot/authdb.sqlite
176#
177connect = host=127.0.0.1 dbname=mailserver user=mailuser password=otsswordfish64
178
179# Default password scheme.
180#
181# List of supported schemes is in
182# http://wiki2.dovecot.org/Authentication/PasswordSchemes
183#
184default_pass_scheme = SHA512-CRYPT
185
186# passdb query to retrieve the password. It can return fields:
187# password - The user's password. This field must be returned.
188# user - user@domain from the database. Needed with case-insensitive lookups.
189# username and domain - An alternative way to represent the "user" field.
190#
191# The "user" field is often necessary with case-insensitive lookups to avoid
192# e.g. "name" and "nAme" logins creating two different mail directories. If
193# your user and domain names are in separate fields, you can return "username"
194# and "domain" fields instead of "user".
195#
196# The query can also return other fields which have a special meaning, see
197# http://wiki2.dovecot.org/PasswordDatabase/ExtraFields
198#
199# Commonly used available substitutions (see http://wiki2.dovecot.org/Variables
200# for full list):
201# %u = entire user@domain
202# %n = user part of user@domain
203# %d = domain part of user@domain
204#
205# Note that these can be used only as input to SQL query. If the query outputs
206# any of these substitutions, they're not touched. Otherwise it would be
207# difficult to have eg. usernames containing '%' characters.
208#
209# Example:
210# password_query = SELECT userid AS user, pw AS password \
211# FROM users WHERE userid = '%u' AND active = 'Y'
212#
213#password_query = \
214# SELECT username, domain, password \
215# FROM users WHERE username = '%n' AND domain = '%d'
216password_query = SELECT email as user, password FROM virtual_users WHERE email='%u';
217
218# userdb query to retrieve the user information. It can return fields:
219# uid - System UID (overrides mail_uid setting)
220# gid - System GID (overrides mail_gid setting)
221# home - Home directory
222# mail - Mail location (overrides mail_location setting)
223#
224# None of these are strictly required. If you use a single UID and GID, and
225# home or mail directory fits to a template string, you could use userdb static
226# instead. For a list of all fields that can be returned, see
227# http://wiki2.dovecot.org/UserDatabase/ExtraFields
228#
229# Examples:
230# user_query = SELECT home, uid, gid FROM users WHERE userid = '%u'
231# user_query = SELECT dir AS home, user AS uid, group AS gid FROM users where userid = '%u'
232# user_query = SELECT home, 501 AS uid, 501 AS gid FROM users WHERE userid = '%u'
233#
234#user_query = \
235# SELECT home, uid, gid \
236# FROM users WHERE username = '%n' AND domain = '%d'
237
238# If you wish to avoid two SQL lookups (passdb + userdb), you can use
239# userdb prefetch instead of userdb sql in dovecot.conf. In that case you'll
240# also have to return userdb fields in password_query prefixed with "userdb_"
241# string. For example:
242#password_query = \
243# SELECT userid AS user, password, \
244# home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
245# FROM users WHERE userid = '%u'
246
247# Query to get a list of all usernames.
248#iterate_query = SELECT username AS user FROM users
249
250
251/etc/dovecot/conf.d/10-auth.conf
252##
253## Authentication processes
254##
255
256# Disable LOGIN command and all other plaintext authentications unless
257# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
258# matches the local IP (ie. you're connecting from the same computer), the
259# connection is considered secure and plaintext authentication is allowed.
260disable_plaintext_auth = yes
261
262# Authentication cache size (e.g. 10M). 0 means it's disabled. Note that
263# bsdauth, PAM and vpopmail require cache_key to be set for caching to be used.
264#auth_cache_size = 0
265# Time to live for cached data. After TTL expires the cached record is no
266# longer used, *except* if the main database lookup returns internal failure.
267# We also try to handle password changes automatically: If user's previous
268# authentication was successful, but this one wasn't, the cache isn't used.
269# For now this works only with plaintext authentication.
270#auth_cache_ttl = 1 hour
271# TTL for negative hits (user not found, password mismatch).
272# 0 disables caching them completely.
273#auth_cache_negative_ttl = 1 hour
274
275# Space separated list of realms for SASL authentication mechanisms that need
276# them. You can leave it empty if you don't want to support multiple realms.
277# Many clients simply use the first one listed here, so keep the default realm
278# first.
279#auth_realms =
280
281# Default realm/domain to use if none was specified. This is used for both
282# SASL realms and appending @domain to username in plaintext logins.
283#auth_default_realm =
284
285# List of allowed characters in username. If the user-given username contains
286# a character not listed in here, the login automatically fails. This is just
287# an extra check to make sure user can't exploit any potential quote escaping
288# vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
289# set this value to empty.
290#auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
291
292# Username character translations before it's looked up from databases. The
293# value contains series of from -> to characters. For example "#@/@" means
294# that '#' and '/' characters are translated to '@'.
295#auth_username_translation =
296
297# Username formatting before it's looked up from databases. You can use
298# the standard variables here, eg. %Lu would lowercase the username, %n would
299# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
300# "-AT-". This translation is done after auth_username_translation changes.
301#auth_username_format =
302
303# If you want to allow master users to log in by specifying the master
304# username within the normal username string (ie. not using SASL mechanism's
305# support for it), you can specify the separator character here. The format
306# is then <username><separator><master username>. UW-IMAP uses "*" as the
307# separator, so that could be a good choice.
308#auth_master_user_separator =
309
310# Username to use for users logging in with ANONYMOUS SASL mechanism
311#auth_anonymous_username = anonymous
312
313# Maximum number of dovecot-auth worker processes. They're used to execute
314# blocking passdb and userdb queries (eg. MySQL and PAM). They're
315# automatically created and destroyed as needed.
316#auth_worker_max_count = 30
317
318# Host name to use in GSSAPI principal names. The default is to use the
319# name returned by gethostname(). Use "$ALL" (with quotes) to allow all keytab
320# entries.
321#auth_gssapi_hostname =
322
323# Kerberos keytab to use for the GSSAPI mechanism. Will use the system
324# default (usually /etc/krb5.keytab) if not specified. You may need to change
325# the auth service to run as root to be able to read this file.
326#auth_krb5_keytab =
327
328# Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and
329# ntlm_auth helper. <doc/wiki/Authentication/Mechanisms/Winbind.txt>
330#auth_use_winbind = no
331
332# Path for Samba's ntlm_auth helper binary.
333#auth_winbind_helper_path = /usr/bin/ntlm_auth
334
335# Time to delay before replying to failed authentications.
336#auth_failure_delay = 2 secs
337
338# Require a valid SSL client certificate or the authentication fails.
339#auth_ssl_require_client_cert = no
340
341# Take the username from client's SSL certificate, using
342# X509_NAME_get_text_by_NID() which returns the subject's DN's
343# CommonName.
344#auth_ssl_username_from_cert = no
345
346# Space separated list of wanted authentication mechanisms:
347# plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
348# gss-spnego
349# NOTE: See also disable_plaintext_auth setting.
350auth_mechanisms = plain login
351
352##
353## Password and user databases
354##
355
356#
357# Password database is used to verify user's password (and nothing more).
358# You can have multiple passdbs and userdbs. This is useful if you want to
359# allow both system users (/etc/passwd) and virtual users to login without
360# duplicating the system users into virtual database.
361#
362# <doc/wiki/PasswordDatabase.txt>
363#
364# User database specifies where mails are located and what user/group IDs
365# own them. For single-UID configuration use "static" userdb.
366#
367# <doc/wiki/UserDatabase.txt>
368
369#!include auth-deny.conf.ext
370#!include auth-master.conf.ext
371
372#!include auth-system.conf.ext
373!include auth-sql.conf.ext
374#!include auth-ldap.conf.ext
375#!include auth-passwdfile.conf.ext
376#!include auth-checkpassword.conf.ext
377#!include auth-vpopmail.conf.ext
378#!include auth-static.conf.ext
379
380
381/etc/dovecot/conf.d/10-mail.conf
382##
383## Mailbox locations and namespaces
384##
385
386# Location for users' mailboxes. The default is empty, which means that Dovecot
387# tries to find the mailboxes automatically. This won't work if the user
388# doesn't yet have any mail, so you should explicitly tell Dovecot the full
389# location.
390#
391# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
392# isn't enough. You'll also need to tell Dovecot where the other mailboxes are
393# kept. This is called the "root mail directory", and it must be the first
394# path given in the mail_location setting.
395#
396# There are a few special variables you can use, eg.:
397#
398# %u - username
399# %n - user part in user@domain, same as %u if there's no domain
400# %d - domain part in user@domain, empty if there's no domain
401# %h - home directory
402#
403# See doc/wiki/Variables.txt for full list. Some examples:
404#
405# mail_location = maildir:~/Maildir
406# mail_location = mbox:~/mail:INBOX=/var/mail/%u
407# mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
408#
409# <doc/wiki/MailLocation.txt>
410#
411mail_location = maildir:/var/mail/vhosts/%d/%n
412
413# If you need to set multiple mailbox locations or want to change default
414# namespace settings, you can do it by defining namespace sections.
415#
416# You can have private, shared and public namespaces. Private namespaces
417# are for user's personal mails. Shared namespaces are for accessing other
418# users' mailboxes that have been shared. Public namespaces are for shared
419# mailboxes that are managed by sysadmin. If you create any shared or public
420# namespaces you'll typically want to enable ACL plugin also, otherwise all
421# users can access all the shared mailboxes, assuming they have permissions
422# on filesystem level to do so.
423#
424# REMEMBER: If you add any namespaces, the default namespace must be added
425# explicitly, ie. mail_location does nothing unless you have a namespace
426# without a location setting. Default namespace is simply done by having a
427# namespace with empty prefix.
428#namespace {
429 # Namespace type: private, shared or public
430 #type = private
431
432 # Hierarchy separator to use. You should use the same separator for all
433 # namespaces or some clients get confused. '/' is usually a good one.
434 # The default however depends on the underlying mail storage format.
435 #separator =
436
437 # Prefix required to access this namespace. This needs to be different for
438 # all namespaces. For example "Public/".
439 #prefix =
440
441 # Physical location of the mailbox. This is in same format as
442 # mail_location, which is also the default for it.
443 #location =
444
445 # There can be only one INBOX, and this setting defines which namespace
446 # has it.
447 #inbox = no
448
449 # If namespace is hidden, it's not advertised to clients via NAMESPACE
450 # extension. You'll most likely also want to set list=no. This is mostly
451 # useful when converting from another server with different namespaces which
452 # you want to deprecate but still keep working. For example you can create
453 # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
454 #hidden = no
455
456 # Show the mailboxes under this namespace with LIST command. This makes the
457 # namespace visible for clients that don't support NAMESPACE extension.
458 # "children" value lists child mailboxes, but hides the namespace prefix.
459 #list = yes
460
461 # Namespace handles its own subscriptions. If set to "no", the parent
462 # namespace handles them (empty prefix should always have this as "yes")
463 #subscriptions = yes
464#}
465
466# Example shared namespace configuration
467#namespace {
468 #type = shared
469 #separator = /
470
471 # Mailboxes are visible under "shared/user@domain/"
472 # %%n, %%d and %%u are expanded to the destination user.
473 #prefix = shared/%%u/
474
475 # Mail location for other users' mailboxes. Note that %variables and ~/
476 # expands to the logged in user's data. %%n, %%d, %%u and %%h expand to the
477 # destination user's data.
478 #location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
479
480 # Use the default namespace for saving subscriptions.
481 #subscriptions = no
482
483 # List the shared/ namespace only if there are visible shared mailboxes.
484 #list = children
485#}
486
487# System user and group used to access mails. If you use multiple, userdb
488# can override these by returning uid or gid fields. You can use either numbers
489# or names. <doc/wiki/UserIds.txt>
490#mail_uid =
491#mail_gid =
492
493# Group to enable temporarily for privileged operations. Currently this is
494# used only with INBOX when either its initial creation or dotlocking fails.
495# Typically this is set to "mail" to give access to /var/mail.
496mail_privileged_group = mail
497
498# Grant access to these supplementary groups for mail processes. Typically
499# these are used to set up access to shared mailboxes. Note that it may be
500# dangerous to set these if users can create symlinks (e.g. if "mail" group is
501# set here, ln -s /var/mail ~/mail/var could allow a user to delete others'
502# mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it).
503#mail_access_groups =
504
505# Allow full filesystem access to clients. There's no access checks other than
506# what the operating system does for the active UID/GID. It works with both
507# maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/
508# or ~user/.
509#mail_full_filesystem_access = no
510
511##
512## Mail processes
513##
514
515# Don't use mmap() at all. This is required if you store indexes to shared
516# filesystems (NFS or clustered filesystem).
517#mmap_disable = no
518
519# Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
520# since version 3, so this should be safe to use nowadays by default.
521#dotlock_use_excl = yes
522
523# When to use fsync() or fdatasync() calls:
524# optimized (default): Whenever necessary to avoid losing important data
525# always: Useful with e.g. NFS when write()s are delayed
526# never: Never use it (best performance, but crashes can lose data)
527#mail_fsync = optimized
528
529# Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS caches
530# whenever needed. If you're using only a single mail server this isn't needed.
531#mail_nfs_storage = no
532# Mail index files also exist in NFS. Setting this to yes requires
533# mmap_disable=yes and fsync_disable=no.
534#mail_nfs_index = no
535
536# Locking method for index files. Alternatives are fcntl, flock and dotlock.
537# Dotlocking uses some tricks which may create more disk I/O than other locking
538# methods. NFS users: flock doesn't work, remember to change mmap_disable.
539#lock_method = fcntl
540
541# Directory in which LDA/LMTP temporarily stores incoming mails >128 kB.
542#mail_temp_dir = /tmp
543
544# Valid UID range for users, defaults to 500 and above. This is mostly
545# to make sure that users can't log in as daemons or other system users.
546# Note that denying root logins is hardcoded to dovecot binary and can't
547# be done even if first_valid_uid is set to 0.
548#first_valid_uid = 500
549#last_valid_uid = 0
550
551# Valid GID range for users, defaults to non-root/wheel. Users having
552# non-valid GID as primary group ID aren't allowed to log in. If user
553# belongs to supplementary groups with non-valid GIDs, those groups are
554# not set.
555#first_valid_gid = 1
556#last_valid_gid = 0
557
558# Maximum allowed length for mail keyword name. It's only forced when trying
559# to create new keywords.
560#mail_max_keyword_length = 50
561
562# ':' separated list of directories under which chrooting is allowed for mail
563# processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too).
564# This setting doesn't affect login_chroot, mail_chroot or auth chroot
565# settings. If this setting is empty, "/./" in home dirs are ignored.
566# WARNING: Never add directories here which local users can modify, that
567# may lead to root exploit. Usually this should be done only if you don't
568# allow shell access for users. <doc/wiki/Chrooting.txt>
569#valid_chroot_dirs =
570
571# Default chroot directory for mail processes. This can be overridden for
572# specific users in user database by giving /./ in user's home directory
573# (eg. /home/./user chroots into /home). Note that usually there is no real
574# need to do chrooting, Dovecot doesn't allow users to access files outside
575# their mail directory anyway. If your home directories are prefixed with
576# the chroot directory, append "/." to mail_chroot. <doc/wiki/Chrooting.txt>
577#mail_chroot =
578
579# UNIX socket path to master authentication server to find users.
580# This is used by imap (for shared users) and lda.
581#auth_socket_path = /var/run/dovecot/auth-userdb
582
583# Directory where to look up mail plugins.
584#mail_plugin_dir = /usr/lib/dovecot/modules
585
586# Space separated list of plugins to load for all services. Plugins specific to
587# IMAP, LDA, etc. are added to this list in their own .conf files.
588#mail_plugins =
589
590##
591## Mailbox handling optimizations
592##
593
594# The minimum number of mails in a mailbox before updates are done to cache
595# file. This allows optimizing Dovecot's behavior to do less disk writes at
596# the cost of more disk reads.
597#mail_cache_min_mail_count = 0
598
599# When IDLE command is running, mailbox is checked once in a while to see if
600# there are any new mails or other changes. This setting defines the minimum
601# time to wait between those checks. Dovecot can also use dnotify, inotify and
602# kqueue to find out immediately when changes occur.
603#mailbox_idle_check_interval = 30 secs
604
605# Save mails with CR+LF instead of plain LF. This makes sending those mails
606# take less CPU, especially with sendfile() syscall with Linux and FreeBSD.
607# But it also creates a bit more disk I/O which may just make it slower.
608# Also note that if other software reads the mboxes/maildirs, they may handle
609# the extra CRs wrong and cause problems.
610#mail_save_crlf = no
611
612##
613## Maildir-specific settings
614##
615
616# By default LIST command returns all entries in maildir beginning with a dot.
617# Enabling this option makes Dovecot return only entries which are directories.
618# This is done by stat()ing each entry, so it causes more disk I/O.
619# (For systems setting struct dirent->d_type, this check is free and it's
620# done always regardless of this setting)
621#maildir_stat_dirs = no
622
623# When copying a message, do it with hard links whenever possible. This makes
624# the performance much better, and it's unlikely to have any side effects.
625#maildir_copy_with_hardlinks = yes
626
627# Assume Dovecot is the only MUA accessing Maildir: Scan cur/ directory only
628# when its mtime changes unexpectedly or when we can't find the mail otherwise.
629#maildir_very_dirty_syncs = no
630
631##
632## mbox-specific settings
633##
634
635# Which locking methods to use for locking mbox. There are four available:
636# dotlock: Create <mailbox>.lock file. This is the oldest and most NFS-safe
637# solution. If you want to use /var/mail/ like directory, the users
638# will need write access to that directory.
639# dotlock_try: Same as dotlock, but if it fails because of permissions or
640# because there isn't enough disk space, just skip it.
641# fcntl : Use this if possible. Works with NFS too if lockd is used.
642# flock : May not exist in all systems. Doesn't work with NFS.
643# lockf : May not exist in all systems. Doesn't work with NFS.
644#
645# You can use multiple locking methods; if you do the order they're declared
646# in is important to avoid deadlocks if other MTAs/MUAs are using multiple
647# locking methods as well. Some operating systems don't allow using some of
648# them simultaneously.
649#mbox_read_locks = fcntl
650#mbox_write_locks = dotlock fcntl
651
652# Maximum time to wait for lock (all of them) before aborting.
653#mbox_lock_timeout = 5 mins
654
655# If dotlock exists but the mailbox isn't modified in any way, override the
656# lock file after this much time.
657#mbox_dotlock_change_timeout = 2 mins
658
659# When mbox changes unexpectedly we have to fully read it to find out what
660# changed. If the mbox is large this can take a long time. Since the change
661# is usually just a newly appended mail, it'd be faster to simply read the
662# new mails. If this setting is enabled, Dovecot does this but still safely
663# fallbacks to re-reading the whole mbox file whenever something in mbox isn't
664# how it's expected to be. The only real downside to this setting is that if
665# some other MUA changes message flags, Dovecot doesn't notice it immediately.
666# Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK
667# commands.
668#mbox_dirty_syncs = yes
669
670# Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE,
671# EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored.
672#mbox_very_dirty_syncs = no
673
674# Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK
675# commands and when closing the mailbox). This is especially useful for POP3
676# where clients often delete all mails. The downside is that our changes
677# aren't immediately visible to other MUAs.
678#mbox_lazy_writes = yes
679
680# If mbox size is smaller than this (e.g. 100k), don't write index files.
681# If an index file already exists it's still read, just not updated.
682#mbox_min_index_size = 0
683
684##
685## mdbox-specific settings
686##
687
688# Maximum dbox file size until it's rotated.
689#mdbox_rotate_size = 2M
690
691# Maximum dbox file age until it's rotated. Typically in days. Day begins
692# from midnight, so 1d = today, 2d = yesterday, etc. 0 = check disabled.
693#mdbox_rotate_interval = 0
694
695# When creating new mdbox files, immediately preallocate their size to
696# mdbox_rotate_size. This setting currently works only in Linux with some
697# filesystems (ext4, xfs).
698#mdbox_preallocate_space = no
699
700##
701## Mail attachments
702##
703
704# sdbox and mdbox support saving mail attachments to external files, which
705# also allows single instance storage for them. Other backends don't support
706# this for now.
707
708# WARNING: This feature hasn't been tested much yet. Use at your own risk.
709
710# Directory root where to store mail attachments. Disabled, if empty.
711#mail_attachment_dir =
712
713# Attachments smaller than this aren't saved externally. It's also possible to
714# write a plugin to disable saving specific attachments externally.
715#mail_attachment_min_size = 128k
716
717# Filesystem backend to use for saving attachments:
718# posix : No SiS done by Dovecot (but this might help FS's own deduplication)
719# sis posix : SiS with immediate byte-by-byte comparison during saving
720# sis-queue posix : SiS with delayed comparison and deduplication
721#mail_attachment_fs = sis posix
722
723# Hash format to use in attachment filenames. You can add any text and
724# variables: %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}, %{size}.
725# Variables can be truncated, e.g. %{sha256:80} returns only first 80 bits
726#mail_attachment_hash = %{sha1}
727
728
729/etc/dovecot/conf.d/10-master.conf
730#default_process_limit = 100
731#default_client_limit = 1000
732
733# Default VSZ (virtual memory size) limit for service processes. This is mainly
734# intended to catch and kill processes that leak memory before they eat up
735# everything.
736#default_vsz_limit = 256M
737
738# Login user is internally used by login processes. This is the most untrusted
739# user in Dovecot system. It shouldn't have access to anything at all.
740#default_login_user = dovenull
741
742# Internal user is used by unprivileged processes. It should be separate from
743# login user, so that login processes can't disturb other processes.
744#default_internal_user = dovecot
745
746service imap-login {
747 inet_listener imap {
748 port = 0
749 }
750 inet_listener imaps {
751 #port = 993
752 #ssl = yes
753 }
754
755 # Number of connections to handle before starting a new process. Typically
756 # the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0
757 # is faster. <doc/wiki/LoginProcess.txt>
758 #service_count = 1
759
760 # Number of processes to always keep waiting for more connections.
761 #process_min_avail = 0
762
763 # If you set service_count=0, you probably need to grow this.
764 #vsz_limit = 64M
765}
766
767service pop3-login {
768 inet_listener pop3 {
769 port = 0
770 }
771 inet_listener pop3s {
772 #port = 995
773 #ssl = yes
774 }
775}
776
777service lmtp {
778 unix_listener /var/spool/postfix/private/dovecot-lmtp {
779 mode = 0600
780 user = postfix
781 group = postfix
782 }
783 # Create inet listener only if you can't use the above UNIX socket
784 #inet_listener lmtp {
785 # Avoid making LMTP visible for the entire internet
786 #address =
787 #port =
788 #}
789}
790
791service imap {
792 # Most of the memory goes to mmap()ing files. You may need to increase this
793 # limit if you have huge mailboxes.
794 #vsz_limit = 256M
795
796 # Max. number of IMAP processes (connections)
797 #process_limit = 1024
798}
799
800service pop3 {
801 # Max. number of POP3 processes (connections)
802 #process_limit = 1024
803}
804
805service auth {
806 # auth_socket_path points to this userdb socket by default. It's typically
807 # used by dovecot-lda, doveadm, possibly imap process, etc. Its default
808 # permissions make it readable only by root, but you may need to relax these
809 # permissions. Users that have access to this socket are able to get a list
810 # of all usernames and get results of everyone's userdb lookups.
811 unix_listener /var/spool/postfix/private/auth {
812 mode = 0666
813 user = postfix
814 group = postfix
815 }
816
817 unix_listener auth-userdb {
818 mode = 0600
819 user = vmail
820 group = vmail
821 }
822
823 #Postfix smtp-auth
824 unix_listener /var/spool/postfix/private/auth {
825 mode = 0666
826 }
827
828 # Auth process is run as this user.
829 user = dovecot
830}
831
832service auth-worker {
833 # Auth worker process is run as root by default, so that it can access
834 # /etc/shadow. If this isn't necessary, the user should be changed to
835 # $default_internal_user.
836 user = vmail
837}
838
839service dict {
840 # If dict proxy is used, mail processes should have access to its socket.
841 # For example: mode=0660, group=vmail and global mail_access_groups=vmail
842 unix_listener dict {
843 #mode = 0600
844 #user =
845 #group =
846 }
847}
848
849
850/etc/dovecot/conf.d/10-ssl.conf
851##
852## SSL settings
853##
854
855# SSL/TLS support: yes, no, required. <doc/wiki/SSL.txt>
856ssl = required
857
858# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
859# dropping root privileges, so keep the key file unreadable by anyone but
860# root. Included doc/mkcert.sh can be used to easily generate self-signed
861# certificate, just make sure to update the domains in dovecot-openssl.cnf
862ssl_cert = </etc/letsencrypt/live/servername.de/fullchain.pem
863ssl_key = </etc/letsencrypt/live/servername.de/privkey.pem
864
865# If key file is password protected, give the password here. Alternatively
866# give it when starting dovecot with -p parameter. Since this file is often
867# world-readable, you may want to place this setting instead to a different
868# root owned 0600 file by using ssl_key_password = <path.
869#ssl_key_password =
870
871# PEM encoded trusted certificate authority. Set this only if you intend to use
872# ssl_verify_client_cert=yes. The file should contain the CA certificate(s)
873# followed by the matching CRL(s). (e.g. ssl_ca = </etc/ssl/certs/ca.pem)
874#ssl_ca =
875
876# Request client to send a certificate. If you also want to require it, set
877# auth_ssl_require_client_cert=yes in auth section.
878#ssl_verify_client_cert = no
879
880# Which field from certificate to use for username. commonName and
881# x500UniqueIdentifier are the usual choices. You'll also need to set
882# auth_ssl_username_from_cert=yes.
883#ssl_cert_username_field = commonName
884
885# How often to regenerate the SSL parameters file. Generation is quite CPU
886# intensive operation. The value is in hours, 0 disables regeneration
887# entirely.
888#ssl_parameters_regenerate = 168
889
890# SSL ciphers to use
891#ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL