From patchwork Tue Dec 6 16:52:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 45076 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4CAE627BBEE; Tue, 6 Dec 2022 16:53:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9AE5727BBE9 for ; Tue, 6 Dec 2022 16:53:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2bBp-0003US-6j; Tue, 06 Dec 2022 11:53:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2bBn-0003TY-AH for guix-patches@gnu.org; Tue, 06 Dec 2022 11:53:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2bBm-0002IA-WE for guix-patches@gnu.org; Tue, 06 Dec 2022 11:53:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2bBm-0005ix-SX for guix-patches@gnu.org; Tue, 06 Dec 2022 11:53:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59860] [PATCH 2/2] services: opensmtpd: Add shepherd-requirement field. Resent-From: mirai@makinata.eu Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 06 Dec 2022 16:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59860@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 59860-submit@debbugs.gnu.org id=B59860.167034555221984 (code B ref 59860); Tue, 06 Dec 2022 16:53:02 +0000 Received: (at 59860) by debbugs.gnu.org; 6 Dec 2022 16:52:32 +0000 Received: from localhost ([127.0.0.1]:43956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2bBH-0005iW-Lp for submit@debbugs.gnu.org; Tue, 06 Dec 2022 11:52:31 -0500 Received: from smtpm5.myservices.hosting ([185.26.105.236]:56502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2bBF-0005iQ-V1 for 59860@debbugs.gnu.org; Tue, 06 Dec 2022 11:52:30 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpm5.myservices.hosting (Postfix) with ESMTP id 5226820CA8 for <59860@debbugs.gnu.org>; Tue, 6 Dec 2022 17:52:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 030DB80096; Tue, 6 Dec 2022 17:52:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id o0Zb7Izp5LCN; Tue, 6 Dec 2022 17:52:28 +0100 (CET) Received: from guix-nuc.home.arpa (bl12-93-156.dsl.telepac.pt [85.245.93.156]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7997480093; Tue, 6 Dec 2022 17:52:28 +0100 (CET) From: mirai@makinata.eu Date: Tue, 6 Dec 2022 16:52:10 +0000 Message-Id: <29568421ebb18d7a157d817242262ec6f68bb7bb.1670345034.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Bruno Victal --- doc/guix.texi | 5 +++++ gnu/services/mail.scm | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a79b777826..4cf60d7114 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -25730,6 +25730,11 @@ Data type representing the configuration of opensmtpd. @item @code{package} (default: @var{opensmtpd}) Package object of the OpenSMTPD SMTP server. +@item @code{shepherd-requirement} (default: @code{'()}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'networking} +if you want to configure OpenSMTPD to listen on non-loopback interfaces. + @item @code{config-file} (default: @code{%default-opensmtpd-config-file}) File-like object of the OpenSMTPD configuration file to use. By default it listens on the loopback network interface, and allows for mail from diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index dc4a7986b6..6f588679b1 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -1651,6 +1651,8 @@ (define-record-type* opensmtpd-configuration? (package opensmtpd-configuration-package (default opensmtpd)) + (shepherd-requirement opensmtpd-configuration-shepherd-requirement + (default '())) ; list of symbols (config-file opensmtpd-configuration-config-file (default %default-opensmtpd-config-file)) (setgid-commands? opensmtpd-setgid-commands? (default #t))) @@ -1667,10 +1669,11 @@ (define %default-opensmtpd-config-file ")) (define (opensmtpd-shepherd-service config) - (match-record config (package config-file) + (match-record config + (package config-file shepherd-requirement) (list (shepherd-service (provision '(smtpd)) - (requirement '(loopback)) + (requirement `(loopback ,@shepherd-requirement)) (documentation "Run the OpenSMTPD daemon.") (start (let ((smtpd (file-append package "/sbin/smtpd"))) #~(make-forkexec-constructor