services: dovecot: Only serialize settings with non-empty values.

* 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: Tobias Geerinckx-Rice <me@tobias.gr>
This commit is contained in:
Alexey Abramov 2020-09-08 15:53:44 +02:00 committed by Tobias Geerinckx-Rice
parent dce464e940
commit a16400919f
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -99,7 +99,9 @@ (define (space-separated-string-list? val)
(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)