guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#42899] [PATCH v2 06/10] services: dovecot: Only serialize settings


From: Alexey Abramov
Subject: [bug#42899] [PATCH v2 06/10] services: dovecot: Only serialize settings with non-empty values.
Date: Tue, 18 Aug 2020 14:00:34 +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 <levenson@mmer.org>
---
 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 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)
-- 
2.27.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]