GNU bug report logs - #37222
[PATCH] gnu: services: Add dkimproxy-out.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Julien Lepiller <julien@HIDDEN>; Keywords: patch; dated Thu, 29 Aug 2019 19:53:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 37222 <at> debbugs.gnu.org:


Received: (at 37222) by debbugs.gnu.org; 4 Feb 2021 11:38:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 04 06:38:49 2021
Received: from localhost ([127.0.0.1]:40059 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l7cyH-0007EO-0l
	for submit <at> debbugs.gnu.org; Thu, 04 Feb 2021 06:38:49 -0500
Received: from lepiller.eu ([89.234.186.109]:56512)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <julien@HIDDEN>) id 1l7cyE-0007ED-3z
 for 37222 <at> debbugs.gnu.org; Thu, 04 Feb 2021 06:38:47 -0500
Received: from lepiller.eu (localhost [127.0.0.1])
 by lepiller.eu (OpenSMTPD) with ESMTP id 60361e24;
 Thu, 4 Feb 2021 11:38:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date
 :in-reply-to:references:mime-version:content-type
 :content-transfer-encoding:subject:to:cc:from:message-id; s=
 dkim; bh=+5uMtrpzTLCeEdptdrRNIll/0W4O0EDFte0wFC4O7XU=; b=Pb314GF
 F+xoLn7DtcE+Vp89C9x+WXLMU3JXx5bLhPgYztWiZSNw2MV14/1TCbaOaoQlmw8u
 PrxyoTXNlvaPLLWtSwd9D8+gS5JS+SydTgw6B419TjShVNa72hzcQqtaKVPXN785
 elfMtOAL568KLIAZ2LREvlEezITnGL0qcRc7yZl0gqRXlK9XiTOGf2UzxANTElvI
 Or5YibPwQeJVeTaXizrP1V/By4vQHZH2T9ciPps9mkxVj6HR+IO+MX9tK0z/QS7A
 +soj+ruvSiXytyuB+XaiYSNDwDju/CqUELdFELQ4q28ZHalTyHAd88H6V1qSMnnn
 uF2/0/3U9FNji6A==
Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id f82ac226
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); 
 Thu, 4 Feb 2021 11:38:43 +0000 (UTC)
Date: Thu, 04 Feb 2021 06:37:35 -0500
User-Agent: K-9 Mail for Android
In-Reply-To: <871rdw84h9.fsf@HIDDEN>
References: <871rdw84h9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="----ZYXDF66YKNZUTS4I0OWUET3PQP9CRE"
Content-Transfer-Encoding: 7bit
Subject: Re: dkimproxy-out status
To: Alexey Abramov <levenson@HIDDEN>
From: Julien Lepiller <julien@HIDDEN>
Message-ID: <A5DE8A6A-3346-4D97-A27D-388A4E0BA7E3@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37222
Cc: 37222 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

------ZYXDF66YKNZUTS4I0OWUET3PQP9CRE
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

Oh, I totally forgot about it! With FOSDEM and everything, I don't think I'=
ll be able to take care of this before next week=2E I appreciate any help y=
ou can provide!

Le 4 f=C3=A9vrier 2021 06:19:46 GMT-05:00, Alexey Abramov <levenson@mmer=
=2Eorg> a =C3=A9crit :
>Hi Julien,
>
>I copy&pasted your great dkimproxy service, and it works like a charm=2E
>Thank you! I was wondering when are you going to address those changes
>that Ludo has suggested?
>
>If you don't have time for some reason, I am willing to help with it to
>let it merge=2E What do you think?
>
>--=20
>Alexey

------ZYXDF66YKNZUTS4I0OWUET3PQP9CRE
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body>Oh, I totally forgot about it! With FOSDEM and eve=
rything, I don't think I'll be able to take care of this before next week=
=2E I appreciate any help you can provide!<br><br><div class=3D"gmail_quote=
">Le 4 f=C3=A9vrier 2021 06:19:46 GMT-05:00, Alexey Abramov &lt;levenson@mm=
er=2Eorg&gt; a =C3=A9crit :<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0pt 0pt 0pt 0=2E8ex; border-left: 1px solid rgb(204, 204, 204); padding-=
left: 1ex;">
<pre class=3D"k9mail">Hi Julien,<br><br>I copy&amp;pasted your great dkimp=
roxy service, and it works like a charm=2E Thank you! I was wondering when =
are you going to address those changes that Ludo has suggested?<br><br>If y=
ou don't have time for some reason, I am willing to help with it to let it =
merge=2E What do you think?<br></pre></blockquote></div></body></html>
------ZYXDF66YKNZUTS4I0OWUET3PQP9CRE--




Information forwarded to guix-patches@HIDDEN:
bug#37222; Package guix-patches. Full text available.

Message received at 37222 <at> debbugs.gnu.org:


Received: (at 37222) by debbugs.gnu.org; 4 Feb 2021 11:19:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 04 06:19:56 2021
Received: from localhost ([127.0.0.1]:39896 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l7cg0-0006Oj-CP
	for submit <at> debbugs.gnu.org; Thu, 04 Feb 2021 06:19:56 -0500
Received: from mail.mmer.org ([178.22.65.174]:49994)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <levenson@HIDDEN>) id 1l7cfy-0006OU-NO
 for 37222 <at> debbugs.gnu.org; Thu, 04 Feb 2021 06:19:55 -0500
Received: from mail.mmer.org (localhost [127.0.0.1])
 by mail.mmer.org (OpenSMTPD) with ESMTP id 15d7c1f3;
 Thu, 4 Feb 2021 11:19:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=mmer.org; h=from:to:cc
 :subject:date:message-id:mime-version:content-type; s=dkim; bh=3
 OCzoPrCTCoyQzTI0RgcKAX0hShe8zD45pjuyzuhMS4=; b=hBW3BN+0Hv48SYCcJ
 feUunA80PdaqFqizjg7oCoecz9tRJseTwVneSAoRi5wi6PydExJWo628MatWtwbF
 6ShZjINWZzGvr6a2OzKfBX+3LAbIdAkMzXUlk5/NJMyqmNFCZdz9krlods7sBpvl
 v57aJIiQoNVrJjrOv74Vv4u11s=
Received: from delta.lan (<unknown> [10.147.19.73])
 by mail.mmer.org (OpenSMTPD) with ESMTPSA id c89f55c0
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); 
 Thu, 4 Feb 2021 11:19:47 +0000 (UTC)
From: Alexey Abramov <levenson@HIDDEN>
To: julien@HIDDEN
Subject: dkimproxy-out status
Date: Thu, 04 Feb 2021 12:19:46 +0100
Message-ID: <871rdw84h9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 37222
Cc: 37222 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Julien,

I copy&pasted your great dkimproxy service, and it works like a charm. Thank you! I was wondering when are you going to address those changes that Ludo has suggested?

If you don't have time for some reason, I am willing to help with it to let it merge. What do you think?

-- 
Alexey




Information forwarded to guix-patches@HIDDEN:
bug#37222; Package guix-patches. Full text available.

Message received at 37222 <at> debbugs.gnu.org:


Received: (at 37222) by debbugs.gnu.org; 4 Sep 2019 12:16:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 04 08:16:26 2019
Received: from localhost ([127.0.0.1]:60931 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i5UD2-0004OD-Ac
	for submit <at> debbugs.gnu.org; Wed, 04 Sep 2019 08:16:26 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37062)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1i5UCz-0004Ny-Ew
 for 37222 <at> debbugs.gnu.org; Wed, 04 Sep 2019 08:16:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44400)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1i5UCs-00052h-SY; Wed, 04 Sep 2019 08:16:16 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42444 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1i5UCs-000503-8q; Wed, 04 Sep 2019 08:16:14 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Julien Lepiller <julien@HIDDEN>
Subject: Re: [bug#37222] [PATCH] gnu: services: Add dkimproxy-out.
References: <20190829215226.173a4812@HIDDEN>
Date: Wed, 04 Sep 2019 14:16:12 +0200
In-Reply-To: <20190829215226.173a4812@HIDDEN> (Julien Lepiller's
 message of "Thu, 29 Aug 2019 21:52:26 +0200")
Message-ID: <87pnkg5kab.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37222
Cc: 37222 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi!

Julien Lepiller <julien@HIDDEN> skribis:

>>From 114067a7134ceb49dc5bbcef820edc49d62c8d0f Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@HIDDEN>
> Date: Thu, 29 Aug 2019 21:48:25 +0200
> Subject: [PATCH] gnu: services: Add dkimproxy-out.
                   ^
No need for =E2=80=9Cgnu:=E2=80=9D, which is only for (gnu packages =E2=80=
=A6).  (Confusingly=E2=80=A6)
>
> * gnu/services/mail.scm (dkimproxy-out-service-type): New variable.
> * doc/guix.texi (Mail Services): Document it.
> +@subsubheading Dkimproxy Outbound Service
> +@cindex Dkimproxy Outbound Service
> +

Could you add an introductory paragraph, for instance mentioning what
DKIM is about, linking to the Wikipedia page or something?

> +@deffn {Scheme Variable} dkimproxy-out-service-type
> +This is the type of the @uref{http://dkimproxy.sourceforge.net/, dkimpro=
xy
> +outbound daemon}, whose value should be a @code{dkimproxy-out-configurat=
ion}
> +object as in this example:
> +
> +@example
> +(service dkimproxy-out-service-type
> +         (dkimproxy-out-configuration
> +	   (listen "127.0.0.1:10027")
   ^
No tabs please.  :-)

> +            %default-imap4d-config-file
> +=09=20=20=20=20
> +	    dkimproxy-out-service-type

Ditto (several occurrences in this file.)

> +(define (generate-map-file config filename)
> +  (apply plain-file filename
> +         (map (lambda (config)
> +                (match config
> +                  ((selector (config ...))
> +                   (string-append
> +                     selector " "
> +                     (string-join
> +                       (map generate-dkimproxy-out-signature-configurati=
on config)
> +                       "\n")))
> +                  ((selector config)
> +                   (string-append
> +                     selector " "
> +                     (generate-dkimproxy-out-signature-configuration con=
fig)))))
> +              config)))

This is incorrect since =E2=80=98plain-file=E2=80=99 takes exactly two argu=
ments.
Should it be something like:

  (plain-file file-name (string-join (map =E2=80=A6 config)))

?

> +                               (domains
> +                                 (apply append
> +                                   (map

Use =E2=80=98append-map=E2=80=99 instead.

> +(define dkimproxy-out-service-type
> +  (service-type
> +    (name 'dkimproxy-out)
> +    (extensions
> +      (list (service-extension account-service-type
> +                               (const %dkimproxy-accounts))
> +            (service-extension shepherd-root-service-type
> +                               dkimproxy-out-shepherd-service)))))

Please add a =E2=80=98description=E2=80=99 field.

It would be nice to have a system test too, which I guess could at least
ensure that the generated config is valid and that the daemon happily
starts?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#37222; Package guix-patches. Full text available.

Message received at 37222 <at> debbugs.gnu.org:


Received: (at 37222) by debbugs.gnu.org; 29 Aug 2019 20:04:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 16:04:19 2019
Received: from localhost ([127.0.0.1]:52954 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i3QeZ-0004yv-JV
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2019 16:04:19 -0400
Received: from tobias.gr ([80.241.217.52]:36132)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1i3QeV-0004yi-1y
 for 37222 <at> debbugs.gnu.org; Thu, 29 Aug 2019 16:04:17 -0400
Received: by tobias.gr (OpenSMTPD) with ESMTP id e026d181;
 Thu, 29 Aug 2019 20:04:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to:cc
 :subject:references:in-reply-to:date:message-id:mime-version
 :content-type; s=2018; i=me@HIDDEN; bh=ioX7zitw6qgJlVCN2/yF9f
 46dGhX+RClo58oh2L0m/I=; b=fNyYtixGCshchKK6lnKLIh1dQ0iSogHWEvkPU4
 XYY0YZnr1TMh97lf26EsxeSRf+ZE2DVKHk5hoxAaRfBOlgwdbw/pmYbs2dedJ65Q
 9jdoUTT3m8tFO2/g6qTXOOzcAd929ydKpThx9fSQOnlneSaftnu3Pix3BDwsi7Qn
 cU/4i20uh2u9HfWKflV669zvJqXylU/L/FifvzEZ/JfduHLAU3Pqhw5Kw+T7HYA8
 mtJnFUZ01fTKGVcAsUqBEYXwiyGusT5GbKBwTe7EnOVZpsPbu8qsx16NolmCO2Os
 /SZGTP2rRQAe1aP45cQIezvmbVnPDmmR3iEmBsIEcUyNUxXw==
Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 10f1a47f
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); 
 Thu, 29 Aug 2019 20:04:06 +0000 (UTC)
From: Tobias Geerinckx-Rice <me@HIDDEN>
To: guix-patches@HIDDEN
Subject: Re: [bug#37222] [PATCH] gnu: services: Add dkimproxy-out.
References: <20190829215226.173a4812@HIDDEN>
In-reply-to: <20190829215226.173a4812@HIDDEN>
Date: Thu, 29 Aug 2019 22:04:05 +0200
Message-ID: <871rx3rb62.fsf@nckx>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37222
Cc: 37222 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Julien,

Julien Lepiller =E5=86=99=E9=81=93=EF=BC=9A
> Hi guix, the attached patch adds the dkimproxy-out service that=20
> I use
> for signing my emails (including this one, although it's=20
> probably not
> valid because it went through a mailing list).

Interesting; I wasn't expecting that.  I thought GNU'd finally=20
fixed their mailman to not break signatures, but you're right:

  Received: from a.mx.tobias.gr (localhost [127.0.0.1])
	by DKIM-proxy (OpenSMTPD) with ESMTP id a7e379af
	for <me@HIDDEN>;
	Thu, 29 Aug 2019 19:53:20 +0000 (UTC)
  Authentication-Results: tobias.gr; dkim=3Dfail (message has been=20
  altered) header.i=3D@HIDDEN; domainkeys=3Dfail (message has=20
  been altered) header.from=3Djulien@HIDDEN
  X-DKIM-Authentication-Results: fail (message has been altered)
  Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	by a.mx.tobias.gr (OpenSMTPD) with ESMTPS id eb36763a=20
	(TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO)
	for <me@HIDDEN>;
	Thu, 29 Aug 2019 19:53:20 +0000 (UTC)

Kind regards,

T G-R

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXWgvtQAKCRANsP+IT1Vt
eZpdAQD+ar0Z5Bz0JLLRI/dvH/JdJcayRgerPUpdaZzQr7yPaQEAvS4LDpLcWYzq
KmPF+mkA+uWCEAKQTuDmep6Dx0JzCAA=
=jLZ3
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#37222; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Aug 2019 20:04:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 16:04:23 2019
Received: from localhost ([127.0.0.1]:52957 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i3Qec-0004z9-Tn
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2019 16:04:23 -0400
Received: from lists.gnu.org ([209.51.188.17]:56688)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1i3Qeb-0004z2-2v
 for submit <at> debbugs.gnu.org; Thu, 29 Aug 2019 16:04:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33245)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <me@HIDDEN>) id 1i3Qea-0006XU-1D
 for guix-patches@HIDDEN; Thu, 29 Aug 2019 16:04:20 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <me@HIDDEN>) id 1i3QeY-0004T1-Ey
 for guix-patches@HIDDEN; Thu, 29 Aug 2019 16:04:19 -0400
Received: from tobias.gr ([2001:470:7405::1]:46018)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <me@HIDDEN>) id 1i3QeY-0004NR-1w
 for guix-patches@HIDDEN; Thu, 29 Aug 2019 16:04:18 -0400
Received: by tobias.gr (OpenSMTPD) with ESMTP id e026d181;
 Thu, 29 Aug 2019 20:04:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to:cc
 :subject:references:in-reply-to:date:message-id:mime-version
 :content-type; s=2018; i=me@HIDDEN; bh=ioX7zitw6qgJlVCN2/yF9f
 46dGhX+RClo58oh2L0m/I=; b=fNyYtixGCshchKK6lnKLIh1dQ0iSogHWEvkPU4
 XYY0YZnr1TMh97lf26EsxeSRf+ZE2DVKHk5hoxAaRfBOlgwdbw/pmYbs2dedJ65Q
 9jdoUTT3m8tFO2/g6qTXOOzcAd929ydKpThx9fSQOnlneSaftnu3Pix3BDwsi7Qn
 cU/4i20uh2u9HfWKflV669zvJqXylU/L/FifvzEZ/JfduHLAU3Pqhw5Kw+T7HYA8
 mtJnFUZ01fTKGVcAsUqBEYXwiyGusT5GbKBwTe7EnOVZpsPbu8qsx16NolmCO2Os
 /SZGTP2rRQAe1aP45cQIezvmbVnPDmmR3iEmBsIEcUyNUxXw==
Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 10f1a47f
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); 
 Thu, 29 Aug 2019 20:04:06 +0000 (UTC)
From: Tobias Geerinckx-Rice <me@HIDDEN>
To: guix-patches@HIDDEN
Subject: Re: [bug#37222] [PATCH] gnu: services: Add dkimproxy-out.
References: <20190829215226.173a4812@HIDDEN>
In-reply-to: <20190829215226.173a4812@HIDDEN>
Date: Thu, 29 Aug 2019 22:04:05 +0200
Message-ID: <871rx3rb62.fsf@nckx>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2001:470:7405::1
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: 37222 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Julien,

Julien Lepiller =E5=86=99=E9=81=93=EF=BC=9A
> Hi guix, the attached patch adds the dkimproxy-out service that=20
> I use
> for signing my emails (including this one, although it's=20
> probably not
> valid because it went through a mailing list).

Interesting; I wasn't expecting that.  I thought GNU'd finally=20
fixed their mailman to not break signatures, but you're right:

  Received: from a.mx.tobias.gr (localhost [127.0.0.1])
	by DKIM-proxy (OpenSMTPD) with ESMTP id a7e379af
	for <me@HIDDEN>;
	Thu, 29 Aug 2019 19:53:20 +0000 (UTC)
  Authentication-Results: tobias.gr; dkim=3Dfail (message has been=20
  altered) header.i=3D@HIDDEN; domainkeys=3Dfail (message has=20
  been altered) header.from=3Djulien@HIDDEN
  X-DKIM-Authentication-Results: fail (message has been altered)
  Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	by a.mx.tobias.gr (OpenSMTPD) with ESMTPS id eb36763a=20
	(TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO)
	for <me@HIDDEN>;
	Thu, 29 Aug 2019 19:53:20 +0000 (UTC)

Kind regards,

T G-R

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXWgvtQAKCRANsP+IT1Vt
eZpdAQD+ar0Z5Bz0JLLRI/dvH/JdJcayRgerPUpdaZzQr7yPaQEAvS4LDpLcWYzq
KmPF+mkA+uWCEAKQTuDmep6Dx0JzCAA=
=jLZ3
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#37222; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Aug 2019 19:52:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 15:52:51 2019
Received: from localhost ([127.0.0.1]:52936 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i3QTS-0004dw-Tg
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2019 15:52:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:54309)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <julien@HIDDEN>) id 1i3QTP-0004dj-Sk
 for submit <at> debbugs.gnu.org; Thu, 29 Aug 2019 15:52:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58598)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <julien@HIDDEN>) id 1i3QTN-0003Pj-6S
 for guix-patches@HIDDEN; Thu, 29 Aug 2019 15:52:47 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <julien@HIDDEN>) id 1i3QTK-0003tr-Rl
 for guix-patches@HIDDEN; Thu, 29 Aug 2019 15:52:45 -0400
Received: from lepiller.eu ([2a00:5884:8208::1]:55070)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <julien@HIDDEN>) id 1i3QTK-0003kC-6f
 for guix-patches@HIDDEN; Thu, 29 Aug 2019 15:52:42 -0400
Received: from lepiller.eu (localhost [127.0.0.1])
 by lepiller.eu (OpenSMTPD) with ESMTP id e756e08c
 for <guix-patches@HIDDEN>; Thu, 29 Aug 2019 19:52:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lepiller.eu; h=date:from
 :to:subject:message-id:mime-version:content-type; s=dkim; bh=P0p
 QnfNi+hanW5u+fFfn7bog7m0=; b=dHqlfvp8mvkGyyhAzMxkmwrgWqqVypUWsm/
 zCFsVkhd2N1ZqeWLOw7tziVdYf4hhh2aB4UABdWvvRAjUFgqVeSofzCQ/bnoiMlN
 Wc76WR47LVu87RPs1AsUDRhcFIOzek62Ovp4/ACOSqwy+7d/N8Yykw3ILJJY/97F
 01v9FSqX1eAwAJnZXw9xM6WVew44XEEuW/cfiMY64a4fV0Pgo37UkgPoRBQ4AX2u
 mcpP+tiMzy4CF735e4BJIREVl/sekWP7BqqcfQJ5GEMk5vo44QIgHIOdpAeoRLa5
 57I+A1E7XgqrUjPVRlmRM+s5A4f9hgR1NlX1QB1JwExzjn/fOlw==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=lepiller.eu; h=date:from:to
 :subject:message-id:mime-version:content-type; q=dns; s=dkim; b=
 YSeSOHzPndpqrLn0lCpe2+ppBd1PVcURT+SBHcYVGOX4iTkZTM/G+8gvC2rvjRAf
 Hgod8Jb3PEh7dTTQPjh2nMFoQ0ilQF8xsrmcOy67+y8VKdKuw80yM61t+yAF9M9M
 6vU3ek9RHG49ANiNCyXsr/hNQnfyPsiI2PqWFFE2EZKsjXi6psSrDbKTfWeNNd2b
 +OnWlkaaAlaVPh+VHit4oxCrUWJE0KrtOP0KxaXCSlaG8bu6BbF5wiTOdXFyrO0b
 ggEaa06GtgKXJ8/ybu6+pJoahKzziTOsCTBJSSPXagzKAn+cpOpsGr2PR7NJp0CR
 ppMwIMiOfLxoRJdqqUsSUg==
Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 4257998b
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO)
 for <guix-patches@HIDDEN>; Thu, 29 Aug 2019 19:52:35 +0000 (UTC)
Date: Thu, 29 Aug 2019 21:52:26 +0200
From: Julien Lepiller <julien@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: services: Add dkimproxy-out.
Message-ID: <20190829215226.173a4812@HIDDEN>
X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="MP_/C.r5cqd+UsU1nFPA8x9ekPj"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:5884:8208::1
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--MP_/C.r5cqd+UsU1nFPA8x9ekPj
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi guix, the attached patch adds the dkimproxy-out service that I use
for signing my emails (including this one, although it's probably not
valid because it went through a mailing list).

Thanks!

--MP_/C.r5cqd+UsU1nFPA8x9ekPj
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=0001-gnu-services-Add-dkimproxy-out.patch

From 114067a7134ceb49dc5bbcef820edc49d62c8d0f Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@HIDDEN>
Date: Thu, 29 Aug 2019 21:48:25 +0200
Subject: [PATCH] gnu: services: Add dkimproxy-out.

* gnu/services/mail.scm (dkimproxy-out-service-type): New variable.
* doc/guix.texi (Mail Services): Document it.
---
 doc/guix.texi         | 114 +++++++++++++++++++++++
 gnu/services/mail.scm | 211 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 324 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1998ad049b..ec0f04fdea 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17264,6 +17264,120 @@ Mailutils Manual}, for details.
 @end table
 @end deftp
 
+@subsubheading Dkimproxy Outbound Service
+@cindex Dkimproxy Outbound Service
+
+@deffn {Scheme Variable} dkimproxy-out-service-type
+This is the type of the @uref{http://dkimproxy.sourceforge.net/, dkimproxy
+outbound daemon}, whose value should be a @code{dkimproxy-out-configuration}
+object as in this example:
+
+@example
+(service dkimproxy-out-service-type
+         (dkimproxy-out-configuration
+	   (listen "127.0.0.1:10027")
+	   (relay "127.0.0.1:10028")
+	   (sender-map
+	     `(("example.com"
+	        (,(dkimproxy-out-signature-configuration
+		    (type 'dkim)
+		    (key "/etc/mail/dkim/private.key")
+		    (method "relaxed")
+		    (selector "dkim"))))))))
+@end example
+@end deffn
+
+@deftp {Data Type} dkimproxy-out-configuration
+Data type representing the configuration of @command{dkimproxy.out}.
+
+@table @asis
+@item @code{package} (default: @code{dkimproxy})
+The package that provides @command{dkimproxy.out}.
+
+@item @code{listen} (default: @code{#f})
+The interface and port on which to listen for incoming connections (messages
+to sign).
+
+@item @code{relay} (default: @code{#f})
+The interface and port on which to send (relay) the signed messages.
+
+@item @code{list-id-map} (default: @code{'()})
+A map of List-Id to configuration.  The key of the association list must be a
+string representing the content of a List-Id field in the incoming message.
+The associated value is a @code{dkimproxy-out-signature-configuration} object
+that represents configuration that must be applied to messages that contain
+the corresponding List-Id header.
+
+@item @code{sender-map} (default: @code{'()})
+A map of Sender to configuration.  The key of the association list must be a
+string representing a sender of the incoming message.  The associated value is
+a @code{dkimproxy-out-signature-configuration} object that represents
+configuration that must be applied to messages that are sent by the
+corresponding sender.
+
+Note that a @code{sender-map} is required and cannot be empty.
+
+@item @code{reject-error?} (default: @code{#f})
+This option specifies what to do if an error occurs during signing of a
+message.  If this option is set to @code{#t}, the message will be rejected
+with an SMTP error code.  This will result in the MTA sending the message
+to try again later, or bounce it back to the sender (depending on the exact
+error code used).  If this option is set to @code{#f}, the message will be
+allowed to pass through without having a signature added.
+
+A @code{list-id-map} is not required and can be empty.
+
+@item @code{config-file} (default: @code{#f})
+A file-like object that contains the full configuration for dkimproxy-out. If
+this option is not @code{#f}, every other field of this configuration will
+be ignored except the package configuration. See the man page for
+@command{dkimproxy.out} for more information.
+
+@end table
+@end deftp
+
+@deftp {Data Type} dkimproxy-out-signature-configuration
+Data type representing a signature configuration for @command{dkimproxy.out}.
+
+The @code{keyfile}, @code{method}, @code{selector} and @code{signature} of the
+first @code{dkimproxy-out-signature-configuration} in @code{sender-map} are
+taken as the default value of any subsequent configuration in @code{sender-map}
+and any configuration in @code{list-id-map}.
+
+@table @asis
+@item @code{type} (default: @code{'dkim})
+The type of signature, either @code{'dkim} or @code{'domainkey}.
+
+@item @code{key} (default: @code{#f})
+The key file that contains the private key for signing.  If @code{#f}, the
+default key file is used.  It must not be @code{#f} for the first item of
+the @code{sender-map}.
+
+@item @code{algorithm} (default: @code{#f})
+The algorithm used to sign messages, as a string.  If @code{#f}, the default
+algorithm is used.
+
+@item @code{method} (default: @code{#f})
+The canonicalization method to use.  It must not be @code{#f} for the first
+item of the @code{sender-map}.  Accepted value for @command{dkimproxy.out} are
+@code{"simple"}, @code{"relaxed"} and @code{"nofws"}.
+
+@item @code{domain} (default: @code{#f})
+The domain to use for signing.  If @code{#f}, default is to use the domain
+matched.
+
+@item @code{identity} (default: @code{#f})
+The identity to use.  If @code{#f}, default is to not use any identity.
+
+@item @code{selector} (default: @code{#f})
+The selector to use.  If @code{#f}, the default selector is used.  It must
+not be @code{#f} for the first item of the @code{sender-map}.  The selector
+is the first DNS component of the name in which the public DKIM key is
+recorded for the domain used.  For instance, if you have a
+@code{dkim._domainkey.example.com.} record, the selector is @code{dkim}.
+@end table
+@end deftp
+
 @node Messaging Services
 @subsection Messaging Services
 
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 3de0b4c2f3..670b3c33ff 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -70,7 +70,28 @@
             imap4d-configuration
             imap4d-configuration?
             imap4d-service-type
-            %default-imap4d-config-file))
+            %default-imap4d-config-file
+	    
+	    dkimproxy-out-service-type
+
+            dkimproxy-out-signature-configuration
+            dkimproxy-out-signature-configuration-type
+            dkimproxy-out-signature-configuration-key
+            dkimproxy-out-signature-configuration-algorithm
+            dkimproxy-out-signature-configuration-method
+            dkimproxy-out-signature-configuration-domain
+            dkimproxy-out-signature-configuration-identity
+            dkimproxy-out-signature-configuration-selector
+
+            dkimproxy-out-configuration
+            dkimproxy-out-configuration-package
+            dkimproxy-out-configuration-listen
+            dkimproxy-out-configuration-relay
+            dkimproxy-out-configuration-list-id-map
+            dkimproxy-out-configuration-sender-map
+            dkimproxy-out-configuration-reject-error?
+
+            dkimproxy-out-configuration-config-file))
 
 ;;; Commentary:
 ;;;
@@ -1825,3 +1846,191 @@ exim_group = exim
     (list (service-extension
            shepherd-root-service-type imap4d-shepherd-service)))
    (default-value (imap4d-configuration))))
+
+;;;
+;;; Dkimproxy Daemon.
+;;;
+
+(define-record-type* <dkimproxy-out-signature-configuration>
+  dkimproxy-out-signature-configuration make-dkimproxy-out-signature-configuration
+  dkimproxy-out-signature-configuration?
+  (type      dkimproxy-out-signature-configuration-type
+             (default 'dkim))
+  (key       dkimproxy-out-signature-configuration-key
+             (default #f))
+  (algorithm dkimproxy-out-signature-configuration-algorithm
+             (default #f))
+  (method    dkimproxy-out-signature-configuration-method
+             (default #f))
+  (domain    dkimproxy-out-signature-configuration-domain
+             (default #f))
+  (identity  dkimproxy-out-signature-configuration-identity
+             (default #f))
+  (selector  dkimproxy-out-signature-configuration-selector
+             (default #f)))
+
+(define generate-dkimproxy-out-signature-configuration
+  (match-lambda
+    (($ <dkimproxy-out-signature-configuration>
+        type key algorithm method domain identity selector)
+     (string-append
+       (match type
+         ('dkim "dkim")
+         ('domainkeys "domainkeys"))
+       (if (or key algorithm method domain identity selector)
+           (string-append
+             "("
+             (string-join
+              `(
+                ,@(if key
+                    (list (string-append "key=" key))
+                    '())
+               ,@(if algorithm
+                   (list (string-append "a=" algorithm))
+                   '())
+               ,@(if method
+                   (list (string-append "c=" method))
+                   '())
+               ,@(if domain
+                   (list (string-append "d=" domain))
+                   '())
+               ,@(if identity
+                   (list (string-append "i=" identity))
+                   '())
+               ,@(if selector
+                   (list (string-append "s=" selector))
+                   '()))
+              ",")
+             ")")
+           "")))))
+
+(define-record-type* <dkimproxy-out-configuration>
+  dkimproxy-out-configuration make-dkimproxy-out-configuration
+  dkimproxy-out-configuration?
+  (package     dkimproxy-out-configuration-package
+               (default dkimproxy))
+  (listen      dkimproxy-out-configuration-listen
+               (default #f))
+  (relay       dkimproxy-out-configuration-relay
+               (default #f))
+  (list-id-map dkimproxy-out-configuration-list-id-map
+               (default '()))
+  (sender-map  dkimproxy-out-configuration-sender-map
+               (default '()))
+  (reject-error? dkimproxy-out-configuration-sender-reject-error?
+                 (default #f))
+  (config-file dkimproxy-out-configuration-config-file
+               (default #f)))
+
+(define (generate-map-file config filename)
+  (apply plain-file filename
+         (map (lambda (config)
+                (match config
+                  ((selector (config ...))
+                   (string-append
+                     selector " "
+                     (string-join
+                       (map generate-dkimproxy-out-signature-configuration config)
+                       "\n")))
+                  ((selector config)
+                   (string-append
+                     selector " "
+                     (generate-dkimproxy-out-signature-configuration config)))))
+              config)))
+
+(define dkimproxy-out-shepherd-service
+  (match-lambda
+    (($ <dkimproxy-out-configuration> package listen relay list-id-map sender-map
+        reject-error? config-file)
+     (list (shepherd-service
+             (provision '(dkimproxy-out))
+             (requirement '(loopback))
+             (documentation "Outbound DKIM proxy.")
+             (start (let ((proxy (file-append package "/bin/dkimproxy.out")))
+                      (if config-file
+                        #~(make-forkexec-constructor
+                            (list #$proxy (string-append "--conf_file=" #$config-file)
+                                  "--pidfile=/var/run/dkimproxy.out.pid"
+                                  "--user=dkimproxy" "--group=dkimproxy")
+                            #:pid-file "/var/run/dkimproxy.out.pid")
+                        (let* ((first-signature (match sender-map
+                                                 (((sender (signature _ ...)) _ ...)
+                                                   signature)
+                                                 (((sender signature) _ ...)
+                                                   signature)))
+                               (domains
+                                 (apply append
+                                   (map
+                                     (lambda (sender)
+                                       (match sender
+                                         (((domains ...) config)
+                                          domains)
+                                         ((domain config)
+                                          domain)))
+                                     sender-map)))
+                               (sender-map (generate-map-file sender-map
+                                                              "sender.map"))
+                               (listid-map
+                                 (if (null? list-id-map)
+                                     #f
+                                     (generate-map-file list-id-map "listid.map")))
+                               (keyfile
+                                 (dkimproxy-out-signature-configuration-key
+                                   first-signature))
+                               (selector
+                                 (dkimproxy-out-signature-configuration-selector
+                                   first-signature))
+                               (method
+                                 (dkimproxy-out-signature-configuration-method
+                                   first-signature))
+                               (signature
+                                 (match (dkimproxy-out-signature-configuration-type
+                                          first-signature)
+				   ('dkim "dkim")
+				   ('domainkeys "domainkeys"))))
+                          #~(make-forkexec-constructor
+                              `(,#$proxy "--pidfile=/var/run/dkimproxy.out.pid"
+                                "--user=dkimproxy" "--group=dkimproxy"
+                                ,(string-append "--listen=" #$listen)
+                                ,(string-append "--relay=" #$relay)
+                                ,(string-append "--sender_map=" #$sender-map)
+                                ,@(if #$listid-map
+                                    (list
+                                      (string-append "--listid_map=" #$listid-map))
+                                    '())
+                                ,(string-append "--domain=" #$domains)
+                                ,(string-append "--keyfile=" #$keyfile)
+                                ,(string-append "--selector=" #$selector)
+                                ,@(if #$method
+                                      (list
+                                        (string-append "--method=" #$method))
+                                      '())
+                                ,@(if #$reject-error?
+                                      '("--reject_error")
+                                      '())
+                                ,@(if #$signature
+                                      (list
+                                        (string-append "--signature=" #$signature))
+                                      '())))))))
+             (stop #~(make-kill-destructor)))))))
+
+(define %dkimproxy-accounts
+  (list (user-group
+          (name "dkimproxy")
+          (system? #t))
+        (user-account
+          (name "dkimproxy")
+          (group "dkimproxy")
+          (system? #t)
+          (comment "Dkimproxy user")
+          (home-directory "/var/empty")
+          (shell (file-append shadow "/sbin/nologin")))))
+
+(define dkimproxy-out-service-type
+  (service-type
+    (name 'dkimproxy-out)
+    (extensions
+      (list (service-extension account-service-type
+                               (const %dkimproxy-accounts))
+            (service-extension shepherd-root-service-type
+                               dkimproxy-out-shepherd-service)))))
-- 
2.22.0


--MP_/C.r5cqd+UsU1nFPA8x9ekPj--




Acknowledgement sent to Julien Lepiller <julien@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#37222; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 4 Feb 2021 11:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.