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