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