smartmachine 1.2.3 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smart_machine/apps/app.rb +1 -0
  3. data/lib/smart_machine/buildpackers/buildpacker.rb +2 -2
  4. data/lib/smart_machine/commands/grid.rb +8 -0
  5. data/lib/smart_machine/commands/grid_commands/emailer.rb +107 -0
  6. data/lib/smart_machine/commands/grid_commands/roundcube.rb +107 -0
  7. data/lib/smart_machine/configuration.rb +35 -2
  8. data/lib/smart_machine/credentials.rb +10 -0
  9. data/lib/smart_machine/engine.rb +7 -1
  10. data/lib/smart_machine/grids/adminer.rb +1 -0
  11. data/lib/smart_machine/grids/certbot.rb +1 -0
  12. data/lib/smart_machine/grids/emailer/imapsync.rb +7 -0
  13. data/lib/smart_machine/grids/emailer.rb +188 -0
  14. data/lib/smart_machine/grids/haproxy.rb +1 -0
  15. data/lib/smart_machine/grids/mariadb.rb +1 -0
  16. data/lib/smart_machine/grids/postgresql.rb +1 -0
  17. data/lib/smart_machine/grids/roundcube/.keep +0 -0
  18. data/lib/smart_machine/grids/roundcube.rb +184 -0
  19. data/lib/smart_machine/machine.rb +7 -0
  20. data/lib/smart_machine/syncer.rb +10 -0
  21. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/docker/command.rb +50 -0
  22. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/docker/entrypoint.rb +196 -0
  23. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/docker/logtailer.rb +75 -0
  24. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-auth.conf +132 -0
  25. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-mail.conf +427 -0
  26. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-master.conf +153 -0
  27. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-ssl.conf +87 -0
  28. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/15-mailboxes.conf +94 -0
  29. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/20-imap.conf +102 -0
  30. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/20-lmtp.conf +43 -0
  31. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/90-quota.conf +114 -0
  32. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/90-sieve.conf +229 -0
  33. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/dovecot-sql.conf.ext +163 -0
  34. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-ham.sh +2 -0
  35. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-ham.sieve +5 -0
  36. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-spam.sh +2 -0
  37. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-spam.sieve +2 -0
  38. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve-after/spam-to-folder.sieve +6 -0
  39. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/haproxy/haproxy.cfg +58 -0
  40. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/monit/conf.d/services.cfg +70 -0
  41. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/monit/monitrc +344 -0
  42. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/opendkim.conf +71 -0
  43. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/main.cf +128 -0
  44. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/master.cf +149 -0
  45. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-sender-login-maps.cf +7 -0
  46. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-domains.cf +7 -0
  47. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-domains.cf +7 -0
  48. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-masters.cf +7 -0
  49. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-users.cf +7 -0
  50. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-userstothemselves.cf +7 -0
  51. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-mailbox-domains.cf +7 -0
  52. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-mailbox-maps.cf +7 -0
  53. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix-policyd-spf-python/policyd-spf.conf +12 -0
  54. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/spamassassin/local.cf +124 -0
  55. data/lib/smart_machine/templates/dotsmartmachine/config/emailer/usr/local/bin/quota-warning.sh +22 -0
  56. data/lib/smart_machine/templates/dotsmartmachine/config/emailer.yml +37 -0
  57. data/lib/smart_machine/templates/dotsmartmachine/config/engine.yml +2 -0
  58. data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/docker/custom-docker-entrypoint.sh +185 -0
  59. data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/docker/entrypoint.rb +58 -0
  60. data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/etc/apache2/sites-available/000-default.conf +36 -0
  61. data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/usr/local/etc/php/conf.d/zzz_roundcube-custom.ini +4 -0
  62. data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/var/roundcube/config/config.custom.inc.php +25 -0
  63. data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/var/www/html/plugins/password/config.inc.php +523 -0
  64. data/lib/smart_machine/templates/dotsmartmachine/config/roundcube.yml +49 -0
  65. data/lib/smart_machine/templates/dotsmartmachine/config/users.yml +1 -1
  66. data/lib/smart_machine/version.rb +2 -2
  67. data/lib/smart_machine.rb +2 -0
  68. metadata +89 -8
@@ -0,0 +1,132 @@
1
+ ##
2
+ ## Authentication processes
3
+ ##
4
+
5
+ # Disable LOGIN command and all other plaintext authentications unless
6
+ # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
7
+ # matches the local IP (ie. you're connecting from the same computer), the
8
+ # connection is considered secure and plaintext authentication is allowed.
9
+ # See also ssl=required setting.
10
+ #disable_plaintext_auth = yes
11
+
12
+ # Authentication cache size (e.g. 10M). 0 means it's disabled. Note that
13
+ # bsdauth and PAM require cache_key to be set for caching to be used.
14
+ #auth_cache_size = 0
15
+ # Time to live for cached data. After TTL expires the cached record is no
16
+ # longer used, *except* if the main database lookup returns internal failure.
17
+ # We also try to handle password changes automatically: If user's previous
18
+ # authentication was successful, but this one wasn't, the cache isn't used.
19
+ # For now this works only with plaintext authentication.
20
+ #auth_cache_ttl = 1 hour
21
+ # TTL for negative hits (user not found, password mismatch).
22
+ # 0 disables caching them completely.
23
+ #auth_cache_negative_ttl = 1 hour
24
+
25
+ # Space separated list of realms for SASL authentication mechanisms that need
26
+ # them. You can leave it empty if you don't want to support multiple realms.
27
+ # Many clients simply use the first one listed here, so keep the default realm
28
+ # first.
29
+ #auth_realms =
30
+
31
+ # Default realm/domain to use if none was specified. This is used for both
32
+ # SASL realms and appending @domain to username in plaintext logins.
33
+ #auth_default_realm =
34
+
35
+ # List of allowed characters in username. If the user-given username contains
36
+ # a character not listed in here, the login automatically fails. This is just
37
+ # an extra check to make sure user can't exploit any potential quote escaping
38
+ # vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
39
+ # set this value to empty.
40
+ #auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
41
+
42
+ # Username character translations before it's looked up from databases. The
43
+ # value contains series of from -> to characters. For example "#@/@" means
44
+ # that '#' and '/' characters are translated to '@'.
45
+ #auth_username_translation =
46
+
47
+ # Username formatting before it's looked up from databases. You can use
48
+ # the standard variables here, eg. %Lu would lowercase the username, %n would
49
+ # drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
50
+ # "-AT-". This translation is done after auth_username_translation changes.
51
+ #auth_username_format = %Lu
52
+
53
+ # If you want to allow master users to log in by specifying the master
54
+ # username within the normal username string (ie. not using SASL mechanism's
55
+ # support for it), you can specify the separator character here. The format
56
+ # is then <username><separator><master username>. UW-IMAP uses "*" as the
57
+ # separator, so that could be a good choice.
58
+ #auth_master_user_separator =
59
+
60
+ # Username to use for users logging in with ANONYMOUS SASL mechanism
61
+ #auth_anonymous_username = anonymous
62
+
63
+ # Maximum number of dovecot-auth worker processes. They're used to execute
64
+ # blocking passdb and userdb queries (eg. MySQL and PAM). They're
65
+ # automatically created and destroyed as needed.
66
+ #auth_worker_max_count = 30
67
+
68
+ # Host name to use in GSSAPI principal names. The default is to use the
69
+ # name returned by gethostname(). Use "$ALL" (with quotes) to allow all keytab
70
+ # entries.
71
+ #auth_gssapi_hostname =
72
+
73
+ # Kerberos keytab to use for the GSSAPI mechanism. Will use the system
74
+ # default (usually /etc/krb5.keytab) if not specified. You may need to change
75
+ # the auth service to run as root to be able to read this file.
76
+ #auth_krb5_keytab =
77
+
78
+ # Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and
79
+ # ntlm_auth helper. <doc/wiki/Authentication/Mechanisms/Winbind.txt>
80
+ #auth_use_winbind = no
81
+
82
+ # Path for Samba's ntlm_auth helper binary.
83
+ #auth_winbind_helper_path = /usr/bin/ntlm_auth
84
+
85
+ # Time to delay before replying to failed authentications.
86
+ #auth_failure_delay = 2 secs
87
+
88
+ # Require a valid SSL client certificate or the authentication fails.
89
+ #auth_ssl_require_client_cert = no
90
+
91
+ # Take the username from client's SSL certificate, using
92
+ # X509_NAME_get_text_by_NID() which returns the subject's DN's
93
+ # CommonName.
94
+ #auth_ssl_username_from_cert = no
95
+
96
+ # Space separated list of wanted authentication mechanisms:
97
+ # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp
98
+ # gss-spnego
99
+ # NOTE: See also disable_plaintext_auth setting.
100
+ ##### SmartMachine Begin.
101
+ #auth_mechanisms = plain
102
+ auth_mechanisms = plain login
103
+ ##### SmartMachine Close.
104
+
105
+ ##
106
+ ## Password and user databases
107
+ ##
108
+
109
+ #
110
+ # Password database is used to verify user's password (and nothing more).
111
+ # You can have multiple passdbs and userdbs. This is useful if you want to
112
+ # allow both system users (/etc/passwd) and virtual users to login without
113
+ # duplicating the system users into virtual database.
114
+ #
115
+ # <doc/wiki/PasswordDatabase.txt>
116
+ #
117
+ # User database specifies where mails are located and what user/group IDs
118
+ # own them. For single-UID configuration use "static" userdb.
119
+ #
120
+ # <doc/wiki/UserDatabase.txt>
121
+
122
+ #!include auth-deny.conf.ext
123
+ #!include auth-master.conf.ext
124
+
125
+ ##### SmartMachine Begin.
126
+ #!include auth-system.conf.ext
127
+ !include auth-sql.conf.ext
128
+ ##### SmartMachine Close.
129
+ #!include auth-ldap.conf.ext
130
+ #!include auth-passwdfile.conf.ext
131
+ #!include auth-checkpassword.conf.ext
132
+ #!include auth-static.conf.ext
@@ -0,0 +1,427 @@
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
+ ##### SmartMachine Begin.
31
+ #mail_location = mbox:~/mail:INBOX=/var/mail/%u
32
+ mail_location = maildir:~/Maildir
33
+ ##### SmartMachine Close.
34
+
35
+ # If you need to set multiple mailbox locations or want to change default
36
+ # namespace settings, you can do it by defining namespace sections.
37
+ #
38
+ # You can have private, shared and public namespaces. Private namespaces
39
+ # are for user's personal mails. Shared namespaces are for accessing other
40
+ # users' mailboxes that have been shared. Public namespaces are for shared
41
+ # mailboxes that are managed by sysadmin. If you create any shared or public
42
+ # namespaces you'll typically want to enable ACL plugin also, otherwise all
43
+ # users can access all the shared mailboxes, assuming they have permissions
44
+ # on filesystem level to do so.
45
+ namespace inbox {
46
+ # Namespace type: private, shared or public
47
+ #type = private
48
+
49
+ # Hierarchy separator to use. You should use the same separator for all
50
+ # namespaces or some clients get confused. '/' is usually a good one.
51
+ # The default however depends on the underlying mail storage format.
52
+ #separator =
53
+
54
+ # Prefix required to access this namespace. This needs to be different for
55
+ # all namespaces. For example "Public/".
56
+ #prefix =
57
+
58
+ # Physical location of the mailbox. This is in same format as
59
+ # mail_location, which is also the default for it.
60
+ #location =
61
+
62
+ # There can be only one INBOX, and this setting defines which namespace
63
+ # has it.
64
+ inbox = yes
65
+
66
+ # If namespace is hidden, it's not advertised to clients via NAMESPACE
67
+ # extension. You'll most likely also want to set list=no. This is mostly
68
+ # useful when converting from another server with different namespaces which
69
+ # you want to deprecate but still keep working. For example you can create
70
+ # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
71
+ #hidden = no
72
+
73
+ # Show the mailboxes under this namespace with LIST command. This makes the
74
+ # namespace visible for clients that don't support NAMESPACE extension.
75
+ # "children" value lists child mailboxes, but hides the namespace prefix.
76
+ #list = yes
77
+
78
+ # Namespace handles its own subscriptions. If set to "no", the parent
79
+ # namespace handles them (empty prefix should always have this as "yes")
80
+ #subscriptions = yes
81
+
82
+ # See 15-mailboxes.conf for definitions of special mailboxes.
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
+ # Should shared INBOX be visible as "shared/user" or "shared/user/INBOX"?
106
+ #mail_shared_explicit_inbox = no
107
+
108
+ # System user and group used to access mails. If you use multiple, userdb
109
+ # can override these by returning uid or gid fields. You can use either numbers
110
+ # or names. <doc/wiki/UserIds.txt>
111
+ #mail_uid =
112
+ #mail_gid =
113
+
114
+ # Group to enable temporarily for privileged operations. Currently this is
115
+ # used only with INBOX when either its initial creation or dotlocking fails.
116
+ # Typically this is set to "mail" to give access to /var/mail.
117
+ mail_privileged_group = mail
118
+
119
+ # Grant access to these supplementary groups for mail processes. Typically
120
+ # these are used to set up access to shared mailboxes. Note that it may be
121
+ # dangerous to set these if users can create symlinks (e.g. if "mail" group is
122
+ # set here, ln -s /var/mail ~/mail/var could allow a user to delete others'
123
+ # mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it).
124
+ #mail_access_groups =
125
+
126
+ # Allow full filesystem access to clients. There's no access checks other than
127
+ # what the operating system does for the active UID/GID. It works with both
128
+ # maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/
129
+ # or ~user/.
130
+ #mail_full_filesystem_access = no
131
+
132
+ # Dictionary for key=value mailbox attributes. This is used for example by
133
+ # URLAUTH and METADATA extensions.
134
+ #mail_attribute_dict =
135
+
136
+ # A comment or note that is associated with the server. This value is
137
+ # accessible for authenticated users through the IMAP METADATA server
138
+ # entry "/shared/comment".
139
+ #mail_server_comment = ""
140
+
141
+ # Indicates a method for contacting the server administrator. According to
142
+ # RFC 5464, this value MUST be a URI (e.g., a mailto: or tel: URL), but that
143
+ # is currently not enforced. Use for example mailto:admin@example.com. This
144
+ # value is accessible for authenticated users through the IMAP METADATA server
145
+ # entry "/shared/admin".
146
+ #mail_server_admin =
147
+
148
+ ##
149
+ ## Mail processes
150
+ ##
151
+
152
+ # Don't use mmap() at all. This is required if you store indexes to shared
153
+ # filesystems (NFS or clustered filesystem).
154
+ #mmap_disable = no
155
+
156
+ # Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
157
+ # since version 3, so this should be safe to use nowadays by default.
158
+ #dotlock_use_excl = yes
159
+
160
+ # When to use fsync() or fdatasync() calls:
161
+ # optimized (default): Whenever necessary to avoid losing important data
162
+ # always: Useful with e.g. NFS when write()s are delayed
163
+ # never: Never use it (best performance, but crashes can lose data)
164
+ #mail_fsync = optimized
165
+
166
+ # Locking method for index files. Alternatives are fcntl, flock and dotlock.
167
+ # Dotlocking uses some tricks which may create more disk I/O than other locking
168
+ # methods. NFS users: flock doesn't work, remember to change mmap_disable.
169
+ #lock_method = fcntl
170
+
171
+ # Directory where mails can be temporarily stored. Usually it's used only for
172
+ # mails larger than >= 128 kB. It's used by various parts of Dovecot, for
173
+ # example LDA/LMTP while delivering large mails or zlib plugin for keeping
174
+ # uncompressed mails.
175
+ #mail_temp_dir = /tmp
176
+
177
+ # Valid UID range for users, defaults to 500 and above. This is mostly
178
+ # to make sure that users can't log in as daemons or other system users.
179
+ # Note that denying root logins is hardcoded to dovecot binary and can't
180
+ # be done even if first_valid_uid is set to 0.
181
+ #first_valid_uid = 500
182
+ #last_valid_uid = 0
183
+
184
+ # Valid GID range for users, defaults to non-root/wheel. Users having
185
+ # non-valid GID as primary group ID aren't allowed to log in. If user
186
+ # belongs to supplementary groups with non-valid GIDs, those groups are
187
+ # not set.
188
+ #first_valid_gid = 1
189
+ #last_valid_gid = 0
190
+
191
+ # Maximum allowed length for mail keyword name. It's only forced when trying
192
+ # to create new keywords.
193
+ #mail_max_keyword_length = 50
194
+
195
+ # ':' separated list of directories under which chrooting is allowed for mail
196
+ # processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too).
197
+ # This setting doesn't affect login_chroot, mail_chroot or auth chroot
198
+ # settings. If this setting is empty, "/./" in home dirs are ignored.
199
+ # WARNING: Never add directories here which local users can modify, that
200
+ # may lead to root exploit. Usually this should be done only if you don't
201
+ # allow shell access for users. <doc/wiki/Chrooting.txt>
202
+ #valid_chroot_dirs =
203
+
204
+ # Default chroot directory for mail processes. This can be overridden for
205
+ # specific users in user database by giving /./ in user's home directory
206
+ # (eg. /home/./user chroots into /home). Note that usually there is no real
207
+ # need to do chrooting, Dovecot doesn't allow users to access files outside
208
+ # their mail directory anyway. If your home directories are prefixed with
209
+ # the chroot directory, append "/." to mail_chroot. <doc/wiki/Chrooting.txt>
210
+ #mail_chroot =
211
+
212
+ # UNIX socket path to master authentication server to find users.
213
+ # This is used by imap (for shared users) and lda.
214
+ #auth_socket_path = /var/run/dovecot/auth-userdb
215
+
216
+ # Directory where to look up mail plugins.
217
+ #mail_plugin_dir = /usr/lib/dovecot/modules
218
+
219
+ # Space separated list of plugins to load for all services. Plugins specific to
220
+ # IMAP, LDA, etc. are added to this list in their own .conf files.
221
+ #mail_plugins =
222
+ ##### SmartMachine Begin.
223
+ mail_plugins = quota
224
+ ##### SmartMachine Close.
225
+
226
+ ##
227
+ ## Mailbox handling optimizations
228
+ ##
229
+
230
+ # Mailbox list indexes can be used to optimize IMAP STATUS commands. They are
231
+ # also required for IMAP NOTIFY extension to be enabled.
232
+ #mailbox_list_index = yes
233
+
234
+ # Trust mailbox list index to be up-to-date. This reduces disk I/O at the cost
235
+ # of potentially returning out-of-date results after e.g. server crashes.
236
+ # The results will be automatically fixed once the folders are opened.
237
+ #mailbox_list_index_very_dirty_syncs = yes
238
+
239
+ # Should INBOX be kept up-to-date in the mailbox list index? By default it's
240
+ # not, because most of the mailbox accesses will open INBOX anyway.
241
+ #mailbox_list_index_include_inbox = no
242
+
243
+ # The minimum number of mails in a mailbox before updates are done to cache
244
+ # file. This allows optimizing Dovecot's behavior to do less disk writes at
245
+ # the cost of more disk reads.
246
+ #mail_cache_min_mail_count = 0
247
+
248
+ # When IDLE command is running, mailbox is checked once in a while to see if
249
+ # there are any new mails or other changes. This setting defines the minimum
250
+ # time to wait between those checks. Dovecot can also use inotify and
251
+ # kqueue to find out immediately when changes occur.
252
+ #mailbox_idle_check_interval = 30 secs
253
+
254
+ # Save mails with CR+LF instead of plain LF. This makes sending those mails
255
+ # take less CPU, especially with sendfile() syscall with Linux and FreeBSD.
256
+ # But it also creates a bit more disk I/O which may just make it slower.
257
+ # Also note that if other software reads the mboxes/maildirs, they may handle
258
+ # the extra CRs wrong and cause problems.
259
+ #mail_save_crlf = no
260
+
261
+ # Max number of mails to keep open and prefetch to memory. This only works with
262
+ # some mailbox formats and/or operating systems.
263
+ #mail_prefetch_count = 0
264
+
265
+ # How often to scan for stale temporary files and delete them (0 = never).
266
+ # These should exist only after Dovecot dies in the middle of saving mails.
267
+ #mail_temp_scan_interval = 1w
268
+
269
+ # How many slow mail accesses sorting can perform before it returns failure.
270
+ # With IMAP the reply is: NO [LIMIT] Requested sort would have taken too long.
271
+ # The untagged SORT reply is still returned, but it's likely not correct.
272
+ #mail_sort_max_read_count = 0
273
+
274
+ protocol !indexer-worker {
275
+ # If folder vsize calculation requires opening more than this many mails from
276
+ # disk (i.e. mail sizes aren't in cache already), return failure and finish
277
+ # the calculation via indexer process. Disabled by default. This setting must
278
+ # be 0 for indexer-worker processes.
279
+ #mail_vsize_bg_after_count = 0
280
+ }
281
+
282
+ ##
283
+ ## Maildir-specific settings
284
+ ##
285
+
286
+ # By default LIST command returns all entries in maildir beginning with a dot.
287
+ # Enabling this option makes Dovecot return only entries which are directories.
288
+ # This is done by stat()ing each entry, so it causes more disk I/O.
289
+ # (For systems setting struct dirent->d_type, this check is free and it's
290
+ # done always regardless of this setting)
291
+ #maildir_stat_dirs = no
292
+
293
+ # When copying a message, do it with hard links whenever possible. This makes
294
+ # the performance much better, and it's unlikely to have any side effects.
295
+ #maildir_copy_with_hardlinks = yes
296
+
297
+ # Assume Dovecot is the only MUA accessing Maildir: Scan cur/ directory only
298
+ # when its mtime changes unexpectedly or when we can't find the mail otherwise.
299
+ #maildir_very_dirty_syncs = no
300
+
301
+ # If enabled, Dovecot doesn't use the S=<size> in the Maildir filenames for
302
+ # getting the mail's physical size, except when recalculating Maildir++ quota.
303
+ # This can be useful in systems where a lot of the Maildir filenames have a
304
+ # broken size. The performance hit for enabling this is very small.
305
+ #maildir_broken_filename_sizes = no
306
+
307
+ # Always move mails from new/ directory to cur/, even when the \Recent flags
308
+ # aren't being reset.
309
+ #maildir_empty_new = no
310
+
311
+ ##
312
+ ## mbox-specific settings
313
+ ##
314
+
315
+ # Which locking methods to use for locking mbox. There are four available:
316
+ # dotlock: Create <mailbox>.lock file. This is the oldest and most NFS-safe
317
+ # solution. If you want to use /var/mail/ like directory, the users
318
+ # will need write access to that directory.
319
+ # dotlock_try: Same as dotlock, but if it fails because of permissions or
320
+ # because there isn't enough disk space, just skip it.
321
+ # fcntl : Use this if possible. Works with NFS too if lockd is used.
322
+ # flock : May not exist in all systems. Doesn't work with NFS.
323
+ # lockf : May not exist in all systems. Doesn't work with NFS.
324
+ #
325
+ # You can use multiple locking methods; if you do the order they're declared
326
+ # in is important to avoid deadlocks if other MTAs/MUAs are using multiple
327
+ # locking methods as well. Some operating systems don't allow using some of
328
+ # them simultaneously.
329
+ #
330
+ # The Debian value for mbox_write_locks differs from upstream Dovecot. It is
331
+ # changed to be compliant with Debian Policy (section 11.6) for NFS safety.
332
+ # Dovecot: mbox_write_locks = dotlock fcntl
333
+ # Debian: mbox_write_locks = fcntl dotlock
334
+ #
335
+ #mbox_read_locks = fcntl
336
+ #mbox_write_locks = fcntl dotlock
337
+
338
+ # Maximum time to wait for lock (all of them) before aborting.
339
+ #mbox_lock_timeout = 5 mins
340
+
341
+ # If dotlock exists but the mailbox isn't modified in any way, override the
342
+ # lock file after this much time.
343
+ #mbox_dotlock_change_timeout = 2 mins
344
+
345
+ # When mbox changes unexpectedly we have to fully read it to find out what
346
+ # changed. If the mbox is large this can take a long time. Since the change
347
+ # is usually just a newly appended mail, it'd be faster to simply read the
348
+ # new mails. If this setting is enabled, Dovecot does this but still safely
349
+ # fallbacks to re-reading the whole mbox file whenever something in mbox isn't
350
+ # how it's expected to be. The only real downside to this setting is that if
351
+ # some other MUA changes message flags, Dovecot doesn't notice it immediately.
352
+ # Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK
353
+ # commands.
354
+ #mbox_dirty_syncs = yes
355
+
356
+ # Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE,
357
+ # EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored.
358
+ #mbox_very_dirty_syncs = no
359
+
360
+ # Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK
361
+ # commands and when closing the mailbox). This is especially useful for POP3
362
+ # where clients often delete all mails. The downside is that our changes
363
+ # aren't immediately visible to other MUAs.
364
+ #mbox_lazy_writes = yes
365
+
366
+ # If mbox size is smaller than this (e.g. 100k), don't write index files.
367
+ # If an index file already exists it's still read, just not updated.
368
+ #mbox_min_index_size = 0
369
+
370
+ # Mail header selection algorithm to use for MD5 POP3 UIDLs when
371
+ # pop3_uidl_format=%m. For backwards compatibility we use apop3d inspired
372
+ # algorithm, but it fails if the first Received: header isn't unique in all
373
+ # mails. An alternative algorithm is "all" that selects all headers.
374
+ #mbox_md5 = apop3d
375
+
376
+ ##
377
+ ## mdbox-specific settings
378
+ ##
379
+
380
+ # Maximum dbox file size until it's rotated.
381
+ #mdbox_rotate_size = 10M
382
+
383
+ # Maximum dbox file age until it's rotated. Typically in days. Day begins
384
+ # from midnight, so 1d = today, 2d = yesterday, etc. 0 = check disabled.
385
+ #mdbox_rotate_interval = 0
386
+
387
+ # When creating new mdbox files, immediately preallocate their size to
388
+ # mdbox_rotate_size. This setting currently works only in Linux with some
389
+ # filesystems (ext4, xfs).
390
+ #mdbox_preallocate_space = no
391
+
392
+ ##
393
+ ## Mail attachments
394
+ ##
395
+
396
+ # sdbox and mdbox support saving mail attachments to external files, which
397
+ # also allows single instance storage for them. Other backends don't support
398
+ # this for now.
399
+
400
+ # Directory root where to store mail attachments. Disabled, if empty.
401
+ #mail_attachment_dir =
402
+
403
+ # Attachments smaller than this aren't saved externally. It's also possible to
404
+ # write a plugin to disable saving specific attachments externally.
405
+ #mail_attachment_min_size = 128k
406
+
407
+ # Filesystem backend to use for saving attachments:
408
+ # posix : No SiS done by Dovecot (but this might help FS's own deduplication)
409
+ # sis posix : SiS with immediate byte-by-byte comparison during saving
410
+ # sis-queue posix : SiS with delayed comparison and deduplication
411
+ #mail_attachment_fs = sis posix
412
+
413
+ # Hash format to use in attachment filenames. You can add any text and
414
+ # variables: %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}, %{size}.
415
+ # Variables can be truncated, e.g. %{sha256:80} returns only first 80 bits
416
+ #mail_attachment_hash = %{sha1}
417
+
418
+ # Settings to control adding $HasAttachment or $HasNoAttachment keywords.
419
+ # By default, all MIME parts with Content-Disposition=attachment, or inlines
420
+ # with filename parameter are consired attachments.
421
+ # add-flags - Add the keywords when saving new mails or when fetching can
422
+ # do it efficiently.
423
+ # content-type=type or !type - Include/exclude content type. Excluding will
424
+ # never consider the matched MIME part as attachment. Including will only
425
+ # negate an exclusion (e.g. content-type=!foo/* content-type=foo/bar).
426
+ # exclude-inlined - Exclude any Content-Disposition=inline MIME part.
427
+ #mail_attachment_detection_options =