d32dcd1c3c57c1d3a641fca0ef7d5327a35d6faa
[sysconfig/dovecot.git] / conf.d / 10-mail.conf
1 ##
2 ## Mailbox locations and namespaces
3 ##
4
5 # Location for users' mailboxes. The default is empty, which means that Dovecot
6 # tries to find the mailboxes automatically. This won't work if the user
7 # doesn't yet have any mail, so you should explicitly tell Dovecot the full
8 # location.
9 #
10 # If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
11 # isn't enough. You'll also need to tell Dovecot where the other mailboxes are
12 # kept. This is called the "root mail directory", and it must be the first
13 # path given in the mail_location setting.
14 #
15 # There are a few special variables you can use, eg.:
16 #
17 #   %u - username
18 #   %n - user part in user@domain, same as %u if there's no domain
19 #   %d - domain part in user@domain, empty if there's no domain
20 #   %h - home directory
21 #
22 # See doc/wiki/Variables.txt for full list. Some examples:
23 #
24 #   mail_location = maildir:~/Maildir
25 #   mail_location = mbox:~/mail:INBOX=/var/mail/%u
26 #   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
27 #
28 # <doc/wiki/MailLocation.txt>
29 #
30 #mail_location = 
31 mail_location = maildir:~/.maildir
32
33 # If you need to set multiple mailbox locations or want to change default
34 # namespace settings, you can do it by defining namespace sections.
35 #
36 # You can have private, shared and public namespaces. Private namespaces
37 # are for user's personal mails. Shared namespaces are for accessing other
38 # users' mailboxes that have been shared. Public namespaces are for shared
39 # mailboxes that are managed by sysadmin. If you create any shared or public
40 # namespaces you'll typically want to enable ACL plugin also, otherwise all
41 # users can access all the shared mailboxes, assuming they have permissions
42 # on filesystem level to do so.
43 #
44 # REMEMBER: If you add any namespaces, the default namespace must be added
45 # explicitly, ie. mail_location does nothing unless you have a namespace
46 # without a location setting. Default namespace is simply done by having a
47 # namespace with empty prefix.
48 #namespace {
49   # Namespace type: private, shared or public
50   #type = private
51
52   # Hierarchy separator to use. You should use the same separator for all
53   # namespaces or some clients get confused. '/' is usually a good one.
54   # The default however depends on the underlying mail storage format.
55   #separator = 
56
57   # Prefix required to access this namespace. This needs to be different for
58   # all namespaces. For example "Public/".
59   #prefix = 
60
61   # Physical location of the mailbox. This is in same format as
62   # mail_location, which is also the default for it.
63   #location =
64
65   # There can be only one INBOX, and this setting defines which namespace
66   # has it.
67   #inbox = no
68
69   # If namespace is hidden, it's not advertised to clients via NAMESPACE
70   # extension. You'll most likely also want to set list=no. This is mostly
71   # useful when converting from another server with different namespaces which
72   # you want to deprecate but still keep working. For example you can create
73   # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
74   #hidden = no
75
76   # Show the mailboxes under this namespace with LIST command. This makes the
77   # namespace visible for clients that don't support NAMESPACE extension.
78   # "children" value lists child mailboxes, but hides the namespace prefix.
79   #list = yes
80
81   # Namespace handles its own subscriptions. If set to "no", the parent
82   # namespace handles them (empty prefix should always have this as "yes")
83   #subscriptions = yes
84 #}
85
86 # Example shared namespace configuration
87 #namespace {
88   #type = shared
89   #separator = /
90
91   # Mailboxes are visible under "shared/user@domain/"
92   # %%n, %%d and %%u are expanded to the destination user.
93   #prefix = shared/%%u/
94
95   # Mail location for other users' mailboxes. Note that %variables and ~/
96   # expands to the logged in user's data. %%n, %%d, %%u and %%h expand to the
97   # destination user's data.
98   #location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
99
100   # Use the default namespace for saving subscriptions.
101   #subscriptions = no
102
103   # List the shared/ namespace only if there are visible shared mailboxes.
104   #list = children
105 #}
106
107 # System user and group used to access mails. If you use multiple, userdb
108 # can override these by returning uid or gid fields. You can use either numbers
109 # or names. <doc/wiki/UserIds.txt>
110 #mail_uid =
111 #mail_gid =
112
113 # Group to enable temporarily for privileged operations. Currently this is
114 # used only with INBOX when either its initial creation or dotlocking fails.
115 # Typically this is set to "mail" to give access to /var/mail.
116 #mail_privileged_group =
117
118 # TODO: AWD: We used to include this. Do we still need it?
119 #mail_privileged_group = mail
120
121 # Grant access to these supplementary groups for mail processes. Typically
122 # these are used to set up access to shared mailboxes. Note that it may be
123 # dangerous to set these if users can create symlinks (e.g. if "mail" group is
124 # set here, ln -s /var/mail ~/mail/var could allow a user to delete others'
125 # mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it).
126 #mail_access_groups =
127
128 # Allow full filesystem access to clients. There's no access checks other than
129 # what the operating system does for the active UID/GID. It works with both
130 # maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/
131 # or ~user/.
132 #mail_full_filesystem_access = no
133
134 ##
135 ## Mail processes
136 ##
137
138 # Don't use mmap() at all. This is required if you store indexes to shared
139 # filesystems (NFS or clustered filesystem).
140 #mmap_disable = no
141
142 # Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
143 # since version 3, so this should be safe to use nowadays by default.
144 #dotlock_use_excl = yes
145
146 # When to use fsync() or fdatasync() calls:
147 #   optimized (default): Whenever necessary to avoid losing important data
148 #   always: Useful with e.g. NFS when write()s are delayed
149 #   never: Never use it (best performance, but crashes can lose data)
150 #mail_fsync = optimized
151
152 # Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS caches
153 # whenever needed. If you're using only a single mail server this isn't needed.
154 #mail_nfs_storage = no
155 # Mail index files also exist in NFS. Setting this to yes requires
156 # mmap_disable=yes and fsync_disable=no.
157 #mail_nfs_index = no
158
159 # Locking method for index files. Alternatives are fcntl, flock and dotlock.
160 # Dotlocking uses some tricks which may create more disk I/O than other locking
161 # methods. NFS users: flock doesn't work, remember to change mmap_disable.
162 #lock_method = fcntl
163
164 # Directory in which LDA/LMTP temporarily stores incoming mails >128 kB.
165 #mail_temp_dir = /tmp
166
167 # Valid UID range for users, defaults to 500 and above. This is mostly
168 # to make sure that users can't log in as daemons or other system users.
169 # Note that denying root logins is hardcoded to dovecot binary and can't
170 # be done even if first_valid_uid is set to 0.
171 #first_valid_uid = 500
172 #last_valid_uid = 0
173
174 # Valid GID range for users, defaults to non-root/wheel. Users having
175 # non-valid GID as primary group ID aren't allowed to log in. If user
176 # belongs to supplementary groups with non-valid GIDs, those groups are
177 # not set.
178 #first_valid_gid = 1
179 #last_valid_gid = 0
180
181 # Maximum allowed length for mail keyword name. It's only forced when trying
182 # to create new keywords.
183 #mail_max_keyword_length = 50
184
185 # ':' separated list of directories under which chrooting is allowed for mail
186 # processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too).
187 # This setting doesn't affect login_chroot, mail_chroot or auth chroot
188 # settings. If this setting is empty, "/./" in home dirs are ignored.
189 # WARNING: Never add directories here which local users can modify, that
190 # may lead to root exploit. Usually this should be done only if you don't
191 # allow shell access for users. <doc/wiki/Chrooting.txt>
192 #valid_chroot_dirs = 
193
194 # Default chroot directory for mail processes. This can be overridden for
195 # specific users in user database by giving /./ in user's home directory
196 # (eg. /home/./user chroots into /home). Note that usually there is no real
197 # need to do chrooting, Dovecot doesn't allow users to access files outside
198 # their mail directory anyway. If your home directories are prefixed with
199 # the chroot directory, append "/." to mail_chroot. <doc/wiki/Chrooting.txt>
200 #mail_chroot = 
201
202 # UNIX socket path to master authentication server to find users.
203 # This is used by imap (for shared users) and lda.
204 #auth_socket_path = /var/run/dovecot/auth-userdb
205
206 # Directory where to look up mail plugins.
207 #mail_plugin_dir = /usr/lib/dovecot/modules
208
209 # Space separated list of plugins to load for all services. Plugins specific to
210 # IMAP, LDA, etc. are added to this list in their own .conf files.
211 #mail_plugins = 
212
213 ##
214 ## Mailbox handling optimizations
215 ##
216
217 # The minimum number of mails in a mailbox before updates are done to cache
218 # file. This allows optimizing Dovecot's behavior to do less disk writes at
219 # the cost of more disk reads.
220 #mail_cache_min_mail_count = 0
221
222 # When IDLE command is running, mailbox is checked once in a while to see if
223 # there are any new mails or other changes. This setting defines the minimum
224 # time to wait between those checks. Dovecot can also use dnotify, inotify and
225 # kqueue to find out immediately when changes occur.
226 #mailbox_idle_check_interval = 30 secs
227
228 # Save mails with CR+LF instead of plain LF. This makes sending those mails
229 # take less CPU, especially with sendfile() syscall with Linux and FreeBSD.
230 # But it also creates a bit more disk I/O which may just make it slower.
231 # Also note that if other software reads the mboxes/maildirs, they may handle
232 # the extra CRs wrong and cause problems.
233 #mail_save_crlf = no
234
235 ##
236 ## Maildir-specific settings
237 ##
238
239 # By default LIST command returns all entries in maildir beginning with a dot.
240 # Enabling this option makes Dovecot return only entries which are directories.
241 # This is done by stat()ing each entry, so it causes more disk I/O.
242 # (For systems setting struct dirent->d_type, this check is free and it's
243 # done always regardless of this setting)
244 #maildir_stat_dirs = no
245
246 # When copying a message, do it with hard links whenever possible. This makes
247 # the performance much better, and it's unlikely to have any side effects.
248 #maildir_copy_with_hardlinks = yes
249
250 # Assume Dovecot is the only MUA accessing Maildir: Scan cur/ directory only
251 # when its mtime changes unexpectedly or when we can't find the mail otherwise.
252 #maildir_very_dirty_syncs = no
253
254 ##
255 ## mbox-specific settings
256 ##
257
258 # Which locking methods to use for locking mbox. There are four available:
259 #  dotlock: Create <mailbox>.lock file. This is the oldest and most NFS-safe
260 #           solution. If you want to use /var/mail/ like directory, the users
261 #           will need write access to that directory.
262 #  dotlock_try: Same as dotlock, but if it fails because of permissions or
263 #               because there isn't enough disk space, just skip it.
264 #  fcntl  : Use this if possible. Works with NFS too if lockd is used.
265 #  flock  : May not exist in all systems. Doesn't work with NFS.
266 #  lockf  : May not exist in all systems. Doesn't work with NFS.
267 #
268 # You can use multiple locking methods; if you do the order they're declared
269 # in is important to avoid deadlocks if other MTAs/MUAs are using multiple
270 # locking methods as well. Some operating systems don't allow using some of
271 # them simultaneously.
272 #mbox_read_locks = fcntl
273 #mbox_write_locks = dotlock fcntl
274
275 # Maximum time to wait for lock (all of them) before aborting.
276 #mbox_lock_timeout = 5 mins
277
278 # If dotlock exists but the mailbox isn't modified in any way, override the
279 # lock file after this much time.
280 #mbox_dotlock_change_timeout = 2 mins
281
282 # When mbox changes unexpectedly we have to fully read it to find out what
283 # changed. If the mbox is large this can take a long time. Since the change
284 # is usually just a newly appended mail, it'd be faster to simply read the
285 # new mails. If this setting is enabled, Dovecot does this but still safely
286 # fallbacks to re-reading the whole mbox file whenever something in mbox isn't
287 # how it's expected to be. The only real downside to this setting is that if
288 # some other MUA changes message flags, Dovecot doesn't notice it immediately.
289 # Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK 
290 # commands.
291 #mbox_dirty_syncs = yes
292
293 # Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE,
294 # EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored.
295 #mbox_very_dirty_syncs = no
296
297 # Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK
298 # commands and when closing the mailbox). This is especially useful for POP3
299 # where clients often delete all mails. The downside is that our changes
300 # aren't immediately visible to other MUAs.
301 #mbox_lazy_writes = yes
302
303 # If mbox size is smaller than this (e.g. 100k), don't write index files.
304 # If an index file already exists it's still read, just not updated.
305 #mbox_min_index_size = 0
306
307 ##
308 ## mdbox-specific settings
309 ##
310
311 # Maximum dbox file size until it's rotated.
312 #mdbox_rotate_size = 2M
313
314 # Maximum dbox file age until it's rotated. Typically in days. Day begins
315 # from midnight, so 1d = today, 2d = yesterday, etc. 0 = check disabled.
316 #mdbox_rotate_interval = 0
317
318 # When creating new mdbox files, immediately preallocate their size to
319 # mdbox_rotate_size. This setting currently works only in Linux with some
320 # filesystems (ext4, xfs).
321 #mdbox_preallocate_space = no
322
323 ##
324 ## Mail attachments
325 ##
326
327 # sdbox and mdbox support saving mail attachments to external files, which
328 # also allows single instance storage for them. Other backends don't support
329 # this for now.
330
331 # WARNING: This feature hasn't been tested much yet. Use at your own risk.
332
333 # Directory root where to store mail attachments. Disabled, if empty.
334 #mail_attachment_dir =
335
336 # Attachments smaller than this aren't saved externally. It's also possible to
337 # write a plugin to disable saving specific attachments externally.
338 #mail_attachment_min_size = 128k
339
340 # Filesystem backend to use for saving attachments:
341 #  posix : No SiS done by Dovecot (but this might help FS's own deduplication)
342 #  sis posix : SiS with immediate byte-by-byte comparison during saving
343 #  sis-queue posix : SiS with delayed comparison and deduplication
344 #mail_attachment_fs = sis posix
345
346 # Hash format to use in attachment filenames. You can add any text and
347 # variables: %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}, %{size}.
348 # Variables can be truncated, e.g. %{sha256:80} returns only first 80 bits
349 #mail_attachment_hash = %{sha1}