Skip to content

Commit ff94c45

Browse files
committed
config/service: Modularize default setting values
This is to allow PRO docs to set appropriate defaults.
1 parent 7b2af74 commit ff94c45

5 files changed

Lines changed: 36 additions & 23 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
* [[setting_text,service_client_limit,client_limit]] should be large enough to
2+
handle all the simultaneous connections.
3+
4+
Dovecot attempts to verify that the limit is high enough at startup.
5+
If it's not, it logs a warning such as:
6+
7+
* Warning: service auth { client_limit=1000 } is lower than required under max. load (1328)
8+
9+
This is calculated by counting the [[setting,service_process_limit]] of
10+
every service that is enabled with the `protocol` setting (e.g. imap,
11+
pop3, lmtp). Only services with the
12+
[[setting,service_restart_request_count]] setting being `!= 1` are
13+
counted, because they have persistent connections to auth, while
14+
[[setting,service_restart_request_count,1]] processes only do short-lived
15+
auth connections.
16+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* [[setting_text,service_restart_request_count,restart_request_count=1]] just
2+
in case there were any memory leaks. This could be set to some larger value
3+
(or `unlimited`) for higher performance.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* [[setting_text,service_restart_request_count,restart_request_count=1]] this
2+
should match the same values as for the IMAP, POP3 Submission, and
3+
ManageSieve post-login processes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* [[setting_text,service_restart_request_count,restart_request_count=1]] can be
2+
changed if only a single UID is used for mail users.
3+
4+
This improves performance, but it's less secure, because bugs in code
5+
may leak email data from another user's earlier connection.

docs/core/config/service.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,7 @@ You can add as many `auth` and `userdb` listeners as you want (and you
161161
probably shouldn't touch the `login` and `master` listeners).
162162
:::
163163

164-
* [[setting_text,service_client_limit,client_limit]] should be large enough to
165-
handle all the simultaneous connections.
166-
167-
Dovecot attempts to verify that the limit is high enough at startup.
168-
If it's not, it logs a warning such as:
169-
170-
* Warning: service auth { client_limit=1000 } is lower than required under max. load (1328)
171-
172-
This is calculated by counting the [[setting,service_process_limit]] of
173-
every service that is enabled with the `protocol` setting (e.g. imap,
174-
pop3, lmtp). Only services with the
175-
[[setting,service_restart_request_count]] setting being `!= 1` are
176-
counted, because they have persistent connections to auth, while
177-
[[setting,service_restart_request_count,1]] processes only do short-lived
178-
auth connections.
164+
<!-- @include: @docs/core/config/include/service_default_services_auth_client_limit.inc -->
179165

180166
* [[setting_text,service_process_limit,process_limit=1]], because there can be
181167
only one auth master process.
@@ -266,6 +252,8 @@ connections are the client connections of dict processes.
266252
proxy dict lookups are typically SQL lookups, which require no filesystem
267253
access. (The SQL config files are read while still running as root.)
268254

255+
<!-- @include: @docs/core/config/include/service_default_services_dict_vsz_limit.inc -->
256+
269257
* The dict clients can do any kind of dict lookups and updates for all users,
270258
so they can be rather harmful if exposed to an attacker. That's why by
271259
default only root can connect to dict socket. Unfortunately that is too
@@ -313,9 +301,7 @@ doveadm can automatically connect to the correct backend to run the command.
313301
* [[setting_text,service_client_limit,client_limit=1]], because doveadm command
314302
execution is synchronous.
315303

316-
* [[setting_text,service_restart_request_count,restart_request_count=1]] just
317-
in case there were any memory leaks. This could be set to some larger value
318-
(or `unlimited`) for higher performance.
304+
<!-- @include: @docs/core/config/include/service_default_services_doveadm_restart_request_count.inc -->
319305

320306
* [[setting_text,service_user,user=root]], but the privileges are (temporarily)
321307
dropped to the mail user's privileges after userdb lookup.
@@ -340,11 +326,7 @@ connections.
340326
For small, mostly-idling hobbyist servers, a larger number may work
341327
without problems.
342328

343-
* [[setting_text,service_restart_request_count,restart_request_count=1]] can be
344-
changed if only a single UID is used for mail users.
345-
346-
This improves performance, but it's less secure, because bugs in code
347-
may leak email data from another user's earlier connection.
329+
<!-- @include: @docs/core/config/include/service_default_services_post_login_restart_request_count.inc -->
348330

349331
* [[setting_text,service_process_limit,process_limit]] specifies the maximum
350332
number of simultaneous connections for the protocol that this service handles
@@ -428,6 +410,10 @@ LMTP process for delivering new mails.
428410
UID is used, user can be set to the mail UID for higher security, because the
429411
process can't gain root privileges anymore.
430412

413+
<!-- @include: @docs/core/config/include/service_default_services_lmtp_restart_request_count.inc -->
414+
415+
<!-- @include: @docs/core/config/include/service_default_services_lmtp_process_limit.inc -->
416+
431417
### log
432418

433419
All processes started via Dovecot master process log their messages via

0 commit comments

Comments
 (0)