mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-20 06:37:08 +01:00
services: opensmtpd: Use 'match-record' instead of 'match'.
* gnu/services/mail.scm (opensmtpd-shepherd-service) (opensmtpd-activation) (opensmtpd-set-gids): Use 'match-record' instead of 'match'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
2880dc3046
commit
3011e8ae11
1 changed files with 57 additions and 60 deletions
|
@ -1666,9 +1666,8 @@ (define %default-opensmtpd-config-file
|
|||
match from local for any action outbound
|
||||
"))
|
||||
|
||||
(define opensmtpd-shepherd-service
|
||||
(match-lambda
|
||||
(($ <opensmtpd-configuration> package config-file)
|
||||
(define (opensmtpd-shepherd-service config)
|
||||
(match-record config <opensmtpd-configuration> (package config-file)
|
||||
(list (shepherd-service
|
||||
(provision '(smtpd))
|
||||
(requirement '(loopback))
|
||||
|
@ -1677,7 +1676,7 @@ (define opensmtpd-shepherd-service
|
|||
#~(make-forkexec-constructor
|
||||
(list #$smtpd "-f" #$config-file)
|
||||
#:pid-file "/var/run/smtpd.pid")))
|
||||
(stop #~(make-kill-destructor)))))))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define %opensmtpd-accounts
|
||||
(list (user-group
|
||||
|
@ -1698,9 +1697,8 @@ (define %opensmtpd-accounts
|
|||
(home-directory "/var/empty")
|
||||
(shell (file-append shadow "/sbin/nologin")))))
|
||||
|
||||
(define opensmtpd-activation
|
||||
(match-lambda
|
||||
(($ <opensmtpd-configuration> package config-file)
|
||||
(define (opensmtpd-activation config)
|
||||
(match-record config <opensmtpd-configuration> (package config-file)
|
||||
(let ((smtpd (file-append package "/sbin/smtpd")))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
|
@ -1709,15 +1707,14 @@ (define opensmtpd-activation
|
|||
(mkdir-p "/var/spool/smtpd")
|
||||
(chmod "/var/spool/smtpd" #o711)
|
||||
(mkdir-p "/var/spool/mail")
|
||||
(chmod "/var/spool/mail" #o711))))))
|
||||
(chmod "/var/spool/mail" #o711)))))
|
||||
|
||||
(define %opensmtpd-pam-services
|
||||
(list (unix-pam-service "smtpd")))
|
||||
|
||||
(define opensmtpd-set-gids
|
||||
(match-lambda
|
||||
(($ <opensmtpd-configuration> package config-file set-gids?)
|
||||
(if set-gids?
|
||||
(define (opensmtpd-set-gids config)
|
||||
(match-record config <opensmtpd-configuration> (package config-file setgid-commands?)
|
||||
(if setgid-commands?
|
||||
(list
|
||||
(setuid-program
|
||||
(program (file-append package "/sbin/smtpctl"))
|
||||
|
@ -1749,7 +1746,7 @@ (define opensmtpd-set-gids
|
|||
(setuid? #false)
|
||||
(setgid? #true)
|
||||
(group "smtpq")))
|
||||
'()))))
|
||||
'())))
|
||||
|
||||
(define opensmtpd-service-type
|
||||
(service-type
|
||||
|
|
Loading…
Reference in a new issue