Subject: [bug#42899] [PATCH 06/10] services: dovecot: Only serialize settings with non-empty values.

From: Alexey Abramov <[email-masked]>
Date: Mon, 17 Aug 2020 11:31:20 +0200

* 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.

Signed-off-by: Alexey Abramov <[email-masked]>
---
 gnu/services/mail.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 5959d878e7..1d5d322a53 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)
-- 
2.27.0