diff mbox series

[bug#42899,v4,4/8] services: dovecot: Only serialize settings with non-empty values.

Message ID 20200908135348.18551-4-levenson@mmer.org
State New
Headers show
Series [bug#42899,v4,1/8] gnu: dovecot: Set moduledir to global directory. | expand

Commit Message

Alexey Abramov Sept. 8, 2020, 1:53 p.m. UTC
* gnu/services/mail.scm (serialize-space-separated-string-list): Protocols
might have custom settings, which are not supported by other protocols. To
prevent dovecot/services from crashing, serialize settings that hold non-empty
values only.
---
 gnu/services/mail.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index a3c48bdb99..6e166af2be 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -99,7 +99,9 @@ 
                   (and (string? x) (not (string-index x #\space))))
                 val)))
 (define (serialize-space-separated-string-list field-name val)
-  (serialize-field field-name (string-join val " ")))
+  (match val
+    (() #f)
+    (_ (serialize-field field-name (string-join val " ")))))
 
 (define (comma-separated-string-list? val)
   (and (list? val)