services: Add mail-aliases-service-type.
* gnu/services/mail.scm (mail-aliases-etc): New procedure. (mail-aliases-service-type): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
e162050dfc
commit
8d17cf1c2f
|
@ -35,6 +35,7 @@
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:use-module (ice-9 format)
|
#:use-module (ice-9 format)
|
||||||
|
#:use-module (srfi srfi-1)
|
||||||
#:export (dovecot-service
|
#:export (dovecot-service
|
||||||
dovecot-service-type
|
dovecot-service-type
|
||||||
dovecot-configuration
|
dovecot-configuration
|
||||||
|
@ -57,6 +58,8 @@
|
||||||
opensmtpd-service-type
|
opensmtpd-service-type
|
||||||
%default-opensmtpd-config-file
|
%default-opensmtpd-config-file
|
||||||
|
|
||||||
|
mail-aliases-service-type
|
||||||
|
|
||||||
exim-configuration
|
exim-configuration
|
||||||
exim-configuration?
|
exim-configuration?
|
||||||
exim-service-type
|
exim-service-type
|
||||||
|
@ -1660,6 +1663,31 @@ accept from local for any relay
|
||||||
(service-extension shepherd-root-service-type
|
(service-extension shepherd-root-service-type
|
||||||
opensmtpd-shepherd-service)))))
|
opensmtpd-shepherd-service)))))
|
||||||
|
|
||||||
|
|
||||||
|
;;;
|
||||||
|
;;; mail aliases.
|
||||||
|
;;;
|
||||||
|
|
||||||
|
(define (mail-aliases-etc aliases)
|
||||||
|
`(("aliases" ,(plain-file "aliases"
|
||||||
|
;; Ideally we'd use a format string like
|
||||||
|
;; "~:{~a: ~{~a~^,~}\n~}", but it gives a
|
||||||
|
;; warning that I can't figure out how to fix,
|
||||||
|
;; so we'll just use string-join below instead.
|
||||||
|
(format #f "~:{~a: ~a\n~}"
|
||||||
|
(map (match-lambda
|
||||||
|
((alias addresses ...)
|
||||||
|
(list alias (string-join addresses ","))))
|
||||||
|
aliases))))))
|
||||||
|
|
||||||
|
(define mail-aliases-service-type
|
||||||
|
(service-type
|
||||||
|
(name 'mail-aliases)
|
||||||
|
(extensions
|
||||||
|
(list (service-extension etc-service-type mail-aliases-etc)))
|
||||||
|
(compose concatenate)
|
||||||
|
(extend append)))
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; Exim.
|
;;; Exim.
|
||||||
|
|
Loading…
Reference in New Issue