Subject: [bug#36239] [PATCH] opensmtpd-service-type to extend pam

From: Tobias Geerinckx-Rice <[email-masked]>
Date: Thu, 20 Jun 2019 11:11:50 +0200

Kristofer, Ludo',

Kristofer Buffington wrote:
> The opensmtpd package includes --with-pam at build time, but the 
> service
> does not extend pam. As a result, an administrator would need to
> maintain a seperate passwd or other authentication
> mechanism instead of using PAM.

Thanks for the patch!  Looks good to me, assuming you've 
battle-tested the thing.  I've Guixed up the commit message, but 
let's give Ludo' a chance to respond.

> walletsworth

I feel all, like, personally offended.

Kind regards,

T G-R

From 60f3fd35ac4925e86556781ccc2620f54dccacd9 Mon Sep 17 00:00:00 2001
From: Kristofer Buffington <[email-masked]>
Date: Wed, 12 Jun 2019 16:34:30 -0400
Subject: [PATCH] services: opensmtpd: Extend the PAM service.

* gnu/services/mail.scm (%opensmtpd-pam-services): New variable.
(opensmtpd-service-type)[extensions]: Add it, extending
PAM-ROOT-SERVICE-TYPE.

Signed-off-by: Tobias Geerinckx-Rice <[email-masked]>
---
 gnu/services/mail.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 0e85ada3d0..3de0b4c2f3 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017, 2018 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2017 Carlo Zancanaro <[email-masked]>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <[email-masked]>
+;;; Copyright © 2019 Kristofer Buffington <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1667,6 +1668,9 @@ accept from local for any relay
            (mkdir-p "/var/spool/smtpd")
            (chmod "/var/spool/smtpd" #o711))))))
 
+(define %opensmtpd-pam-services
+  (list (unix-pam-service "smtpd")))
+
 (define opensmtpd-service-type
   (service-type
    (name 'opensmtpd)
@@ -1675,6 +1679,8 @@ accept from local for any relay
                              (const %opensmtpd-accounts))
           (service-extension activation-service-type
                              opensmtpd-activation)
+          (service-extension pam-root-service-type
+                             (const %opensmtpd-pam-services))
           (service-extension profile-service-type
                              (compose list opensmtpd-configuration-package))
           (service-extension shepherd-root-service-type
-- 
2.22.0