summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan (janneke) Nieuwenhuizen <janneke@gnu.org>2020-08-10 07:55:38 +0200
committerRicardo Wurmus <rekado@elephly.net>2023-09-07 15:45:17 +0200
commit3349e7c690302d4065261e3a44571a97b340ce32 (patch)
tree7efa7a702e4ba75ab4f134bfbc872a6aec93e66e
parentc52328776531a149ec78859c647942d5804be014 (diff)
service: postfix: Use mail-aliases-service-type.
* gnu/services/mail.scm (postfix-service-type): Extend mail-aliases-service-type. (postfix-shepherd-service): Generate /etc/aliases.db if necessary.
-rw-r--r--gnu/services/mail.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index e533569c88d..fe8ed224696 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -6,6 +6,7 @@
6;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington@gmail.com> 6;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington@gmail.com>
7;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de> 7;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
8;;; Copyright © 2020 Gábor Boskovits <boskovits@gmail.com> 8;;; Copyright © 2020 Gábor Boskovits <boskovits@gmail.com>
9;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
9;;; 10;;;
10;;; This file is part of GNU Guix. 11;;; This file is part of GNU Guix.
11;;; 12;;;
@@ -2112,9 +2113,17 @@ inet_protocols = ipv4
2112 (match-record config <postfix-configuration> 2113 (match-record config <postfix-configuration>
2113 (postfix) 2114 (postfix)
2114 (let* ((postfix-binary (file-append postfix "/postfix")) 2115 (let* ((postfix-binary (file-append postfix "/postfix"))
2116 (postalias-binary (file-append postfix "/postalias"))
2115 (postfix-action 2117 (postfix-action
2116 (lambda (action) 2118 (lambda (action)
2117 #~(lambda _ 2119 #~(lambda _
2120 (when (or (not (file-exists? "/etc/aliases.db"))
2121 (> (stat:mtime (stat "/etc/aliases"))
2122 (stat:mtime (stat "/etc/aliases.db"))))
2123 (invoke #$postalias-binary
2124 "-c"
2125 #$(postfix-configuration-directory config)
2126 "/etc/aliases"))
2118 (invoke #$postfix-binary "-c" 2127 (invoke #$postfix-binary "-c"
2119 #$(postfix-configuration-directory config) 2128 #$(postfix-configuration-directory config)
2120 #$action))))) 2129 #$action)))))
@@ -2130,6 +2139,7 @@ inet_protocols = ipv4
2130 (name 'postfix) 2139 (name 'postfix)
2131 (extensions (list (service-extension account-service-type postfix-accounts) 2140 (extensions (list (service-extension account-service-type postfix-accounts)
2132 (service-extension activation-service-type postfix-activation) 2141 (service-extension activation-service-type postfix-activation)
2133 (service-extension shepherd-root-service-type postfix-shepherd-service))) 2142 (service-extension shepherd-root-service-type postfix-shepherd-service)
2143 (service-extension mail-aliases-service-type (const '()))))
2134 (description "Run the Postfix MTA.") 2144 (description "Run the Postfix MTA.")
2135 (default-value (postfix-configuration)))) 2145 (default-value (postfix-configuration))))