From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WAQXI9D0sGEhLAEAgWs5BA (envelope-from ) for ; Wed, 08 Dec 2021 19:09:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sMu/HtD0sGFGOAAAbx9fmQ (envelope-from ) for ; Wed, 08 Dec 2021 18:09:20 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3787423224 for ; Wed, 8 Dec 2021 19:09:20 +0100 (CET) Received: from localhost ([::1]:46886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mv1NX-0001hK-BA for larch@yhetil.org; Wed, 08 Dec 2021 13:09:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv1Mv-0001h7-RF for guix-devel@gnu.org; Wed, 08 Dec 2021 13:08:41 -0500 Received: from mx1.dismail.de ([78.46.223.134]:38432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv1Ms-0006Uy-76 for guix-devel@gnu.org; Wed, 08 Dec 2021 13:08:41 -0500 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id fe85b236 for ; Wed, 8 Dec 2021 19:08:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h= mime-version:date:content-type:from:message-id:subject:to; s= 20190914; bh=xYC/T9esb5CdXfH/9yMm1sNdFLf+ihNl2+vpmS6uhBM=; b=HSi 5l2mdGUKVdVhyazYfpZOPZ4QWXA/js4ii0BVBK1mDuJ5659nU6FLy2pYgIIQAFCq zSihEgHZONSw6cPDASVLeLRLvBNKrG1JwPc4iszaiGmawcKYEqlEC98Bkn+WK+0j YS+Gef3qBiQ4Hap60Q4TOx5rocDDZKgpddYzpvDreUG8H9kgQ9//Zh0Z5HlYM2ow rTy4CLaJWRFQc3Vw3ivhjJuN07EEoHLAvP6muxhsAaf7xNGtyD0LR63FbBC5uOFH F5G/QolMIqpohRbuPymi06pwss5qmXixfUir3IQYWbVPE8rZYxf9eJ/KplwHBNTd P4q7vnxLRQ07WC8xbjA== Received: from smtp1.dismail.de ( [10.240.26.11]) by mx1.dismail.de (OpenSMTPD) with ESMTP id ad249d58 for ; Wed, 8 Dec 2021 19:08:27 +0100 (CET) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id 4a1cadd3 for ; Wed, 8 Dec 2021 19:08:27 +0100 (CET) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 3d8b7ff9 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Wed, 8 Dec 2021 19:08:26 +0100 (CET) MIME-Version: 1.0 Date: Wed, 08 Dec 2021 18:08:26 +0000 Content-Type: multipart/alternative; boundary="--=_RainLoop_964_718670117.1638986906" X-Mailer: RainLoop/1.14.0a From: jbranso@dismail.de Message-ID: Subject: help with my opensmtpd-records.scm file To: guix-devel@gnu.org Received-SPF: pass client-ip=78.46.223.134; envelope-from=jbranso@dismail.de; helo=mx1.dismail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638986960; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RooVDfsWnH+a11CgovkTaX2vR1Bw/Fa8XDVlAlD0nLA=; b=EgwyNH3Mci/yHqpYbhZUq2FMqiqG1IkG/k3flmMvt9LdJ94CAYsA01VLgJ4U4d2bbTQoCG TfF0dP17t/pjxMwljCSepPMipFvv3ouAB7Wc2lvKYnwuRZPgmdfYta6CrNfEDF0Yygwynm X2fwSJrIhF4ePf6Arz//gv3vzjpU4PBPCdYhHrvxPAknakU9nuiq6bxig0sKmsB96LUc55 yrgI/MyZhRFWgk2HK/BC5iNS6efTJ17YE/XhkGD4pDz/btfgEJvMnOxRJrgrvQCdJ6ZkBe 62nMAdDVj8NWYrsFhqy8r/95vQ4Yy59+Fq9mSLQRm04Wpz/W1UQwWeIOK32NRA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638986960; a=rsa-sha256; cv=none; b=NaDwobWpVf6sotw24xnFETecMWZ16fabnBECsfyeSNLURrqzWMZ7RHrr+DvKYGfvt2WPVc OPXp0NGL0SGuGdRdrj6dz6mntPPSp8RULOonFigXMQmrdigfKLOOpXWLGU9zODmwsXF0+N RhVtotH1DJ4oH9MYIY5WnhS07gh4C0Ih4mTlMiXll7l6tZ7MH/kmP1dtwOWKTTQohUemcq SXdpnvPuHKzHTQXXKmys+ZnVh+QOvuXY3XHDJCS0aaOCNP+7rTQ89GEaQACGLn99Gq0JWi ztIdF8vlvqAGAABNhv56kgalSZjpu2Jy5PYKKJuepZoaGCTsPfDOjMfdzR9NPA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b="HSi 5l2m"; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.25 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b="HSi 5l2m"; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3787423224 X-Spam-Score: -5.25 X-Migadu-Scanner: scn1.migadu.com X-TUID: UPi5rtwMZkvO ----=_RainLoop_964_718670117.1638986906 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey guix!=0A=0AI am still working on extending guix's current opensmtpd-s= ervice with (guix records). =0A=0AI am getting fairly close to realizing = that goal. For example this works:=0A=0A(display (opensmtpd-configuration= ->mixed-text-file=0A (let ([interface "wlp2s0"]=0A [creds (opensmtpd-tabl= e=0A (name "creds")=0A (values=0A (list=0A (cons "joshua"=0A "$6$Ec4m8FgK= jT2F/03Y$k66ABdse9TzCX6qaALB3WBL9GC1rmAWJmaoSjFMpbhzat7DOpFqpnOwpbZ34wwsQ= YIK8RQlqwM1I/v6vsRq86."))))]=0A [receive-action (opensmtpd-action-local-d= elivery-configuration=0A (name "receive")=0A (method (opensmtpd-maildir-c= onfiguration=0A (pathname "/home/%{rcpt.user}/Maildir")=0A (junk #t)))=0A= (virtual "vusers"))]=0A [smtp.gnucode.me (opensmtpd-pki=0A (domain "smtp= .gnucode.me")=0A (cert "opensmtpd.scm")=0A (key "opensmtpd.scm"))])=0A (o= pensmtpd-configuration=0A (mta-max-deferred 50)=0A (queue=0A (opensmtpd-q= ueue-configuration=0A (compression #t)))=0A (smtp=0A (opensmtpd-smtp-conf= iguration=0A (max-message-size "10M")))=0A (srs=0A (opensmtpd-srs-configu= ration=0A (ttl-delay "5d")))=0A (listen-ons=0A (list=0A ;; this forum hel= p suggests that I listen on 0.0.0.0 and NOT eth0=0A ;; https://serverfaul= t.com/questions/726795/opensmtpd-wont-work-at-reboot=0A ;; this listens f= or email from the outside world=0A (opensmtpd-listen-on=0A (interface int= erface)=0A (port 25)=0A (secure-connection "tls")=0A (pki smtp.gnucode.me= )=0A )=0A ;; this lets local users logged into the system via ssh send em= ail=0A (opensmtpd-listen-on=0A (interface "lo")=0A (port 25)=0A (secure-c= onnection "tls")=0A (pki smtp.gnucode.me))=0A (opensmtpd-listen-on=0A (in= terface interface)=0A (port 465)=0A (secure-connection "smtps")=0A (pki s= mtp.gnucode.me)=0A (auth creds)=0A ;;(filter )=0A )=0A (opensmtpd-listen-= on=0A (interface interface)=0A (port 587)=0A (secure-connection "tls-requ= ire")=0A (pki smtp.gnucode.me)=0A (auth creds)=0A )))=0A (matches (list= =0A (opensmtpd-match=0A (action (opensmtpd-action-relay-configuration=0A = (name "send")))=0A (for (opensmtpd-match-option-configuration=0A (option = "for any")))=0A (from (opensmtpd-match-option-configuration=0A (option "f= rom any")))=0A (auth (opensmtpd-match-option-configuration=0A (option "au= th"))))=0A (opensmtpd-match=0A (action receive-action)=0A (from (opensmtp= d-match-option-configuration=0A (option "from any")))=0A (for (opensmtpd-= match-option-configuration=0A (option "for domain")=0A (value "gnucode.me= "))=0A ;;FIXME/TODO put in a table here=0A ;;"for domain "= =0A ))=0A (opensmtpd-match=0A (action receive-action)=0A (for (opensmtpd-= match-option-configuration=0A (option "for local"))))))))))=0A=0A;; and i= t outputs:=0Asmtp max-message-size 10M=0Asrs ttl 5d=0Aqueue compression= =0A=0Amta max-deferred 50=0A=0Apki smtp.gnucode.me cert "opensmtpd.scm"= =0Apki smtp.gnucode.me key "opensmtpd.scm"=0A=0Alisten on wlp2s0 tls port= 25 pki smtp.gnucode.me=0Alisten on lo tls port 25 pki smtp.gnucode.me=0A= listen on wlp2s0 smtps port 465 pki smtp.gnucode.me auth =0Alisten= on wlp2s0 tls-require port 587 pki smtp.gnucode.me auth =0A=0Aact= ion "send" relay=0Aaction "receive" maildir "/home/%{rcpt.user}/Maildir" = junk virtual =0A=0Amatch from any for any auth action "send"=0Am= atch from any for domain gnucode.me action "receive"=0Amatch for local ac= tion "receive"=0AMy question has to do with how I am handling the opensmt= pd filters...Some of the opensmtpd filter=0Acommands execute programs. I = would like to get some advice about how to let some of the=0A's fieldnames be gexps. My current opensmtpd.scm file does s= o:=0A=0Ahttps://notabug.org/jbranso/linode-guix-system-configuration/src/= master/opensmtpd.scm (https://notabug.org/jbranso/linode-guix-system-conf= iguration/src/master/opensmtpd.scm)=0A=0A(though I am getting some errors= with the procedure=0A=0A create-etc-dkimsign-key-file. I should probable= use the guix's etc-service instead). Anyway, Right now I am using a LOT = of code like =0A(mixed-text-file (string-append variable (string-append = (function (string-append (another-function ...))))=0A=0AI suppose I shoul= d instead change this to=0A=0A(define my-list (list (function ...) (funct= ion ...) (list (function (list (function ...) (function ...))))=0A=0A(mix= ed-text-file (apply string-append (flatten my-list))) =0ABUT that doesn't= quite answer my issue. It would be helpful to allow some 's=0Afieldnames accept gexps. How would I allow go about doing = that?=0A=0AI think that the answer would be to use guix's mixed-text-file= *, but I am not sure how to do that elegantly...=0A=0AMy current code is = here:=0A=0Ahttps://notabug.org/jbranso/linode-guix-system-configuration/s= rc/master/opensmtpd-records.scm (https://notabug.org/jbranso/linode-guix-= system-configuration/src/master/opensmtpd-records.scm)=0A=0APerhaps a mor= e targeted question would be how do I modify the current procedure=0A=0A = opensmtpd-filter-proc-exec->string record to accept gexps? =0A=0ASuggest= ions are most welcome.=0A=0AMy thoughts about the service are here: =0A= =0Ahttps://notabug.org/jbranso/linode-guix-system-configuration/src/maste= r/opensmtpd.org (https://notabug.org/jbranso/linode-guix-system-configura= tion/src/master/opensmtpd.org)=0AThanks,=0A=0AJoshua ----=_RainLoop_964_718670117.1638986906 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
=
Hey guix!

I am still working on extending guix's current opens= mtpd-service with (guix records).

I am getting fairly close to re= alizing that goal. For example this works:

(display (opensmtpd-con= figuration->mixed-text-file
(let ([interface "wlp2s0"]
[creds = (opensmtpd-table
(name "creds")
(values
(list
(cons "josh= ua"
"$6$Ec4m8FgKjT2F/03Y$k66ABdse9TzCX6qaALB3WBL9GC1rmAWJmaoSjFMpbhza= t7DOpFqpnOwpbZ34wwsQYIK8RQlqwM1I/v6vsRq86."))))]
[receive-action (ope= nsmtpd-action-local-delivery-configuration
(name "receive")
(meth= od (opensmtpd-maildir-configuration
(pathname "/home/%{rcpt.user}/Mai= ldir")
(junk #t)))
(virtual "vusers"))]
[smtp.gnucode.me (ope= nsmtpd-pki
(domain "smtp.gnucode.me")
(cert "opensmtpd.scm")
= (key "opensmtpd.scm"))])
(opensmtpd-configuration
(mta-max-deferr= ed 50)
(queue
(opensmtpd-queue-configuration
(compression #t)= ))
(smtp
(opensmtpd-smtp-configuration
(max-message-size "10M= ")))
(srs
(opensmtpd-srs-configuration
(ttl-delay "5d")))
= (listen-ons
(list
;; this forum help suggests that I listen on 0= .0.0.0 and NOT eth0
;; https://serverfault.com/questions/726795/opens= mtpd-wont-work-at-reboot
;; this listens for email from the outside w= orld
(opensmtpd-listen-on
(interface interface)
(port 25)
= (secure-connection "tls")
(pki smtp.gnucode.me)
)
;; this le= ts local users logged into the system via ssh send email
(opensmtpd-l= isten-on
(interface "lo")
(port 25)
(secure-connection "tls")=
(pki smtp.gnucode.me))
(opensmtpd-listen-on
(interface inter= face)
(port 465)
(secure-connection "smtps")
(pki smtp.gnucod= e.me)
(auth creds)
;;(filter )
)
(opensmtpd-listen-on
= (interface interface)
(port 587)
(secure-connection "tls-require= ")
(pki smtp.gnucode.me)
(auth creds)
)))
(matches (list<= br> (opensmtpd-match
(action (opensmtpd-action-relay-configuration (name "send")))
(for (opensmtpd-match-option-configuration
(opt= ion "for any")))
(from (opensmtpd-match-option-configuration
(opt= ion "from any")))
(auth (opensmtpd-match-option-configuration
(op= tion "auth"))))
(opensmtpd-match
(action receive-action)
(fro= m (opensmtpd-match-option-configuration
(option "from any")))
(fo= r (opensmtpd-match-option-configuration
(option "for domain")
(va= lue "gnucode.me"))
;;FIXME/TODO put in a table <vdoms> here
= ;;"for domain <vdoms>"
))
(opensmtpd-match
(action rec= eive-action)
(for (opensmtpd-match-option-configuration
(option "= for local"))))))))))

;; and it outputs:


smtp max-messag= e-size 10M


srs ttl 5d


queue compression

mta = max-deferred 50

pki smtp.gnucode.me cert "opensmtpd.scm"
pki sm= tp.gnucode.me key "opensmtpd.scm"

listen on wlp2s0 tls port 25 pki= smtp.gnucode.me
listen on lo tls port 25 pki smtp.gnucode.me
liste= n on wlp2s0 smtps port 465 pki smtp.gnucode.me auth <creds>
list= en on wlp2s0 tls-require port 587 pki smtp.gnucode.me auth <creds><= br>
action "send" relay

action "receive" maildir "/home/%{rcpt= .user}/Maildir" junk virtual <vusers>

match from any for an= y auth action "send"
match from any for domain gnucode.me action "rece= ive"
match for local action "receive"



My question has t= o do with how I am handling the opensmtpd filters...Some of the opensmtpd= filter
commands execute programs. I would like to get some advice abo= ut how to let some of the
<opensmtpd-configuration>'s fieldnames= be gexps. My current opensmtpd.scm file does so:

https://notabug.org/jbranso/linode-guix-system-configuration/src= /master/opensmtpd.scm

(though I am getting some errors with th= e procedure
create-etc-dkimsign-key-file. I should probable use the guix's etc-service=
 instead). Anyway, Right now I am using a LOT of code like =

(mixed-text-file (string-append variable (string-append (funct= ion (string-append (another-function ...))))

I suppose I should in= stead change this to

(define my-list (list (function ...) (functio= n ...) (list (function (list (function ...) (function ...))))

(mix= ed-text-file (apply string-append (flatten my-list)))


BUT tha= t doesn't quite answer my issue. It would be helpful to allow some <op= ensmtpd-configuration>'s
fieldnames accept gexps. How would I allow= go about doing that?

I think that the answer would be to use guix= 's mixed-text-file*, but I am not sure how to do that elegantly...
My current code is here:

https:/= /notabug.org/jbranso/linode-guix-system-configuration/src/master/opensmtp= d-records.scm

Perhaps a more targeted question would be how do= I modify the current procedure
opensmtpd-filter-proc-exec->string record to a=
ccept gexps? 


Suggestions are most welcome.

M= y thoughts about the service are here:

h= ttps://notabug.org/jbranso/linode-guix-system-configuration/src/master/op= ensmtpd.org



Thanks,

Joshua




<= br>
----=_RainLoop_964_718670117.1638986906--