[PATCH 0/4] Dovecot service refactor.

  • Open
  • quality assurance status badge
Details
3 participants
  • Clément Lassieur
  • Herman Rimm
  • Bruno Victal
Owner
unassigned
Submitted by
Bruno Victal
Severity
normal
B
B
Bruno Victal wrote on 4 Nov 2023 20:03
(address . guix-patches@gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
cover.1699124200.git.mirai@makinata.eu
Notable changes:
* Adds a 'reopen action to deal with log rotations.
* Updated documentation.
* Simplified service definition, reworked serialization to use
G-Exps.
* Fix inconsistency with ssl? setting in inet-listener-configuration.

Tested with:
* make check-system TESTS=dovecot
* Running `dovecot -c <config-file> -n' on the resulting file, a dry run
that checks if file syntax conforms to dovecot expectations.

Bruno Victal (4):
services: dovecot: Use make-kill-destructor for action stop.
services: dovecot: Add 'reopen action.
services: dovecot: Refactor serialization process.
services: dovecot: Fix incorrect type for ssl? field.

doc/guix.texi | 1613 ++++++++++++++++-------------------------
gnu/services/mail.scm | 906 ++++++++++++-----------
2 files changed, 1107 insertions(+), 1412 deletions(-)


base-commit: e3f318f0489322c4c9b5964f03a8b063a7bfbebd
--
2.41.0
B
B
Bruno Victal wrote on 4 Nov 2023 20:06
[PATCH 4/4] services: dovecot: Fix incorrect type for ssl? field.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
4f4f0ed0ce61588137a3e1e9ba96cfb190a2cd75.1699124200.git.mirai@makinata.eu
* gnu/services/mail.scm (inet-listener-configuration)[ssl?]: Change value type
to string. Change default value to "yes".
* doc/guix.texi: Update it.

Change-Id: I83ac8de275d7e410e218b5eb2b176fb45a42977e
---
doc/guix.texi | 2 +-
gnu/services/mail.scm | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Toggle diff (28 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 5242e89104..ed5ee4e583 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -26674,7 +26674,7 @@ Mail Services
@item @code{port} (type: non-negative-integer)
The port on which to listen.
-@item @code{ssl?} (default: @code{#t}) (type: boolean)
+@item @code{ssl?} (default: @code{yes}) (type: string)
Whether to use SSL for this service; @samp{yes}, @samp{no}, or
@samp{required}.
@end table
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index d4b050f73e..170c1f5dfc 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -269,7 +269,7 @@ (define-configuration inet-listener-configuration
non-negative-integer
"The port on which to listen.")
(ssl?
- (boolean #t)
+ (string "yes")
"Whether to use SSL for this service; @samp{yes}, @samp{no}, or
@samp{required}."))
--
2.41.0
B
B
Bruno Victal wrote on 4 Nov 2023 20:06
[PATCH 3/4] services: dovecot: Refactor serialization process.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
6d5353ec1b3b44106cd3900fd88f801e67fd21a6.1699124200.git.mirai@makinata.eu
This commit refactors the dovecot serialization process to express the values
to be serialized as G-Exps instead. String values are now properly serialized
according to dovecot.conf syntax rules. [1]
The documentation was also revised and regenerated.


* gnu/services/mail.scm: Reorganize dovecot related procedures.
(uglify-field-name): Simplify.
(escape-string, make-serialize-list-with-delimiter, serialize-list-of-strings)
(serialize-alist, make-serialize-section, make-serialize-list-of-sections)
(serialize-section-name, serialize-list-of-passdb-configurations)
(serialize-list-of-userdb-configurations)
(serialize-list-of-listener-configurations)
(serialize-list-of-service-configurations)
(serialize-list-of-protocol-configurations)
(serialize-list-of-mailbox-configurations)
(serialize-list-of-namespace-configurations)
(dovecot-configuration->file): New procedure.
(serialize-field, serialize-string, serialize-non-negative-integer)
(serialize-boolean, free-form-fields?, serialize-free-form-fields)
(serialize-dict-configuration, listener-configuration?)
(serialize-listener-configuration, serialize-protocol-configuration)
(serialize-plugin-configuration, serialize-mailbox-configuration): Refactor.
(list-of-passdb-configurations?, list-of-userdb-configurations?)
(list-of-listener-configurations?, list-of-service-configurations?)
(list-of-protocol-configurations?, list-of-mailbox-configurations?)
(list-of-namespace-configurations?): New predicate.
(space-separated-string-list?, comma-separated-string-list?, file-name?)
(colon-separated-file-name-list?, free-form-args?)
(passdb-configuration-list?, userdb-configuration-list?)
(listener-configuration-list?, service-configuration-list?)
(protocol-configuration-list?, mailbox-configuration-list?)
(list-of-namespace-configuration?): Remove predicate.
(serialize-space-separated-string-list, serialize-comma-separated-string-list)
(serialize-colon-separated-file-name-list, serialize-free-form-args)
(serialize-passdb-configuration, serialize-passdb-configuration-list)
(serialize-userdb-configuration, serialize-userdb-configuration-list)
(serialize-unix-listener-configuration, serialize-fifo-listener-configuration)
(serialize-inet-listener-configuration, serialize-listener-configuration-list)
(serialize-service-configuration, serialize-service-configuration-list)
(serialize-protocol-configuration-list, serialize-mailbox-configuration-list)
(serialize-namespace-configuration)
(serialize-list-of-namespace-configuration): Remove procedure.
(hours?): Remove unused predicate, leftovers from
28c03b4555e99da9524c697f5eba3783916050c7.
(serialize-hours): Likewise.
(unix-listener-configuration, fifo-listener-configuration): Deduplicate
definition with a let-syntax macro.
(passdb-configuration)[args]: Set value type to maybe-list-of-strings.
(userdb-configuration)[args]: Likewise.
[override-fields]: Set value type to alist.
(unix-listener-configuration, fifo-listener-configuration)[path]: Remove
redundant error guard.
(inet-listener-configuration)[protocol, port]: Likewise.
(service-configuration)[kind]: Likewise. Set serializing procedure to
serialize-section-name.
[listeners]: Set value type to list-of-listener-configurations.
(protocol-configuration)[name]: Remove redundant error guard.
[mail-plugins]: Set value type to list-of-strings.
[managesieve-notify-capability, managesieve-sieve-capability]: Set value type
to maybe-list-of-strings.
(mailbox-configuration)[name]: Remove redundant error guard.
[special-use]: : Set value type to maybe-list-of-strings.
(namespace-configuration)[name]: Remove redundant error guard.
[location, hidden?, subscriptions?]: Fix documentation.
[mailboxes]: Set value type to list-of-mailbox-configurations.
(dovecot-configuration)[listen]: Set value type to list-of-strings. Serialize
this using comma as the delimiter.
[passdbs, userdbs]: Simplify default value.
[namespaces]: Set value type to list-of-namespace-configurations.
[base-dir, auth-winbind-helper-path, mail-temp-dir, auth-socket-path]
[mail-plugin-dir, sendmail-path]: Set value type to string.
[login-trusted-networks, director-servers, director-mail-servers]
[imap-client-workarounds]: Set value type to maybe-list-of-strings.
[doveadm-socket-path, auth-cache-size, auth-cache-ttl]
[auth-cache-negative-ttl, auth-realms, auth-master-user-separator]
[auth-anonymous-username, director-servers, director-mail-servers]
[info-log-path, debug-log-path, syslog-facility, auth-verbose-passwords]
[auth-debug-passwords?, login-log-format, mail-location]
[mail-privileged-group, mail-access-groups, mail-full-filesystem-access?]
[mmap-disable?, dotlock-use-excl?, mail-fsync, lock-method, first-valid-uid]
[mail-chroot, mail-plugins, mail-save-crlf?, maildir-stat-dirs?]
[mbox-read-locks, mbox-very-dirty-syncs?, mail-attachment-dir]
[ssl-crypto-device, lda-mailbox-autocreate?]
[lda-mailbox-autosubscribe?]: Fix documentation.
[import-environment, auth-mechanisms, login-log-format-elements]
[mail-plugins, mbox-read-locks, mbox-write-locks]: Set value type to
list-of-strings.
[log-timestamp, mail-log-prefix]: Reflect changes from escape-string, remove
extraneous quotes.
[valid-chroot-dirs]: Refactor documentation. Serialize this using colon as the
delimiter.
[protocols]: Set value type to list-of-protocol-configurations.
[services]: Set value type to list-of-service-configurations. Re-style.
(opaque-dovecot-configuration)[string]: Remove redundant error guard.
(%dovecot-activation): Refactor to use 'dovecot-configuration->file' for
serializing dovecot.conf.
(dovecot-service-type): Re-style.
* doc/guix.texi: Regenerate it. Remove example using deprecated
'dovecot-service' procedure.

Change-Id: I8d18c504c5cd80497a069f28c1c6975538510e7e
---
doc/guix.texi | 1613 ++++++++++++++++-------------------------
gnu/services/mail.scm | 870 +++++++++++-----------
2 files changed, 1083 insertions(+), 1400 deletions(-)

Toggle diff (370 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index b90078be06..5242e89104 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25658,9 +25658,11 @@ Mail Services
@cindex mail
@cindex email
The @code{(gnu services mail)} module provides Guix service definitions
-for email services: IMAP, POP3, and LMTP servers, as well as mail
-transport agents (MTAs). Lots of acronyms! These services are detailed
-in the subsections below.
+for email services: @acronym{IMAP, Internet Message Access Protocol},
+@acronym{POP3, Post Office Protocol version 3}, and @acronym{LMTP,
+Local Mail Transfer Protocol} servers, as well as @acronym{MTA,
+transport agent}s. Lots of acronyms! These services are detailed in
+the subsections below.
@subsubheading Dovecot Service
@@ -25678,8 +25680,11 @@ Mail Services
and as is the case with other services, Guix allows the system
administrator to specify these parameters via a uniform Scheme interface.
-For example, to specify that mail is located at @code{maildir~/.mail},
-one would instantiate the Dovecot service like this:
+For example, to specify that the mail location is a
+maildir@footnote{A mailbox format, see
+@url{https://manpages.debian.org/stretch/qmail/maildir.5.en.html}.}
+located at @file{~/.mail}, one would instantiate the Dovecot service
+like this:
@lisp
(service dovecot-service-type
@@ -25687,10 +25692,8 @@ Mail Services
(mail-location "maildir:~/.mail")))
@end lisp
-The available configuration parameters follow. Each parameter
-definition is preceded by its type; for example, @samp{string-list foo}
-indicates that the @code{foo} parameter should be specified as a list of
-strings. There is also a way to specify the configuration as a string,
+The available configuration parameters follow.
+There is also a way to specify the configuration as a string,
if you have an old @code{dovecot.conf} file that you want to port over
from some other system; see the end for more details.
@@ -25702,688 +25705,378 @@ Mail Services
@c (generate-documentation) than to make it below and have to deal with
@c the churn as dovecot updates.
+@c %start of fragment
+@deftp {Data Type} dovecot-configuration
Available @code{dovecot-configuration} fields are:
-@deftypevr {@code{dovecot-configuration} parameter} package dovecot
+@table @asis
+@item @code{dovecot} (default: @code{dovecot}) (type: file-like)
The dovecot package.
-@end deftypevr
-@deftypevr {@code{dovecot-configuration} parameter} comma-separated-string-list listen
-A list of IPs or hosts where to listen for connections. @samp{*}
-listens on all IPv4 interfaces, @samp{::} listens on all IPv6
+@item @code{listen} (default: @code{("*" "::")}) (type: list-of-strings)
+A list of IPs or hosts where to listen in for connections. @samp{*}
+listens in all IPv4 interfaces, @samp{::} listens in all IPv6
interfaces. If you want to specify non-default ports or anything more
complex, customize the address and port fields of the
-@samp{inet-listener} of the specific services you are interested in.
-@end deftypevr
-
-@deftypevr {@code{dovecot-configuration} parameter} protocol-configuration-list protocols
-List of protocols we want to serve. Available protocols include
-@samp{imap}, @samp{pop3}, and @samp{lmtp}.
-
-Available @code{protocol-configuration} fields are:
-
-@deftypevr {@code{protocol-configuration} parameter} string name
-The name of the protocol.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} string auth-socket-path
-UNIX socket path to the master authentication server to find users.
-This is used by imap (for shared users) and lda.
-It defaults to @samp{"/var/run/dovecot/auth-userdb"}.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} boolean imap-metadata?
-Whether to enable the @code{IMAP METADATA} extension as defined in
-@uref{https://tools.ietf.org/html/rfc5464,RFC@tie{}5464}, which provides
-a means for clients to set and retrieve per-mailbox, per-user metadata
-and annotations over IMAP.
-
-If this is @samp{#t}, you must also specify a dictionary @i{via} the
-@code{mail-attribute-dict} setting.
-
-Defaults to @samp{#f}.
-
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} space-separated-string-list managesieve-notify-capabilities
-Which NOTIFY capabilities to report to clients that first connect to
-the ManageSieve service, before authentication. These may differ from the
-capabilities offered to authenticated users. If this field is left empty,
-report what the Sieve interpreter supports by default.
-
-Defaults to @samp{'()}.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} space-separated-string-list managesieve-sieve-capability
-Which SIEVE capabilities to report to clients that first connect to
-the ManageSieve service, before authentication. These may differ from the
-capabilities offered to authenticated users. If this field is left empty,
-report what the Sieve interpreter supports by default.
-
-Defaults to @samp{'()}.
-
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} space-separated-string-list mail-plugins
-Space separated list of plugins to load.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} non-negative-integer mail-max-userip-connections
-Maximum number of IMAP connections allowed for a user from each IP
-address. NOTE: The username is compared case-sensitively.
-Defaults to @samp{10}.
-@end deftypevr
-
-@end deftypevr
-
-@deftypevr {@code{dovecot-configuration} parameter} service-configuration-list services
-List of services to enable. Available services include @samp{imap},
-@samp{imap-login}, @samp{pop3}, @samp{pop3-login}, @samp{auth}, and
-@samp{lmtp}.
-
-Available @code{service-configuration} fields are:
-
-@deftypevr {@code{service-configuration} parameter} string kind
-The service kind. Valid values include @code{director},
-@code{imap-login}, @code{pop3-login}, @code{lmtp}, @code{imap},
-@code{pop3}, @code{auth}, @code{auth-worker}, @code{dict},
-@code{tcpwrap}, @code{quota-warning}, or anything else.
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} listener-configuration-list listeners
-Listeners for the service. A listener is either a
-@code{unix-listener-configuration}, a @code{fifo-listener-configuration}, or
-an @code{inet-listener-configuration}.
-Defaults to @samp{'()}.
-
-Available @code{unix-listener-configuration} fields are:
-
-@deftypevr {@code{unix-listener-configuration} parameter} string path
-Path to the file, relative to @code{base-dir} field. This is also used as
-the section name.
-@end deftypevr
-
-@deftypevr {@code{unix-listener-configuration} parameter} string mode
-The access mode for the socket.
-Defaults to @samp{"0600"}.
-@end deftypevr
-
-@deftypevr {@code{unix-listener-configuration} parameter} string user
-The user to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-@deftypevr {@code{unix-listener-configuration} parameter} string group
-The group to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-
-Available @code{fifo-listener-configuration} fields are:
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string path
-Path to the file, relative to @code{base-dir} field. This is also used as
-the section name.
-@end deftypevr
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string mode
-The access mode for the socket.
-Defaults to @samp{"0600"}.
-@end deftypevr
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string user
-The user to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string group
-The group to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-
-Available @code{inet-listener-configuration} fields are:
-
-@deftypevr {@code{inet-listener-configuration} parameter} string protocol
-The protocol to listen for.
-@end deftypevr
-
-@deftypevr {@code{inet-listener-configuration} parameter} string address
-The address on which to listen, or empty for all addresses.
-Defaults to @samp{""}.
-@end deftypevr
-
-@deftypevr {@code{inet-listener-configuration} parameter} non-negative-integer port
-The port on which to listen.
-@end deftypevr
-
-@deftypevr {@code{inet-listener-configuration} parameter} boolean ssl?
-Whether to use SSL for this service; @samp{yes}, @samp{no}, or
-@samp{required}.
-Defaults to @samp{#t}.
-@end deftypevr
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer client-limit
-Maximum number of simultaneous client connections per process. Once
-this number of connections is received, the next incoming connection
-will prompt Dovecot to spawn another process. If set to 0,
-@code{default-client-limit} is used instead.
-
-Defaults to @samp{0}.
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer service-count
-Number of connections to handle before starting a new process.
-Typically the only useful values are 0 (unlimited) or 1. 1 is more
-secure, but 0 is faster. <doc/wiki/LoginProcess.txt>.
-Defaults to @samp{1}.
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer process-limit
-Maximum number of processes that can exist for this service. If set to
-0, @code{default-process-limit} is used instead.
-
-Defaults to @samp{0}.
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer process-min-avail
-Number of processes to always keep waiting for more connections.
-Defaults to @samp{0}.
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer vsz-limit
-If you set @samp{service-count 0}, you probably need to grow
-this.
-Defaults to @samp{256000000}.
-@end deftypevr
+@code{inet-listener} of the specific services you are interested in.
-@end deftypevr
-
-@deftypevr {@code{dovecot-configuration} parameter} dict-configuration dict
+@item @code{dict} (type: dict-configuration)
Dict configuration, as created by the @code{dict-configuration}
constructor.
+@deftp {Data Type} dict-configuration
Available @code{dict-configuration} fields are:
-@deftypevr {@code{dict-configuration} parameter} free-form-fields entries
+@table @asis
+@item @code{entries} (default: @code{'()}) (type: free-form-fields)
A list of key-value pairs that this dict should hold.
-Defaults to @samp{'()}.
-@end deftypevr
-
-@end deftypevr
+@end table
+@end deftp
-@deftypevr {@code{dovecot-configuration} parameter} passdb-configuration-list passdbs
-A list of passdb configurations, each one created by the
+@item @code{passdbs} (type: list-of-passdb-configurations)
+List of passdb configurations, each one created by the
@code{passdb-configuration} constructor.
+@deftp {Data Type} passdb-configuration
Available @code{passdb-configuration} fields are:
-@deftypevr {@code{passdb-configuration} parameter} string driver
-The driver that the passdb should use. Valid values include
-@samp{pam}, @samp{passwd}, @samp{shadow}, @samp{bsdauth}, and
-@samp{static}.
-Defaults to @samp{"pam"}.
-@end deftypevr
+@table @asis
+@item @code{driver} (default: @code{"pam"}) (type: string)
+The driver that the passdb should use. Valid values include @samp{pam},
+@samp{passwd}, @samp{shadow}, @samp{bsdauth}, and @samp{static}.
-@deftypevr {@code{passdb-configuration} parameter} space-separated-string-list args
+@item @code{args} (type: maybe-list-of-strings)
Space separated list of arguments to the passdb driver.
-Defaults to @samp{""}.
-@end deftypevr
-
-@end deftypevr
+@end table
+@end deftp
-@deftypevr {@code{dovecot-configuration} parameter} userdb-configuration-list userdbs
+@item @code{userdbs} (type: list-of-userdb-configurations)
List of userdb configurations, each one created by the
@code{userdb-configuration} constructor.
+@deftp {Data Type} userdb-configuration
Available @code{userdb-configuration} fields are:
-@deftypevr {@code{userdb-configuration} parameter} string driver
+@table @asis
+@item @code{driver} (default: @code{"passwd"}) (type: string)
The driver that the userdb should use. Valid values include
@samp{passwd} and @samp{static}.
-Defaults to @samp{"passwd"}.
-@end deftypevr
-@deftypevr {@code{userdb-configuration} parameter} space-separated-string-list args
+@item @code{args} (type: maybe-list-of-strings)
Space separated list of arguments to the userdb driver.
-Defaults to @samp{""}.
-@end deftypevr
-@deftypevr {@code{userdb-configuration} parameter} free-form-args override-fields
+@item @code{override-fields} (default: @code{'()}) (type: alist)
Override fields from passwd.
-Defaults to @samp{'()}.
-@end deftypevr
-
-@end deftypevr
+@end table
+@end deftp
-@deftypevr {@code{dovecot-configuration} parameter} plugin-configuration plugin-configuration
+@item @code{plugin-configuration} (type: plugin-configuration)
Plug-in configuration, created by the @code{plugin-configuration}
constructor.
-@end deftypevr
-@deftypevr {@code{dovecot-configuration} parameter} list-of-namespace-configuration namespaces
+@item @code{namespaces} (type: list-of-namespace-configurations)
List of namespaces. Each item in the list is created by the
@code{namespace-configuration} constructor.
+@deftp {Data Type} namespace-configuration
Available @code{namespace-configuration} fields are:
-@deftypevr {@code{namespace-configuration} parameter} string name
+@table @asis
+@item @code{name} (type: string)
Name for this namespace.
-@end deftypevr
-@deftypevr {@code{namespace-configuration} parameter} string type
+@item @code{type} (default: @code{"private"}) (type: string)
Namespace type: @samp{private}, @samp{shared} or @samp{public}.
-Defaults to @samp{"private"}.
-@end deftypevr
-@deftypevr {@code{namespace-configuration} parameter} string separator
-Hierarchy separator to use. You should use the same separator for
-all namespaces or some clients get confused. @samp{/} is u
This message was truncated. Download the full message here.
B
B
Bruno Victal wrote on 4 Nov 2023 20:05
[PATCH 2/4] services: dovecot: Add 'reopen action.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
3cf67232f27b28c4b728142f2c2d626b14b337b0.1699124200.git.mirai@makinata.eu
* gnu/services/mail.scm (dovecot-shepherd-service): Re-indent.
Add 'reopen action.

Change-Id: I333032ec6f8a451c22490e27910793410c63a6d6
---
gnu/services/mail.scm | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index b865a67630..0f287ab93e 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington@gmail.com>
;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1575,14 +1576,28 @@ (define (dovecot-shepherd-service config)
(let ((dovecot (if (opaque-dovecot-configuration? config)
(opaque-dovecot-configuration-dovecot config)
(dovecot-configuration-dovecot config))))
- (list (shepherd-service
- (documentation "Run the Dovecot POP3/IMAP mail server.")
- (provision '(dovecot))
- (requirement '(pam networking))
- (start #~(make-forkexec-constructor
- (list #$(file-append dovecot "/sbin/dovecot")
- "-F")))
- (stop #~(make-kill-destructor))))))
+ (list
+ (shepherd-service
+ (documentation "Run the Dovecot POP3/IMAP mail server.")
+ (provision '(dovecot))
+ (requirement '(pam networking))
+ (start #~(make-forkexec-constructor
+ (list #$(file-append dovecot "/sbin/dovecot")
+ "-F")))
+ (stop #~(make-kill-destructor))
+ (actions
+ (list (shepherd-action
+ (name 'reopen)
+ (documentation "Re-open log files.")
+ (procedure
+ #~(lambda (pid)
+ (if pid
+ (begin
+ (kill pid SIGUSR1)
+ (format #t
+ "Issued SIGUSR1 to Service Dovecot (PID ~a)."
+ pid))
+ (format #t "Service Dovecot is not running.")))))))))))
(define %dovecot-pam-services
(list (unix-pam-service "dovecot")))
--
2.41.0
B
B
Bruno Victal wrote on 4 Nov 2023 20:05
[PATCH 1/4] services: dovecot: Use make-kill-destructor for action stop.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
795f0efdf6ad1716a9d3b98589a790855f88391d.1699124200.git.mirai@makinata.eu
* gnu/services/mail.scm (dovecot-shepherd-service): Prefer file-append over
string-append. Prefer shepherd mechanism for issuing stop action.

Change-Id: I6a23fbb70ee4e0a2ba5f8e933e85b97283736f5d
---
gnu/services/mail.scm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

Toggle diff (21 lines)
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 12dcc8e71d..b865a67630 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -1580,12 +1580,9 @@ (define (dovecot-shepherd-service config)
(provision '(dovecot))
(requirement '(pam networking))
(start #~(make-forkexec-constructor
- (list (string-append #$dovecot "/sbin/dovecot")
+ (list #$(file-append dovecot "/sbin/dovecot")
"-F")))
- (stop #~(lambda _
- (invoke #$(file-append dovecot "/sbin/dovecot")
- "stop")
- #f))))))
+ (stop #~(make-kill-destructor))))))
(define %dovecot-pam-services
(list (unix-pam-service "dovecot")))
--
2.41.0
H
H
Herman Rimm wrote on 5 Nov 2023 19:03
Re: [PATCH 4/4] services: dovecot: Fix incorrect type for ssl? field.
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 66935@debbugs.gnu.org)
jctihpw5w6oxjdirloyyko3h7fpff3mgrh6kzh7juwu45xrvdf@gtiak6ijv37d
Guix pull fails with the [PATCH 4/4] commit. It could be because 'ssl? #t' is still used for the inet-listeners in the default dovecot-configuration. By the way, I see that the "required" value can be used for the ssl dovecot core setting, but for the inet-listener this is not specified: https://doc.dovecot.org/configuration_manual/service_configuration/?highlight=inet_listener#ssl.I think changing the ssl? option type from boolean to string should be done for all boolean valued options simultaneously in a separate patch, if at all. Also, can you post any amended patch series in chronological order so it's easier to apply?

Cheers,
Herman Rimm
B
B
Bruno Victal wrote on 6 Nov 2023 15:52
(name . Herman Rimm)(address . herman@rimm.ee)(address . 66935@debbugs.gnu.org)
a58bbf23-199f-4abb-9b35-127f722fc8fb@makinata.eu
Hi Herman,

On 2023-11-05 18:03, Herman Rimm wrote:
Toggle quote (4 lines)
> Guix pull fails with the [PATCH 4/4] commit. It could be because
> 'ssl? #t' is still used for the inet-listeners in the default
> dovecot-configuration.

Oops, this must have passed under the radar due to some stale .go file
issue, nice catch!

Toggle quote (4 lines)
> By the way, I see that the "required" value can be used for the
> ssl dovecot core setting, but for the inet-listener this is not
> specified: https://doc.dovecot.org/configuration_manual/service_configuration/?highlight=inet_listener#ssl.

According to the dovecot link you provided, it isn't clear whether this
'ssl' in the context of inet-listener is a dovecot boolean [1] or is a
string in the same manner like the core ssl setting [2].
I'm afraid the dovecot documentation isn't the clearest here.

Toggle quote (4 lines)
> I think changing the ssl? option type from boolean to string should
> be done for all boolean valued options simultaneously in a separate
> patch, if at all.

Some of the boolean options are really dovecot boolean, it's only
this ssl? field in the inet-listener that is strange.
I think it might be better to leave it for a separate patch as you
have suggested, in that case feel free to discard the 4/4 patch.

Toggle quote (3 lines)
> Also, can you post any amended patch series in chronological order
> so it's easier to apply?

I'm afraid not since this is a limitation of email, there's no
guarantee that emails arrive in the same order that they're sent.



--
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.
C
C
Clément Lassieur wrote on 6 Nov 2023 16:43
Re: [bug#66935] [PATCH 4/4] services: dovecot: Fix incorrect type for ssl? field.
(name . Bruno Victal)(address . mirai@makinata.eu)
87wmuuhoq0.fsf@lassieur.org
On Mon, Nov 06 2023, Bruno Victal wrote:

Toggle quote (18 lines)
>> By the way, I see that the "required" value can be used for the
>> ssl dovecot core setting, but for the inet-listener this is not
>> specified: https://doc.dovecot.org/configuration_manual/service_configuration/?highlight=inet_listener#ssl.
>
> According to the dovecot link you provided, it isn't clear whether this
> 'ssl' in the context of inet-listener is a dovecot boolean [1] or is a
> string in the same manner like the core ssl setting [2].
> I'm afraid the dovecot documentation isn't the clearest here.
>
>> I think changing the ssl? option type from boolean to string should
>> be done for all boolean valued options simultaneously in a separate
>> patch, if at all.
>
> Some of the boolean options are really dovecot boolean, it's only
> this ssl? field in the inet-listener that is strange.
> I think it might be better to leave it for a separate patch as you
> have suggested, in that case feel free to discard the 4/4 patch.

Indeed the inet_listener ssl is a BOOL, as code says, whereas the master
one is an ENUM. So the actual guix service looks correct.

The code for the master setting:

Toggle snippet (60 lines)
static const struct setting_define master_setting_defines[] = {
DEF(STR, base_dir),
DEF(STR, state_dir),
DEF(STR, libexec_dir),
DEF(STR, instance_name),
DEF(STR, protocols),
DEF(STR, listen),
DEF(ENUM, ssl),
DEF(STR, default_internal_user),
DEF(STR, default_internal_group),
DEF(STR, default_login_user),
DEF(UINT, default_process_limit),
DEF(UINT, default_client_limit),
DEF(TIME, default_idle_kill),
DEF(SIZE, default_vsz_limit),

DEF(BOOL, version_ignore),

DEF(UINT, first_valid_uid),
DEF(UINT, last_valid_uid),
DEF(UINT, first_valid_gid),
DEF(UINT, last_valid_gid),

DEFLIST_UNIQUE(services, "service", &service_setting_parser_info),

SETTING_DEFINE_LIST_END
};

static const struct master_settings master_default_settings = {
.base_dir = PKG_RUNDIR,
.state_dir = PKG_STATEDIR,
.libexec_dir = PKG_LIBEXECDIR,
.instance_name = PACKAGE,
.protocols = "imap pop3 lmtp",
.listen = "*, ::",
.ssl = "yes:no:required",
.default_internal_user = "dovecot",
.default_internal_group = "dovecot",
.default_login_user = "dovenull",
.default_process_limit = 100,
.default_client_limit = 1000,
.default_idle_kill = 60,
.default_vsz_limit = 256*1024*1024,

.version_ignore = FALSE,

.first_valid_uid = 500,
.last_valid_uid = 0,
.first_valid_gid = 1,
.last_valid_gid = 0,

#ifndef CONFIG_BINARY
.services = ARRAY_INIT
#else
.services = { { &config_all_services_buf,
sizeof(struct service_settings *) } },
#endif
};

The code for the inet_listener setting:

Toggle snippet (12 lines)
static const struct setting_define inet_listener_setting_defines[] = {
DEF(STR, name),
DEF(STR, address),
DEF(IN_PORT, port),
DEF(BOOL, ssl),
DEF(BOOL, reuse_port),
DEF(BOOL, haproxy),

SETTING_DEFINE_LIST_END
};

Cheers,
Clément
C
C
Clément Lassieur wrote on 6 Nov 2023 22:36
(name . Bruno Victal)(address . mirai@makinata.eu)
87jzquef98.fsf@lassieur.org
On Mon, Nov 06 2023, Bruno Victal wrote:

Toggle quote (6 lines)
>> Also, can you post any amended patch series in chronological order
>> so it's easier to apply?
>
> I'm afraid not since this is a limitation of email, there's no
> guarantee that emails arrive in the same order that they're sent.

I don't know your workflow to apply patches but you can probably sort
them by subject? (C-c C-s C-s with Gnus) It's quite reliable. More
than depending on the time they are sent.
B
B
Bruno Victal wrote on 7 Nov 2023 15:52
(name . Clément Lassieur)(address . clement@lassieur.org)
e6db42f4-b4c3-44bc-9b5f-2faa84aa96aa@makinata.eu
Hi Clément,

On 2023-11-06 15:43, Clément Lassieur wrote:
Toggle quote (3 lines)
> Indeed the inet_listener ssl is a BOOL, as code says, whereas the master
> one is an ENUM. So the actual guix service looks correct.

[…]

Toggle quote (15 lines)
> The code for the inet_listener setting:
>
> --8<---------------cut here---------------start------------->8---
> static const struct setting_define inet_listener_setting_defines[] = {
> DEF(STR, name),
> DEF(STR, address),
> DEF(IN_PORT, port),
> DEF(BOOL, ssl),
> DEF(BOOL, reuse_port),
> DEF(BOOL, haproxy),
>
> SETTING_DEFINE_LIST_END
> };
> --8<---------------cut here---------------end--------------->8---

Thanks for looking into this.
In that case, the description of the ssl? field in
inet-listener-configuration should be fixed then. I'll send a v2
for it.

--
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.
B
B
Bruno Victal wrote on 7 Nov 2023 16:04
[PATCH v2 2/4] services: dovecot: Add 'reopen action.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
9d21fd72e0b3ca36325fa79872bcbd07bd330f0a.1699369492.git.mirai@makinata.eu
* gnu/services/mail.scm (dovecot-shepherd-service): Re-indent.
Add 'reopen action.

Change-Id: I333032ec6f8a451c22490e27910793410c63a6d6
---
gnu/services/mail.scm | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index b865a67630..0f287ab93e 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington@gmail.com>
;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1575,14 +1576,28 @@ (define (dovecot-shepherd-service config)
(let ((dovecot (if (opaque-dovecot-configuration? config)
(opaque-dovecot-configuration-dovecot config)
(dovecot-configuration-dovecot config))))
- (list (shepherd-service
- (documentation "Run the Dovecot POP3/IMAP mail server.")
- (provision '(dovecot))
- (requirement '(pam networking))
- (start #~(make-forkexec-constructor
- (list #$(file-append dovecot "/sbin/dovecot")
- "-F")))
- (stop #~(make-kill-destructor))))))
+ (list
+ (shepherd-service
+ (documentation "Run the Dovecot POP3/IMAP mail server.")
+ (provision '(dovecot))
+ (requirement '(pam networking))
+ (start #~(make-forkexec-constructor
+ (list #$(file-append dovecot "/sbin/dovecot")
+ "-F")))
+ (stop #~(make-kill-destructor))
+ (actions
+ (list (shepherd-action
+ (name 'reopen)
+ (documentation "Re-open log files.")
+ (procedure
+ #~(lambda (pid)
+ (if pid
+ (begin
+ (kill pid SIGUSR1)
+ (format #t
+ "Issued SIGUSR1 to Service Dovecot (PID ~a)."
+ pid))
+ (format #t "Service Dovecot is not running.")))))))))))
(define %dovecot-pam-services
(list (unix-pam-service "dovecot")))
--
2.41.0
B
B
Bruno Victal wrote on 7 Nov 2023 16:04
[PATCH v2 4/4] services: dovecot: Fix ssl? description in inet-listener-configuration.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
438ed9ecb8a4ed5c3a9852e0a1ce95ae9d701055.1699369492.git.mirai@makinata.eu
References:

* gnu/services/mail.scm (inet-listener-configuration)[ssl?]: Fix description.
* doc/guix.texi: Update it.

Change-Id: I3df9911b94ac81a16c564307c96f11f21f3bb548
---
doc/guix.texi | 3 +--
gnu/services/mail.scm | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)

Toggle diff (30 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 778fd84124..5a2cb1318c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -26675,8 +26675,7 @@ Mail Services
The port on which to listen.
@item @code{ssl?} (default: @code{#t}) (type: boolean)
-Whether to use SSL for this service; @samp{yes}, @samp{no}, or
-@samp{required}.
+Whether to use SSL for this service.
@end table
@end deftp
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index d4b050f73e..41041bc9e4 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -270,8 +270,7 @@ (define-configuration inet-listener-configuration
"The port on which to listen.")
(ssl?
(boolean #t)
- "Whether to use SSL for this service; @samp{yes}, @samp{no}, or
-@samp{required}."))
+ "Whether to use SSL for this service."))
(define (listener-configuration? value)
(or (unix-listener-configuration? value)
--
2.41.0
B
B
Bruno Victal wrote on 7 Nov 2023 16:04
[PATCH v2 3/4] services: dovecot: Refactor serialization process.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
f7f415acd2a567a083c6c35e6a9b6b4c88829f75.1699369492.git.mirai@makinata.eu
This commit refactors the dovecot serialization process to express the values
to be serialized as G-Exps instead. String values are now properly serialized
according to dovecot.conf syntax rules. [1]
The documentation was also revised and regenerated.


* gnu/services/mail.scm: Reorganize dovecot related procedures.
(uglify-field-name): Simplify.
(escape-string, make-serialize-list-with-delimiter, serialize-list-of-strings)
(serialize-alist, make-serialize-section, make-serialize-list-of-sections)
(serialize-section-name, serialize-list-of-passdb-configurations)
(serialize-list-of-userdb-configurations)
(serialize-list-of-listener-configurations)
(serialize-list-of-service-configurations)
(serialize-list-of-protocol-configurations)
(serialize-list-of-mailbox-configurations)
(serialize-list-of-namespace-configurations)
(dovecot-configuration->file): New procedure.
(serialize-field, serialize-string, serialize-non-negative-integer)
(serialize-boolean, free-form-fields?, serialize-free-form-fields)
(serialize-dict-configuration, listener-configuration?)
(serialize-listener-configuration, serialize-protocol-configuration)
(serialize-plugin-configuration, serialize-mailbox-configuration): Refactor.
(list-of-passdb-configurations?, list-of-userdb-configurations?)
(list-of-listener-configurations?, list-of-service-configurations?)
(list-of-protocol-configurations?, list-of-mailbox-configurations?)
(list-of-namespace-configurations?): New predicate.
(space-separated-string-list?, comma-separated-string-list?, file-name?)
(colon-separated-file-name-list?, free-form-args?)
(passdb-configuration-list?, userdb-configuration-list?)
(listener-configuration-list?, service-configuration-list?)
(protocol-configuration-list?, mailbox-configuration-list?)
(list-of-namespace-configuration?): Remove predicate.
(serialize-space-separated-string-list, serialize-comma-separated-string-list)
(serialize-colon-separated-file-name-list, serialize-free-form-args)
(serialize-passdb-configuration, serialize-passdb-configuration-list)
(serialize-userdb-configuration, serialize-userdb-configuration-list)
(serialize-unix-listener-configuration, serialize-fifo-listener-configuration)
(serialize-inet-listener-configuration, serialize-listener-configuration-list)
(serialize-service-configuration, serialize-service-configuration-list)
(serialize-protocol-configuration-list, serialize-mailbox-configuration-list)
(serialize-namespace-configuration)
(serialize-list-of-namespace-configuration): Remove procedure.
(hours?): Remove unused predicate, leftovers from
28c03b4555e99da9524c697f5eba3783916050c7.
(serialize-hours): Likewise.
(unix-listener-configuration, fifo-listener-configuration): Deduplicate
definition with a let-syntax macro.
(passdb-configuration)[args]: Set value type to maybe-list-of-strings.
(userdb-configuration)[args]: Likewise.
[override-fields]: Set value type to alist.
(unix-listener-configuration, fifo-listener-configuration)[path]: Remove
redundant error guard.
(inet-listener-configuration)[protocol, port]: Likewise.
(service-configuration)[kind]: Likewise. Set serializing procedure to
serialize-section-name.
[listeners]: Set value type to list-of-listener-configurations.
(protocol-configuration)[name]: Remove redundant error guard.
[mail-plugins]: Set value type to list-of-strings.
[managesieve-notify-capability, managesieve-sieve-capability]: Set value type
to maybe-list-of-strings.
(mailbox-configuration)[name]: Remove redundant error guard.
[special-use]: : Set value type to maybe-list-of-strings.
(namespace-configuration)[name]: Remove redundant error guard.
[location, hidden?, subscriptions?]: Fix documentation.
[mailboxes]: Set value type to list-of-mailbox-configurations.
(dovecot-configuration)[listen]: Set value type to list-of-strings. Serialize
this using comma as the delimiter.
[passdbs, userdbs]: Simplify default value.
[namespaces]: Set value type to list-of-namespace-configurations.
[base-dir, auth-winbind-helper-path, mail-temp-dir, auth-socket-path]
[mail-plugin-dir, sendmail-path]: Set value type to string.
[login-trusted-networks, director-servers, director-mail-servers]
[imap-client-workarounds]: Set value type to maybe-list-of-strings.
[doveadm-socket-path, auth-cache-size, auth-cache-ttl]
[auth-cache-negative-ttl, auth-realms, auth-master-user-separator]
[auth-anonymous-username, director-servers, director-mail-servers]
[info-log-path, debug-log-path, syslog-facility, auth-verbose-passwords]
[auth-debug-passwords?, login-log-format, mail-location]
[mail-privileged-group, mail-access-groups, mail-full-filesystem-access?]
[mmap-disable?, dotlock-use-excl?, mail-fsync, lock-method, first-valid-uid]
[mail-chroot, mail-plugins, mail-save-crlf?, maildir-stat-dirs?]
[mbox-read-locks, mbox-very-dirty-syncs?, mail-attachment-dir]
[ssl-crypto-device, lda-mailbox-autocreate?]
[lda-mailbox-autosubscribe?]: Fix documentation.
[import-environment, auth-mechanisms, login-log-format-elements]
[mail-plugins, mbox-read-locks, mbox-write-locks]: Set value type to
list-of-strings.
[log-timestamp, mail-log-prefix]: Reflect changes from escape-string, remove
extraneous quotes.
[valid-chroot-dirs]: Refactor documentation. Serialize this using colon as the
delimiter.
[protocols]: Set value type to list-of-protocol-configurations.
[services]: Set value type to list-of-service-configurations. Re-style.
(opaque-dovecot-configuration)[string]: Remove redundant error guard.
(%dovecot-activation): Refactor to use 'dovecot-configuration->file' for
serializing dovecot.conf.
(dovecot-service-type): Re-style.
* doc/guix.texi: Regenerate it. Remove example using deprecated
'dovecot-service' procedure.

Change-Id: I8d18c504c5cd80497a069f28c1c6975538510e7e
---
doc/guix.texi | 1613 ++++++++++++++++-------------------------
gnu/services/mail.scm | 870 +++++++++++-----------
2 files changed, 1083 insertions(+), 1400 deletions(-)

Toggle diff (370 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 9f06f1c325..778fd84124 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25658,9 +25658,11 @@ Mail Services
@cindex mail
@cindex email
The @code{(gnu services mail)} module provides Guix service definitions
-for email services: IMAP, POP3, and LMTP servers, as well as mail
-transport agents (MTAs). Lots of acronyms! These services are detailed
-in the subsections below.
+for email services: @acronym{IMAP, Internet Message Access Protocol},
+@acronym{POP3, Post Office Protocol version 3}, and @acronym{LMTP,
+Local Mail Transfer Protocol} servers, as well as @acronym{MTA,
+transport agent}s. Lots of acronyms! These services are detailed in
+the subsections below.
@subsubheading Dovecot Service
@@ -25678,8 +25680,11 @@ Mail Services
and as is the case with other services, Guix allows the system
administrator to specify these parameters via a uniform Scheme interface.
-For example, to specify that mail is located at @code{maildir~/.mail},
-one would instantiate the Dovecot service like this:
+For example, to specify that the mail location is a
+maildir@footnote{A mailbox format, see
+@url{https://manpages.debian.org/stretch/qmail/maildir.5.en.html}.}
+located at @file{~/.mail}, one would instantiate the Dovecot service
+like this:
@lisp
(service dovecot-service-type
@@ -25687,10 +25692,8 @@ Mail Services
(mail-location "maildir:~/.mail")))
@end lisp
-The available configuration parameters follow. Each parameter
-definition is preceded by its type; for example, @samp{string-list foo}
-indicates that the @code{foo} parameter should be specified as a list of
-strings. There is also a way to specify the configuration as a string,
+The available configuration parameters follow.
+There is also a way to specify the configuration as a string,
if you have an old @code{dovecot.conf} file that you want to port over
from some other system; see the end for more details.
@@ -25702,688 +25705,378 @@ Mail Services
@c (generate-documentation) than to make it below and have to deal with
@c the churn as dovecot updates.
+@c %start of fragment
+@deftp {Data Type} dovecot-configuration
Available @code{dovecot-configuration} fields are:
-@deftypevr {@code{dovecot-configuration} parameter} package dovecot
+@table @asis
+@item @code{dovecot} (default: @code{dovecot}) (type: file-like)
The dovecot package.
-@end deftypevr
-@deftypevr {@code{dovecot-configuration} parameter} comma-separated-string-list listen
-A list of IPs or hosts where to listen for connections. @samp{*}
-listens on all IPv4 interfaces, @samp{::} listens on all IPv6
+@item @code{listen} (default: @code{("*" "::")}) (type: list-of-strings)
+A list of IPs or hosts where to listen in for connections. @samp{*}
+listens in all IPv4 interfaces, @samp{::} listens in all IPv6
interfaces. If you want to specify non-default ports or anything more
complex, customize the address and port fields of the
-@samp{inet-listener} of the specific services you are interested in.
-@end deftypevr
-
-@deftypevr {@code{dovecot-configuration} parameter} protocol-configuration-list protocols
-List of protocols we want to serve. Available protocols include
-@samp{imap}, @samp{pop3}, and @samp{lmtp}.
-
-Available @code{protocol-configuration} fields are:
-
-@deftypevr {@code{protocol-configuration} parameter} string name
-The name of the protocol.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} string auth-socket-path
-UNIX socket path to the master authentication server to find users.
-This is used by imap (for shared users) and lda.
-It defaults to @samp{"/var/run/dovecot/auth-userdb"}.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} boolean imap-metadata?
-Whether to enable the @code{IMAP METADATA} extension as defined in
-@uref{https://tools.ietf.org/html/rfc5464,RFC@tie{}5464}, which provides
-a means for clients to set and retrieve per-mailbox, per-user metadata
-and annotations over IMAP.
-
-If this is @samp{#t}, you must also specify a dictionary @i{via} the
-@code{mail-attribute-dict} setting.
-
-Defaults to @samp{#f}.
-
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} space-separated-string-list managesieve-notify-capabilities
-Which NOTIFY capabilities to report to clients that first connect to
-the ManageSieve service, before authentication. These may differ from the
-capabilities offered to authenticated users. If this field is left empty,
-report what the Sieve interpreter supports by default.
-
-Defaults to @samp{'()}.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} space-separated-string-list managesieve-sieve-capability
-Which SIEVE capabilities to report to clients that first connect to
-the ManageSieve service, before authentication. These may differ from the
-capabilities offered to authenticated users. If this field is left empty,
-report what the Sieve interpreter supports by default.
-
-Defaults to @samp{'()}.
-
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} space-separated-string-list mail-plugins
-Space separated list of plugins to load.
-@end deftypevr
-
-@deftypevr {@code{protocol-configuration} parameter} non-negative-integer mail-max-userip-connections
-Maximum number of IMAP connections allowed for a user from each IP
-address. NOTE: The username is compared case-sensitively.
-Defaults to @samp{10}.
-@end deftypevr
-
-@end deftypevr
-
-@deftypevr {@code{dovecot-configuration} parameter} service-configuration-list services
-List of services to enable. Available services include @samp{imap},
-@samp{imap-login}, @samp{pop3}, @samp{pop3-login}, @samp{auth}, and
-@samp{lmtp}.
-
-Available @code{service-configuration} fields are:
-
-@deftypevr {@code{service-configuration} parameter} string kind
-The service kind. Valid values include @code{director},
-@code{imap-login}, @code{pop3-login}, @code{lmtp}, @code{imap},
-@code{pop3}, @code{auth}, @code{auth-worker}, @code{dict},
-@code{tcpwrap}, @code{quota-warning}, or anything else.
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} listener-configuration-list listeners
-Listeners for the service. A listener is either a
-@code{unix-listener-configuration}, a @code{fifo-listener-configuration}, or
-an @code{inet-listener-configuration}.
-Defaults to @samp{'()}.
-
-Available @code{unix-listener-configuration} fields are:
-
-@deftypevr {@code{unix-listener-configuration} parameter} string path
-Path to the file, relative to @code{base-dir} field. This is also used as
-the section name.
-@end deftypevr
-
-@deftypevr {@code{unix-listener-configuration} parameter} string mode
-The access mode for the socket.
-Defaults to @samp{"0600"}.
-@end deftypevr
-
-@deftypevr {@code{unix-listener-configuration} parameter} string user
-The user to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-@deftypevr {@code{unix-listener-configuration} parameter} string group
-The group to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-
-Available @code{fifo-listener-configuration} fields are:
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string path
-Path to the file, relative to @code{base-dir} field. This is also used as
-the section name.
-@end deftypevr
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string mode
-The access mode for the socket.
-Defaults to @samp{"0600"}.
-@end deftypevr
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string user
-The user to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-@deftypevr {@code{fifo-listener-configuration} parameter} string group
-The group to own the socket.
-Defaults to @samp{""}.
-@end deftypevr
-
-
-Available @code{inet-listener-configuration} fields are:
-
-@deftypevr {@code{inet-listener-configuration} parameter} string protocol
-The protocol to listen for.
-@end deftypevr
-
-@deftypevr {@code{inet-listener-configuration} parameter} string address
-The address on which to listen, or empty for all addresses.
-Defaults to @samp{""}.
-@end deftypevr
-
-@deftypevr {@code{inet-listener-configuration} parameter} non-negative-integer port
-The port on which to listen.
-@end deftypevr
-
-@deftypevr {@code{inet-listener-configuration} parameter} boolean ssl?
-Whether to use SSL for this service; @samp{yes}, @samp{no}, or
-@samp{required}.
-Defaults to @samp{#t}.
-@end deftypevr
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer client-limit
-Maximum number of simultaneous client connections per process. Once
-this number of connections is received, the next incoming connection
-will prompt Dovecot to spawn another process. If set to 0,
-@code{default-client-limit} is used instead.
-
-Defaults to @samp{0}.
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer service-count
-Number of connections to handle before starting a new process.
-Typically the only useful values are 0 (unlimited) or 1. 1 is more
-secure, but 0 is faster. <doc/wiki/LoginProcess.txt>.
-Defaults to @samp{1}.
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer process-limit
-Maximum number of processes that can exist for this service. If set to
-0, @code{default-process-limit} is used instead.
-
-Defaults to @samp{0}.
-
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer process-min-avail
-Number of processes to always keep waiting for more connections.
-Defaults to @samp{0}.
-@end deftypevr
-
-@deftypevr {@code{service-configuration} parameter} non-negative-integer vsz-limit
-If you set @samp{service-count 0}, you probably need to grow
-this.
-Defaults to @samp{256000000}.
-@end deftypevr
+@code{inet-listener} of the specific services you are interested in.
-@end deftypevr
-
-@deftypevr {@code{dovecot-configuration} parameter} dict-configuration dict
+@item @code{dict} (type: dict-configuration)
Dict configuration, as created by the @code{dict-configuration}
constructor.
+@deftp {Data Type} dict-configuration
Available @code{dict-configuration} fields are:
-@deftypevr {@code{dict-configuration} parameter} free-form-fields entries
+@table @asis
+@item @code{entries} (default: @code{'()}) (type: free-form-fields)
A list of key-value pairs that this dict should hold.
-Defaults to @samp{'()}.
-@end deftypevr
-
-@end deftypevr
+@end table
+@end deftp
-@deftypevr {@code{dovecot-configuration} parameter} passdb-configuration-list passdbs
-A list of passdb configurations, each one created by the
+@item @code{passdbs} (type: list-of-passdb-configurations)
+List of passdb configurations, each one created by the
@code{passdb-configuration} constructor.
+@deftp {Data Type} passdb-configuration
Available @code{passdb-configuration} fields are:
-@deftypevr {@code{passdb-configuration} parameter} string driver
-The driver that the passdb should use. Valid values include
-@samp{pam}, @samp{passwd}, @samp{shadow}, @samp{bsdauth}, and
-@samp{static}.
-Defaults to @samp{"pam"}.
-@end deftypevr
+@table @asis
+@item @code{driver} (default: @code{"pam"}) (type: string)
+The driver that the passdb should use. Valid values include @samp{pam},
+@samp{passwd}, @samp{shadow}, @samp{bsdauth}, and @samp{static}.
-@deftypevr {@code{passdb-configuration} parameter} space-separated-string-list args
+@item @code{args} (type: maybe-list-of-strings)
Space separated list of arguments to the passdb driver.
-Defaults to @samp{""}.
-@end deftypevr
-
-@end deftypevr
+@end table
+@end deftp
-@deftypevr {@code{dovecot-configuration} parameter} userdb-configuration-list userdbs
+@item @code{userdbs} (type: list-of-userdb-configurations)
List of userdb configurations, each one created by the
@code{userdb-configuration} constructor.
+@deftp {Data Type} userdb-configuration
Available @code{userdb-configuration} fields are:
-@deftypevr {@code{userdb-configuration} parameter} string driver
+@table @asis
+@item @code{driver} (default: @code{"passwd"}) (type: string)
The driver that the userdb should use. Valid values include
@samp{passwd} and @samp{static}.
-Defaults to @samp{"passwd"}.
-@end deftypevr
-@deftypevr {@code{userdb-configuration} parameter} space-separated-string-list args
+@item @code{args} (type: maybe-list-of-strings)
Space separated list of arguments to the userdb driver.
-Defaults to @samp{""}.
-@end deftypevr
-@deftypevr {@code{userdb-configuration} parameter} free-form-args override-fields
+@item @code{override-fields} (default: @code{'()}) (type: alist)
Override fields from passwd.
-Defaults to @samp{'()}.
-@end deftypevr
-
-@end deftypevr
+@end table
+@end deftp
-@deftypevr {@code{dovecot-configuration} parameter} plugin-configuration plugin-configuration
+@item @code{plugin-configuration} (type: plugin-configuration)
Plug-in configuration, created by the @code{plugin-configuration}
constructor.
-@end deftypevr
-@deftypevr {@code{dovecot-configuration} parameter} list-of-namespace-configuration namespaces
+@item @code{namespaces} (type: list-of-namespace-configurations)
List of namespaces. Each item in the list is created by the
@code{namespace-configuration} constructor.
+@deftp {Data Type} namespace-configuration
Available @code{namespace-configuration} fields are:
-@deftypevr {@code{namespace-configuration} parameter} string name
+@table @asis
+@item @code{name} (type: string)
Name for this namespace.
-@end deftypevr
-@deftypevr {@code{namespace-configuration} parameter} string type
+@item @code{type} (default: @code{"private"}) (type: string)
Namespace type: @samp{private}, @samp{shared} or @samp{public}.
-Defaults to @samp{"private"}.
-@end deftypevr
-@deftypevr {@code{namespace-configuration} parameter} string separator
-Hierarchy separator to use. You should use the same separator for
-all namespaces or some clients get confused. @samp{/} is u
This message was truncated. Download the full message here.
B
B
Bruno Victal wrote on 7 Nov 2023 16:04
[PATCH v2 1/4] services: dovecot: Use make-kill-destructor for action stop.
(address . 66935@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
2636b2830120d4f02ba2011d363fd8e5296e4bfd.1699369492.git.mirai@makinata.eu
* gnu/services/mail.scm (dovecot-shepherd-service): Prefer file-append over
string-append. Prefer shepherd mechanism for issuing stop action.

Change-Id: I6a23fbb70ee4e0a2ba5f8e933e85b97283736f5d
---
gnu/services/mail.scm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 12dcc8e71d..b865a67630 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -1580,12 +1580,9 @@ (define (dovecot-shepherd-service config)
(provision '(dovecot))
(requirement '(pam networking))
(start #~(make-forkexec-constructor
- (list (string-append #$dovecot "/sbin/dovecot")
+ (list #$(file-append dovecot "/sbin/dovecot")
"-F")))
- (stop #~(lambda _
- (invoke #$(file-append dovecot "/sbin/dovecot")
- "stop")
- #f))))))
+ (stop #~(make-kill-destructor))))))
(define %dovecot-pam-services
(list (unix-pam-service "dovecot")))

base-commit: fb46c1cedab5d00e6afac46bfa514094d5c9e13f
--
2.41.0
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 66935@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66935
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch