From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 30 00:50:40 2017 Received: (at submit) by debbugs.gnu.org; 30 Mar 2017 04:50:40 +0000 Received: from localhost ([127.0.0.1]:51812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctS2i-0003GY-9y for submit@debbugs.gnu.org; Thu, 30 Mar 2017 00:50:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctS2f-0003GD-Hm for submit@debbugs.gnu.org; Thu, 30 Mar 2017 00:50:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctS2Y-0001JO-C7 for submit@debbugs.gnu.org; Thu, 30 Mar 2017 00:50:32 -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.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49389) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ctS2Y-0001JA-8P for submit@debbugs.gnu.org; Thu, 30 Mar 2017 00:50:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctS2U-0000Hv-JD for guix-patches@gnu.org; Thu, 30 Mar 2017 00:50:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctS2P-0001Bv-QJ for guix-patches@gnu.org; Thu, 30 Mar 2017 00:50:26 -0400 Received: from mail-pg0-x229.google.com ([2607:f8b0:400e:c05::229]:35932) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ctS2P-0001BN-Fu for guix-patches@gnu.org; Thu, 30 Mar 2017 00:50:21 -0400 Received: by mail-pg0-x229.google.com with SMTP id g2so27176414pge.3 for ; Wed, 29 Mar 2017 21:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:user-agent:from:to:subject:date:message-id:mime-version; bh=7tJHw8TePc0DEZXuUc7LOlAgEA+hiIPf1P/kmZpfDI0=; b=tTONp5Y7CjyhL1pSetAz+/myljC9nLaoaIi32EZ44Q4mqQbM35qDymCx9Shwxu5Ezv dWoiPp8Ow1lRSmiYHTPoTCXgNkIr7eQcxbk//fmB9LXzWCrDebIp5ncPn00VUSroK2FC W9elsoeACzlzkTWjP1Sx+1F3U14cO5LoXmfNWgtnf+VClFLRQatycgE8qdhcOV+MPHUS RiJOxpZ48o1UR4WZeMmbnSwhrT1FXzPtPlhQ4BvrT/abLMRhQx6BvUOom9p9nBnoXWyW AL7xvaowAAT8co1DkO1h4G5mi5sUjs/PCS6cto3TLdpH8qZTOnwXM1nD8ZTgwQKYp+EQ ZAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:user-agent:from:to:subject:date :message-id:mime-version; bh=7tJHw8TePc0DEZXuUc7LOlAgEA+hiIPf1P/kmZpfDI0=; b=FUojDYRRdZCVYkp2L9ZJLFobxvYu6lf73+ZbXmrXyVIDkaMUrX508hoPADjTAlwb2f fEVV23YEZV4OYoLaq7fNmbzMo1b8F9wFXJrXVg3DTsxEXwEZoUw9Wcb9hi6BrWlfJu12 etO4ko1KgKpcz2JJTdkhNKnKNZXZ8OWQFr2OJPeo5AFP1mfX80flfhUhnSndb2L61S5N G9P5mrjbqyDiGKSfQlPclGhcg+svu8IfMCZsQApuiIqvgBuBBSANEr8NghyYzdOsZcyT LWO2SVLWz/mAo/O/NAWzT/fHwfoOFojNuVZ0CyML26TVnce/nEMEXYUCVc5oG1Om5uwB 7eHQ== X-Gm-Message-State: AFeK/H1wkYm8FQTCgFNshqU+fSULjx4jCbmZxHID9i+G2pVNgO7AQ4+M7AxhLE7bRBBGAA== X-Received: by 10.84.217.212 with SMTP id d20mr4603120plj.80.1490849420185; Wed, 29 Mar 2017 21:50:20 -0700 (PDT) Received: from charizard (natp-s01-129-78-56-163.gw.usyd.edu.au. [129.78.56.163]) by smtp.gmail.com with ESMTPSA id j19sm1222010pfk.4.2017.03.29.21.50.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Mar 2017 21:50:19 -0700 (PDT) User-agent: mu4e 0.9.18; emacs 25.1.1 From: Carlo Zancanaro To: guix-patches@gnu.org Subject: exim service patches (including mail-aliases-service-type) Date: Thu, 30 Mar 2017 15:50:15 +1100 Message-ID: <87fuhvtlko.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain I've wanted to fix up the exim service given Ludo's comments on my last few patches (see #25789), so here are some patches to introduce a mail-aliases-service-type, to change exim-service-type to use it (instead of doing its own thing), and to add a system test for exim-service-type. I haven't yet written the updates necessary to the documentation, but I thought I'd send these now to get feedback before I do the work to fix up the docs. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-services-Add-mail-aliases-service-type.patch Content-Transfer-Encoding: quoted-printable From=2011a5223f4a9487d3a9a17925488e18e80baec843 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 30 Mar 2017 15:25:58 +1100 Subject: [PATCH 1/3] services: Add mail-aliases-service-type. * gnu/services/mail.scm (mail-aliases-etc): New procedure. (mail-aliases-service-type): New variable. =2D-- gnu/services/mail.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 05978e006..146ed951f 100644 =2D-- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -35,6 +35,7 @@ #:use-module (guix gexp) #:use-module (ice-9 match) #:use-module (ice-9 format) + #:use-module (srfi srfi-1) #:export (dovecot-service dovecot-service-type dovecot-configuration @@ -57,6 +58,8 @@ opensmtpd-service-type %default-opensmtpd-config-file =20 + mail-aliases-service-type + exim-configuration exim-configuration? exim-service-type @@ -1662,6 +1665,31 @@ accept from local for any relay =20 ;;; +;;; mail aliases. +;;; + +(define (mail-aliases-etc aliases) + `(("aliases" ,(plain-file "aliases" + ;; Ideally we'd use a format string like + ;; "~:{~a: ~{~a~^,~}\n~}", but it gives a + ;; warning that I can't figure out how to fix, + ;; so we'll just use string-join below instead. + (format #f "~:{~a: ~a\n~}" + (map (lambda (entry) + (list (car entry) + (string-join (cdr entry) = ","))) + aliases)))))) + +(define mail-aliases-service-type + (service-type + (name 'mail-aliases) + (extensions + (list (service-extension etc-service-type mail-aliases-etc))) + (compose concatenate) + (extend append))) + + +;;; ;;; Exim. ;;; =20 =2D-=20 2.12.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-services-Make-exim-service-type-use-mail-aliases-ser.patch Content-Transfer-Encoding: quoted-printable From=208ac4f5fba3420ba5525cd7dff93d30f7fed8b0ae Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 30 Mar 2017 15:28:26 +1100 Subject: [PATCH 2/3] services: Make exim-service-type use mail-aliases-service-type * gnu/services/mail.scm (exim-configuration)[aliases]: Remove field. (exim-activation, exim-shepherd-service): Remove alias from matches. (exim-etc): Remove procedure. (exim-service-type): Extend mail-aliases-service-type instead of etc-service-type. =2D-- gnu/services/mail.scm | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 146ed951f..f16f7e026 100644 =2D-- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -1699,9 +1699,7 @@ accept from local for any relay (package exim-configuration-package ; (default exim)) (config-file exim-configuration-config-file ;file-like =2D (default #f)) =2D (aliases exim-configuration-aliases ;; list of lists =2D (default '()))) + (default #f))) =20 (define %exim-accounts (list (user-group @@ -1728,7 +1726,7 @@ exim_group =3D exim =20 (define exim-shepherd-service (match-lambda =2D (($ package config-file aliases) + (($ package config-file) (list (shepherd-service (provision '(exim mta)) (documentation "Run the exim daemon.") @@ -1741,7 +1739,7 @@ exim_group =3D exim =20 (define exim-activation (match-lambda =2D (($ package config-file aliases) + (($ package config-file) (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) @@ -1754,20 +1752,6 @@ exim_group =3D exim (zero? (system* #$(file-append package "/bin/exim") "-bV" "-C" #$(exim-computed-config-file package= config-file)))))))) =20 =2D(define exim-etc =2D (match-lambda =2D (($ package config-file aliases) =2D `(("aliases" ,(plain-file "aliases" =2D ;; Ideally we'd use a format string like =2D ;; "~:{~a: ~{~a~^,~}\n~}", but it gives a =2D ;; warning that I can't figure out how to= fix, =2D ;; so we'll just use string-join below in= stead. =2D (format #f "~:{~a: ~a\n~}" =2D (map (lambda (entry) =2D (list (car entry) =2D (string-join (cdr en= try) ","))) =2D aliases)))))))) =2D (define exim-profile (compose list exim-configuration-package)) =20 @@ -1779,4 +1763,4 @@ exim_group =3D exim (service-extension account-service-type (const %exim-accounts)) (service-extension activation-service-type exim-activation) (service-extension profile-service-type exim-profile) =2D (service-extension etc-service-type exim-etc))))) + (service-extension mail-aliases-service-type (const '())))))) =2D-=20 2.12.0 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0003-tests-mail-Add-test-for-exim.patch Content-Transfer-Encoding: quoted-printable From=20984298f4cea4ac3bff530a4a767bf96567ec284f Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 30 Mar 2017 15:13:56 +1100 Subject: [PATCH 3/3] tests: mail: Add test for exim * gnu/tests/mail.scm (%exim-os, %test-exim): New variables. (run-exim-test): New procedure. =2D-- gnu/tests/mail.scm | 143 +++++++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm index 47328a54a..1d8c0e22e 100644 =2D-- a/gnu/tests/mail.scm +++ b/gnu/tests/mail.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 Sou Bunnbu +;;; Copyright =C2=A9 2017 Carlo Zancanaro ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,7 +30,9 @@ #:use-module (guix gexp) #:use-module (guix monads) #:use-module (guix store) =2D #:export (%test-opensmtpd)) + #:use-module (ice-9 ftw) + #:export (%test-opensmtpd + %test-exim)) =20 (define %opensmtpd-os (operating-system @@ -157,3 +160,141 @@ accept from any for local deliver to mbox (name "opensmtpd") (description "Send an email to a running OpenSMTPD server.") (value (run-opensmtpd-test)))) + + +(define %exim-os + (operating-system + (host-name "komputilo") + (timezone "Europe/Berlin") + (locale "en_US.UTF-8") + (bootloader (grub-configuration (device #f))) + (file-systems %base-file-systems) + (firmware '()) + (services (cons* + (dhcp-client-service) + (service mail-aliases-service-type '()) + (service exim-service-type + (exim-configuration + (config-file + (plain-file "exim.conf" " +primary_hostname =3D komputilo +domainlist local_domains =3D @ +domainlist relay_to_domains =3D +hostlist relay_from_hosts =3D localhost + +never_users =3D + +acl_smtp_rcpt =3D acl_check_rcpt +acl_smtp_data =3D acl_check_data + +begin acl + +acl_check_rcpt: + accept +acl_check_data: + accept +")))) + %base-services)))) + +(define (run-exim-test) + "Return a test of an OS running an Exim service." + (mlet* %store-monad ((command (system-qemu-image/shared-store-script + (marionette-operating-system + %exim-os + #:imported-modules '((gnu services herd)= )) + #:graphic? #f))) + (define test + (with-imported-modules '((gnu build marionette) + (ice-9 ftw)) + #~(begin + (use-modules (rnrs base) + (srfi srfi-64) + (ice-9 ftw) + (ice-9 rdelim) + (ice-9 regex) + (gnu build marionette)) + + (define marionette + (make-marionette + ;; Enable TCP forwarding of the guest's port 25. + '(#$command "-net" "user,hostfwd=3Dtcp::1025-:25"))) + + (define (read-reply-code port) + "Read a SMTP reply from PORT and return its reply code." + (let* ((line (read-line port)) + (mo (string-match "([0-9]+)([ -]).*" line)) + (code (string->number (match:substring mo 1))) + (finished? (string=3D " " (match:substring mo 2)))) + (if finished? + code + (read-reply-code port)))) + + (define smtp (socket AF_INET SOCK_STREAM 0)) + (define addr (make-socket-address AF_INET INADDR_LOOPBACK 1025= )) + + (mkdir #$output) + (chdir #$output) + + (test-begin "exim") + + (test-assert "service is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'exim) + #t) + marionette)) + + (sleep 1) ;; give the service time to start working + + (connect smtp addr) + ;; Be greeted. + (test-eq "greeting received" + 220 (read-reply-code smtp)) + ;; Greet the server. + (write-line "EHLO somehost" smtp) + (test-eq "greeting successful" + 250 (read-reply-code smtp)) + ;; Set sender email. + (write-line "MAIL FROM: test@example.com" smtp) + (test-eq "sender set" + 250 (read-reply-code smtp)) ;250 + ;; Set recipient email. + (write-line "RCPT TO: root@komputilo" smtp) + (test-eq "recipient set" + 250 (read-reply-code smtp)) ;250 + ;; Send message. + (write-line "DATA" smtp) + (test-eq "data begun" + 354 (read-reply-code smtp)) ;354 + (write-line "Subject: Hello" smtp) + (newline smtp) + (write-line "Nice to meet you!" smtp) + (write-line "." smtp) + (test-eq "message sent" + 250 (read-reply-code smtp)) ;250 + ;; Say goodbye. + (write-line "QUIT" smtp) + (test-eq "quit successful" + 221 (read-reply-code smtp)) ;221 + (close smtp) + + (test-eq "the email is received" + 1 + (marionette-eval + '(begin + (use-modules (ice-9 ftw)) + (length (scandir "/var/spool/exim/msglog" + (lambda (x) (not (string-prefix? "." x)= ))))) + marionette)) + + (test-end) + (exit (=3D (test-runner-fail-count (test-runner-current)) 0)))= )) + + (gexp->derivation "exim-test" test))) + +(define %test-exim + (system-test + (name "exim") + (description "Send an email to a running an Exim server.") + (value (run-exim-test)))) =2D-=20 2.12.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEwWt2bKTcV+mIZ20oCShLEsLiKqIFAljcjocACgkQCShLEsLi KqLl7wgAypS+6iHVFD7qW+QLSV4hsPPmwF3kegQktyr84tBiE20qxSo1pSqGLUsB 5tKv8Txn8bTRcBk4p5Evm0ZBvA5zL00E/JqOCz3aJNM12GRM8t6ZyDX454pBov5v Q7ULek7DQIxmRqEJGrn1X5k3BdPcm1L9xZdGDY2qlvfvsDtrlPSElDeIVO1LoZyo w5ZgQIPNMHnT89+aKuayo2jVW0GVoBQ5TsHIB4kELt4DDPeQw9q9DQisjT7FIIeA Cs7nasYe7MJBijwiRfQsMnB9lUKco1eYXkgeI6dSEas1cRWCZhGUooCKmx3UMZdY Ifv8btaqecZJLACO2AEj8RFgAAxycw== =2G6F -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 07 17:25:37 2017 Received: (at 26306) by debbugs.gnu.org; 7 Apr 2017 21:25:37 +0000 Received: from localhost ([127.0.0.1]:36861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwbNx-0005Kg-7F for submit@debbugs.gnu.org; Fri, 07 Apr 2017 17:25:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwbNv-0005KT-0e for 26306@debbugs.gnu.org; Fri, 07 Apr 2017 17:25:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwbNm-0004Is-N0 for 26306@debbugs.gnu.org; Fri, 07 Apr 2017 17:25:29 -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.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwbNm-0004Io-JI; Fri, 07 Apr 2017 17:25:26 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:42696 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cwbNl-0005A5-VT; Fri, 07 Apr 2017 17:25:26 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: bug#26306: exim service patches (including mail-aliases-service-type) References: <87fuhvtlko.fsf@zancanaro.id.au> Date: Fri, 07 Apr 2017 23:25:23 +0200 In-Reply-To: <87fuhvtlko.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Thu, 30 Mar 2017 15:50:15 +1100") Message-ID: <87a87ruczg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26306 Cc: 26306@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi Carlo, Carlo Zancanaro skribis: > I've wanted to fix up the exim service given Ludo's comments on my last > few patches (see #25789), so here are some patches to introduce a > mail-aliases-service-type, to change exim-service-type to use it > (instead of doing its own thing), and to add a system test for > exim-service-type. > > I haven't yet written the updates necessary to the documentation, but I > thought I'd send these now to get feedback before I do the work to fix > up the docs. This all LGTM. Minor comments: > From 11a5223f4a9487d3a9a17925488e18e80baec843 Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Thu, 30 Mar 2017 15:25:58 +1100 > Subject: [PATCH 1/3] services: Add mail-aliases-service-type. > > * gnu/services/mail.scm (mail-aliases-etc): New procedure. > (mail-aliases-service-type): New variable. [...] > +(define (mail-aliases-etc aliases) > + `(("aliases" ,(plain-file "aliases" > + ;; Ideally we'd use a format string like > + ;; "~:{~a: ~{~a~^,~}\n~}", but it gives a > + ;; warning that I can't figure out how to fi= x, > + ;; so we'll just use string-join below inste= ad. > + (format #f "~:{~a: ~a\n~}" > + (map (lambda (entry) > + (list (car entry) > + (string-join (cdr entry= ) ","))) Please avoid car/cdr: (match-lambda ((user aliases ...) (list user (string-joint aliases ",")))) > +(define mail-aliases-service-type > + (service-type > + (name 'mail-aliases) > + (extensions > + (list (service-extension etc-service-type mail-aliases-etc))) > + (compose concatenate) > + (extend append))) If you add it to guix.texi (which would be nice) please leave a note as to what the values are (a list of user/addresses lists, right?). > From 8ac4f5fba3420ba5525cd7dff93d30f7fed8b0ae Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Thu, 30 Mar 2017 15:28:26 +1100 > Subject: [PATCH 2/3] services: Make exim-service-type use > mail-aliases-service-type > > * gnu/services/mail.scm (exim-configuration)[aliases]: Remove field. > (exim-activation, exim-shepherd-service): Remove alias from matches. > (exim-etc): Remove procedure. > (exim-service-type): Extend mail-aliases-service-type instead of > etc-service-type. OK. > From 984298f4cea4ac3bff530a4a767bf96567ec284f Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Thu, 30 Mar 2017 15:13:56 +1100 > Subject: [PATCH 3/3] tests: mail: Add test for exim > > * gnu/tests/mail.scm (%exim-os, %test-exim): New variables. > (run-exim-test): New procedure. Nice test! > +(define %exim-os > + (operating-system > + (host-name "komputilo") Due to 892d9089a88abaa2ef1127f16308d03f4f08a4ce, this should use =E2=80=98simple-operating-system=E2=80=99. Apologies! With a guix.texi update, it=E2=80=99ll be perfect. Could you send updated patches? Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 07 17:30:04 2017 Received: (at 26306) by debbugs.gnu.org; 7 Apr 2017 21:30:04 +0000 Received: from localhost ([127.0.0.1]:36865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwbSF-0005Rc-Rc for submit@debbugs.gnu.org; Fri, 07 Apr 2017 17:30:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwbSD-0005Qh-KU for 26306@debbugs.gnu.org; Fri, 07 Apr 2017 17:30:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwbS5-00055A-9K for 26306@debbugs.gnu.org; Fri, 07 Apr 2017 17:29:56 -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,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwbS5-000554-61; Fri, 07 Apr 2017 17:29:53 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:42942 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cwbS4-00017B-LV; Fri, 07 Apr 2017 17:29:52 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: bug#26306: exim service patches (including mail-aliases-service-type) References: <87fuhvtlko.fsf@zancanaro.id.au> <87a87ruczg.fsf@gnu.org> Date: Fri, 07 Apr 2017 23:29:50 +0200 In-Reply-To: <87a87ruczg.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 07 Apr 2017 23:25:23 +0200") Message-ID: <8760ifucs1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26306 Cc: 26306@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) BTW the tests pass but the log is a bit fishy: --8<---------------cut here---------------start------------->8--- LOG: MAIN Warning: purging the environment. Suggested action: use keep_environment. 408 LOG: MAIN 408 exim 4.87_1 daemon started: pid=3D408, no queue runs, listening for= SMTP on port 25 (IPv4) 410 LOG: MAIN 410 <=3D test@example.com H=3D(somehost) [10.0.2.2] P=3Desmtp S=3D225 411 LOG: MAIN PANIC DIE 411 re-exec of exim (/gnu/store/dph4aa2ql680y92rv1f0sg1h2218bnmm-exim-4= .87.1/bin/exim) with -Mc failed: Permission denied [ 10.990230] exim[411]: segfault at 0 ip 00007f56dc8eb04d sp 00007fffb714= 5d78 error 6 in libc-2.25.so[7f56dc867000+196000] 410 LOG: smtp_connection MAIN 410 SMTP connection from (somehost) [10.0.2.2] closed by QUIT --8<---------------cut here---------------end--------------->8--- Do you also get this segfault and =E2=80=9CMAIN PANIC DIE=E2=80=9D thing? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 17 17:27:31 2017 Received: (at 26306) by debbugs.gnu.org; 17 Apr 2017 21:27:32 +0000 Received: from localhost ([127.0.0.1]:53038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0EBH-0001VS-Ko for submit@debbugs.gnu.org; Mon, 17 Apr 2017 17:27:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0EBG-0001VF-4L for 26306@debbugs.gnu.org; Mon, 17 Apr 2017 17:27:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0EB7-0005W5-Rp for 26306@debbugs.gnu.org; Mon, 17 Apr 2017 17:27:25 -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.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0EB7-0005W1-OS; Mon, 17 Apr 2017 17:27:21 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:38528 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d0EB7-0008NL-1W; Mon, 17 Apr 2017 17:27:21 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: bug#26306: exim service patches (including mail-aliases-service-type) References: <87fuhvtlko.fsf@zancanaro.id.au> <87a87ruczg.fsf@gnu.org> Date: Mon, 17 Apr 2017 23:27:18 +0200 In-Reply-To: <87a87ruczg.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 07 Apr 2017 23:25:23 +0200") Message-ID: <8760i2pvwp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26306 Cc: 26306@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi Carlo, Did you have a chance to look into this? Those patches are 90% there! :-) Ludo=E2=80=99. ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Hi Carlo, > > Carlo Zancanaro skribis: > >> I've wanted to fix up the exim service given Ludo's comments on my last >> few patches (see #25789), so here are some patches to introduce a >> mail-aliases-service-type, to change exim-service-type to use it >> (instead of doing its own thing), and to add a system test for >> exim-service-type. >> >> I haven't yet written the updates necessary to the documentation, but I >> thought I'd send these now to get feedback before I do the work to fix >> up the docs. > > This all LGTM. > > Minor comments: > >> From 11a5223f4a9487d3a9a17925488e18e80baec843 Mon Sep 17 00:00:00 2001 >> From: Carlo Zancanaro >> Date: Thu, 30 Mar 2017 15:25:58 +1100 >> Subject: [PATCH 1/3] services: Add mail-aliases-service-type. >> >> * gnu/services/mail.scm (mail-aliases-etc): New procedure. >> (mail-aliases-service-type): New variable. > > [...] > >> +(define (mail-aliases-etc aliases) >> + `(("aliases" ,(plain-file "aliases" >> + ;; Ideally we'd use a format string like >> + ;; "~:{~a: ~{~a~^,~}\n~}", but it gives a >> + ;; warning that I can't figure out how to f= ix, >> + ;; so we'll just use string-join below inst= ead. >> + (format #f "~:{~a: ~a\n~}" >> + (map (lambda (entry) >> + (list (car entry) >> + (string-join (cdr entr= y) ","))) > > Please avoid car/cdr: > > (match-lambda > ((user aliases ...) > (list user (string-joint aliases ",")))) > >> +(define mail-aliases-service-type >> + (service-type >> + (name 'mail-aliases) >> + (extensions >> + (list (service-extension etc-service-type mail-aliases-etc))) >> + (compose concatenate) >> + (extend append))) > > If you add it to guix.texi (which would be nice) please leave a note as > to what the values are (a list of user/addresses lists, right?). > >> From 8ac4f5fba3420ba5525cd7dff93d30f7fed8b0ae Mon Sep 17 00:00:00 2001 >> From: Carlo Zancanaro >> Date: Thu, 30 Mar 2017 15:28:26 +1100 >> Subject: [PATCH 2/3] services: Make exim-service-type use >> mail-aliases-service-type >> >> * gnu/services/mail.scm (exim-configuration)[aliases]: Remove field. >> (exim-activation, exim-shepherd-service): Remove alias from matches. >> (exim-etc): Remove procedure. >> (exim-service-type): Extend mail-aliases-service-type instead of >> etc-service-type. > > OK. > >> From 984298f4cea4ac3bff530a4a767bf96567ec284f Mon Sep 17 00:00:00 2001 >> From: Carlo Zancanaro >> Date: Thu, 30 Mar 2017 15:13:56 +1100 >> Subject: [PATCH 3/3] tests: mail: Add test for exim >> >> * gnu/tests/mail.scm (%exim-os, %test-exim): New variables. >> (run-exim-test): New procedure. > > Nice test! > >> +(define %exim-os >> + (operating-system >> + (host-name "komputilo") > > Due to 892d9089a88abaa2ef1127f16308d03f4f08a4ce, this should use > =E2=80=98simple-operating-system=E2=80=99. Apologies! > > With a guix.texi update, it=E2=80=99ll be perfect. > > Could you send updated patches? > > Thanks! > > Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 17 20:58:10 2017 Received: (at 26306) by debbugs.gnu.org; 18 Apr 2017 00:58:10 +0000 Received: from localhost ([127.0.0.1]:53261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0HT8-0008NX-98 for submit@debbugs.gnu.org; Mon, 17 Apr 2017 20:58:10 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:36556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0HT6-0008NL-VE for 26306@debbugs.gnu.org; Mon, 17 Apr 2017 20:58:09 -0400 Received: by mail-pf0-f172.google.com with SMTP id 194so33550306pfv.3 for <26306@debbugs.gnu.org>; Mon, 17 Apr 2017 17:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=0UWqYH9AwLSWdVUonsTiXXEb8MTEM2hfPyvDoZnzOHA=; b=ZnUizsB8MULmr44ey82zhdswo8Iu4f32/Ebkw1MW0jad3LlwwcpcEAWBExNYn62FZ0 8rizTy0+mY3pj/8L/z0LmENIbM2Ft6hGOFCBKVg1bY2u45ayaa1uwTuTg+WvJtRKIjlu Mp5t2+RuruQYBjsnIpN4FJUP4cbL9f0fW3LCVPnDeW88/qbMDUZx6ESCORh3ztn9VQSn FOZMLBFGXBicDUP9J+gcIzOLrrMzwokL8t4Eyy9krQru0XaHspqvqr3nCmebNW6OeD0H Pq73a4J1XVaW5NXpl20dfNhBE4aMVC7mMHp7SH9PjSiN2hMMmvSljuHgwdvaACfRemq0 OWMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=0UWqYH9AwLSWdVUonsTiXXEb8MTEM2hfPyvDoZnzOHA=; b=pxUKU3jxhjbzI3G5BJ5oJPLdoRuYyfkRKYdsJDSVt8cq+/UL0Bb7dRWgTZHVJyxLns /YrpeibcY2NFC3Wsg09f+7UnZoHsMTxUcNKB4XW8f/ea6pwpGMTYDpOYobRaLFFmU5Yw Fcah/Nj9rjZE0uKmbYAmzCodZliKRkYcixDZVkd1BdrFZlyTrLmismX0IW/QFTjoQDxF 5UXtcMa+pa/ffgmORoG5b1tx6oCIPXr0UJAfk9blKRZqv+HgEi6Ss1aMTDXznhe30PaG 1CiTDBT6K3MqPybvu8IZuZ5nQUDsguyq5hkFVEv1Hu1JRlZp24BFKcBhF60E2fTUr9Rr bgPw== X-Gm-Message-State: AN3rC/7VoaH3QgGtDVIIYThrcdb4N7MS6nbGXXxkfWetiiDl+2f9uVAc I0csrqXGYrbsPOS1aDY= X-Received: by 10.98.72.86 with SMTP id v83mr6632604pfa.29.1492477082526; Mon, 17 Apr 2017 17:58:02 -0700 (PDT) Received: from gengar (14-200-183-160.static.tpgi.com.au. [14.200.183.160]) by smtp.gmail.com with ESMTPSA id q64sm20129796pga.56.2017.04.17.17.57.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Apr 2017 17:58:01 -0700 (PDT) References: <87fuhvtlko.fsf@zancanaro.id.au> <87a87ruczg.fsf@gnu.org> <8760i2pvwp.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.1.1 From: Carlo Zancanaro To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#26306: exim service patches (including mail-aliases-service-type) In-reply-to: <8760i2pvwp.fsf@gnu.org> Date: Tue, 18 Apr 2017 10:57:56 +1000 Message-ID: <87k26isfaj.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 26306 Cc: 26306@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey Ludo, On Mon, Apr 17 2017, Ludovic Court=C3=A8s wrote: > Did you have a chance to look into this? Those patches are 90% there! > :-) Sorry, yeah. I started to look at it, particularly trying to fix the MAIN PANIC DIE issue that you mentioned in the other mail. I do see the same issue, but I've struggled to find out how to fix it. I have some time over the next few days, so I'll try to clean up these patches and re-send them this week, but I don't think I'll be able to fix the segfault/MAIN PANIC DIE issue. I'm fairly sure it only affects the tests, though, and exim behaves normally when in actual use. Carlo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEwWt2bKTcV+mIZ20oCShLEsLiKqIFAlj1ZJQACgkQCShLEsLi KqLOOwgAvI0VJRUcsYlybWKluqf5D2zgklqzHg04RUTMX848wmsio4jF11Ce5AOH 2KA/j8jYLMUr4UKp1y73WREEoUtEX7Xtv5I/ynyujBg5NrZFNJzPSDfv1FnHqsWN goMBuwvs3AJe/MGB9HH4+0uP3qCskoozYq2gG/sv/3BxtW4quyeD2p+eoJMQdnBL sArnzK1ZPwoe3O0kYZTWfCjcWL9qW2l7if1K58aExDrfiNMnzrFsNnI39uTkvE09 b5wW/Jz7dH0jGZfhZdEI9B9le+bLimC2apfTdEAVa3smJafLW8EpWjGtb/C6wId/ 5gOo8ct05wUWD3Kb6AKlbKgB7sjuRQ== =Ib6i -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 18 04:10:14 2017 Received: (at 26306) by debbugs.gnu.org; 18 Apr 2017 08:10:14 +0000 Received: from localhost ([127.0.0.1]:53379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0ODF-0002Cp-Si for submit@debbugs.gnu.org; Tue, 18 Apr 2017 04:10:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0ODE-0002Cd-EV for 26306@debbugs.gnu.org; Tue, 18 Apr 2017 04:10:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0OD8-0003CE-4R for 26306@debbugs.gnu.org; Tue, 18 Apr 2017 04:10:07 -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.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0OD8-0003C7-1I; Tue, 18 Apr 2017 04:10:06 -0400 Received: from [193.50.110.90] (port=46160 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d0OD7-0007kC-80; Tue, 18 Apr 2017 04:10:05 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: bug#26306: exim service patches (including mail-aliases-service-type) References: <87fuhvtlko.fsf@zancanaro.id.au> <87a87ruczg.fsf@gnu.org> <8760i2pvwp.fsf@gnu.org> <87k26isfaj.fsf@zancanaro.id.au> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 29 Germinal an 225 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Tue, 18 Apr 2017 10:10:03 +0200 In-Reply-To: <87k26isfaj.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Tue, 18 Apr 2017 10:57:56 +1000") Message-ID: <87y3uyt9us.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26306 Cc: 26306@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Heya, Carlo Zancanaro skribis: > On Mon, Apr 17 2017, Ludovic Court=C3=A8s wrote: >> Did you have a chance to look into this? Those patches are 90% there! >> :-) > > Sorry, yeah. I started to look at it, particularly trying to fix the > MAIN PANIC DIE issue that you mentioned in the other mail. I do see the > same issue, but I've struggled to find out how to fix it. > > I have some time over the next few days, so I'll try to clean up these > patches and re-send them this week, but I don't think I'll be able to > fix the segfault/MAIN PANIC DIE issue. I'm fairly sure it only affects > the tests, though, and exim behaves normally when in actual use. Sounds reasonable; we can investigate that segfault further eventually. Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 19 10:47:13 2017 Received: (at 26306) by debbugs.gnu.org; 19 Apr 2017 14:47:13 +0000 Received: from localhost ([127.0.0.1]:57029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0qsy-00027e-O0 for submit@debbugs.gnu.org; Wed, 19 Apr 2017 10:47:13 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:36770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0qsw-00027P-AN for 26306@debbugs.gnu.org; Wed, 19 Apr 2017 10:47:11 -0400 Received: by mail-it0-f46.google.com with SMTP id b15so33843558iti.1 for <26306@debbugs.gnu.org>; Wed, 19 Apr 2017 07:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=QuohOIQ/oWjiE2uKbKM4tTiDWLHewHToCZ49z/OVqg4=; b=GbsOP+TyAOtfgTwv+RaEQ8yYBSy3SuCaY5a72KmQw5XrZXqyzhyFkEXSjdQb3HkJOg UHqtK4pjYdAId6HOZZ/P6TexTxHPjVy0ZXSv/OjCmpvPUxyBDz5jqH+N+JEQ/+K4BcUc rfivpSuNow2Li1X7e0PIR62C4jVs9XgKB4utf1vbsPsTssuzLfeVrNukCucSziP8B7QY OJlc+ncO8I65HipLSVxlkcAFdyYSSU+oufAWhpUrIFM8uHaOsvkax20jXKjeO97/10lx CJ7t0qafY9t0jDsrPdcyaB+8jqipV8bR8inzkvrKwWfaNYi9k+lmCcnV8pfiExKQZoYG +7Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=QuohOIQ/oWjiE2uKbKM4tTiDWLHewHToCZ49z/OVqg4=; b=KGyO2K4S0KAvGxxtrjjyRdZkkS3UFksoMyNSOUG/aPBw5IYZlLPkT0OH8vV9XeUdzP pzhpF4gm//F1svL7fQes0cALAg5LZuJ2gSUAf2Kw+jPZW/bZjnbeQ8DrsA4yvxve+j0g I3DR6rkX4jjx0E/OfucxXWD9XeK5D/p4VMX1PkLlXAwCci+lOa7UlCab9+FPzMVRKMsd scLh6td9UIlJOlv0cRBf7TUyH+XJoFrHNXt28yEXUvjliXgDL7Xj3Ftq5SjZ3hTthnxk 5lkFA76oUJfu4GqXi3+BzS8ob+amhn+CwnOAwY5q8m4pDh0cLef/3cBlcnFDlxh9V/e/ mjEA== X-Gm-Message-State: AN3rC/7uWAE8AnCzrRmSDj5mfkqrTU7uwBjYRF3YmbkG8T8DGPihDxVU 4mJ5nplS9w+PFQ== X-Received: by 10.99.185.18 with SMTP id z18mr3025732pge.166.1492613224405; Wed, 19 Apr 2017 07:47:04 -0700 (PDT) Received: from gengar (CPE-58-164-7-76.lnse5.ken.bigpond.net.au. [58.164.7.76]) by smtp.gmail.com with ESMTPSA id p68sm5157023pfp.104.2017.04.19.07.47.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Apr 2017 07:47:03 -0700 (PDT) References: <87fuhvtlko.fsf@zancanaro.id.au> <87a87ruczg.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.1.1 From: Carlo Zancanaro To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#26306: exim service patches (including mail-aliases-service-type) In-reply-to: <87a87ruczg.fsf@gnu.org> Date: Thu, 20 Apr 2017 00:46:57 +1000 Message-ID: <8760i0o3oe.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 26306 Cc: 26306@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey Ludo! On Fri, Apr 07 2017, Ludovic Court=C3=A8s wrote: > Could you send updated patches? I finally got around to fixing up my patches! How exciting. I've also added an extra patch for updating guix.texi. The MAIN PANIC DIE is still an issue, but I'm fairly sure it only affects the tests. Carlo --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-services-Add-mail-aliases-service-type.patch Content-Transfer-Encoding: quoted-printable From=20e2445e69f24baed9f0a625dcd6ff2dbfd8ec7f45 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 30 Mar 2017 15:25:58 +1100 Subject: [PATCH 1/4] services: Add mail-aliases-service-type. * gnu/services/mail.scm (mail-aliases-etc): New procedure. (mail-aliases-service-type): New variable. =2D-- gnu/services/mail.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 20043d751..6325589bf 100644 =2D-- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -35,6 +35,7 @@ #:use-module (guix gexp) #:use-module (ice-9 match) #:use-module (ice-9 format) + #:use-module (srfi srfi-1) #:export (dovecot-service dovecot-service-type dovecot-configuration @@ -57,6 +58,8 @@ opensmtpd-service-type %default-opensmtpd-config-file =20 + mail-aliases-service-type + exim-configuration exim-configuration? exim-service-type @@ -1662,6 +1665,31 @@ accept from local for any relay =20 ;;; +;;; mail aliases. +;;; + +(define (mail-aliases-etc aliases) + `(("aliases" ,(plain-file "aliases" + ;; Ideally we'd use a format string like + ;; "~:{~a: ~{~a~^,~}\n~}", but it gives a + ;; warning that I can't figure out how to fix, + ;; so we'll just use string-join below instead. + (format #f "~:{~a: ~a\n~}" + (map (match-lambda + ((alias addresses ...) + (list alias (string-join addre= sses ",")))) + aliases)))))) + +(define mail-aliases-service-type + (service-type + (name 'mail-aliases) + (extensions + (list (service-extension etc-service-type mail-aliases-etc))) + (compose concatenate) + (extend append))) + + +;;; ;;; Exim. ;;; =20 =2D-=20 2.12.2 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-services-Make-exim-service-type-use-mail-aliases-ser.patch Content-Transfer-Encoding: quoted-printable From=20ddfb6544a2b5404a4845179462e5388740428099 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 30 Mar 2017 15:28:26 +1100 Subject: [PATCH 2/4] services: Make exim-service-type use mail-aliases-service-type * gnu/services/mail.scm (exim-configuration)[aliases]: Remove field. (exim-activation, exim-shepherd-service): Remove alias from matches. (exim-etc): Remove procedure. (exim-service-type): Extend mail-aliases-service-type instead of etc-service-type. =2D-- gnu/services/mail.scm | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 6325589bf..6305f06f8 100644 =2D-- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -1699,9 +1699,7 @@ accept from local for any relay (package exim-configuration-package ; (default exim)) (config-file exim-configuration-config-file ;file-like =2D (default #f)) =2D (aliases exim-configuration-aliases ;; list of lists =2D (default '()))) + (default #f))) =20 (define %exim-accounts (list (user-group @@ -1728,7 +1726,7 @@ exim_group =3D exim =20 (define exim-shepherd-service (match-lambda =2D (($ package config-file aliases) + (($ package config-file) (list (shepherd-service (provision '(exim mta)) (documentation "Run the exim daemon.") @@ -1741,7 +1739,7 @@ exim_group =3D exim =20 (define exim-activation (match-lambda =2D (($ package config-file aliases) + (($ package config-file) (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) @@ -1754,20 +1752,6 @@ exim_group =3D exim (zero? (system* #$(file-append package "/bin/exim") "-bV" "-C" #$(exim-computed-config-file package= config-file)))))))) =20 =2D(define exim-etc =2D (match-lambda =2D (($ package config-file aliases) =2D `(("aliases" ,(plain-file "aliases" =2D ;; Ideally we'd use a format string like =2D ;; "~:{~a: ~{~a~^,~}\n~}", but it gives a =2D ;; warning that I can't figure out how to= fix, =2D ;; so we'll just use string-join below in= stead. =2D (format #f "~:{~a: ~a\n~}" =2D (map (lambda (entry) =2D (list (car entry) =2D (string-join (cdr en= try) ","))) =2D aliases)))))))) =2D (define exim-profile (compose list exim-configuration-package)) =20 @@ -1779,4 +1763,4 @@ exim_group =3D exim (service-extension account-service-type (const %exim-accounts)) (service-extension activation-service-type exim-activation) (service-extension profile-service-type exim-profile) =2D (service-extension etc-service-type exim-etc))))) + (service-extension mail-aliases-service-type (const '())))))) =2D-=20 2.12.2 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0003-tests-mail-Add-test-for-exim.patch Content-Transfer-Encoding: quoted-printable From=20763abe687f7d25f7c6d6cbbc161fca08910b1b3c Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 30 Mar 2017 15:13:56 +1100 Subject: [PATCH 3/4] tests: mail: Add test for exim * gnu/tests/mail.scm (%exim-os, %test-exim): New variables. (run-exim-test): New procedure. =2D-- gnu/tests/mail.scm | 135 +++++++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 134 insertions(+), 1 deletion(-) diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm index d5c08b7f0..247f4f667 100644 =2D-- a/gnu/tests/mail.scm +++ b/gnu/tests/mail.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 Sou Bunnbu +;;; Copyright =C2=A9 2017 Carlo Zancanaro ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,9 @@ #:use-module (guix gexp) #:use-module (guix monads) #:use-module (guix store) =2D #:export (%test-opensmtpd)) + #:use-module (ice-9 ftw) + #:export (%test-opensmtpd + %test-exim)) =20 (define %opensmtpd-os (simple-operating-system @@ -146,3 +149,133 @@ accept from any for local deliver to mbox (name "opensmtpd") (description "Send an email to a running OpenSMTPD server.") (value (run-opensmtpd-test)))) + + +(define %exim-os + (simple-operating-system + (dhcp-client-service) + (service mail-aliases-service-type '()) + (service exim-service-type + (exim-configuration + (config-file + (plain-file "exim.conf" " +primary_hostname =3D komputilo +domainlist local_domains =3D @ +domainlist relay_to_domains =3D +hostlist relay_from_hosts =3D localhost + +never_users =3D + +acl_smtp_rcpt =3D acl_check_rcpt +acl_smtp_data =3D acl_check_data + +begin acl + +acl_check_rcpt: + accept +acl_check_data: + accept +")))))) + +(define (run-exim-test) + "Return a test of an OS running an Exim service." + (mlet* %store-monad ((command (system-qemu-image/shared-store-script + (marionette-operating-system + %exim-os + #:imported-modules '((gnu services herd)= )) + #:graphic? #f))) + (define test + (with-imported-modules '((gnu build marionette) + (ice-9 ftw)) + #~(begin + (use-modules (rnrs base) + (srfi srfi-64) + (ice-9 ftw) + (ice-9 rdelim) + (ice-9 regex) + (gnu build marionette)) + + (define marionette + (make-marionette + ;; Enable TCP forwarding of the guest's port 25. + '(#$command "-net" "user,hostfwd=3Dtcp::1025-:25"))) + + (define (read-reply-code port) + "Read a SMTP reply from PORT and return its reply code." + (let* ((line (read-line port)) + (mo (string-match "([0-9]+)([ -]).*" line)) + (code (string->number (match:substring mo 1))) + (finished? (string=3D " " (match:substring mo 2)))) + (if finished? + code + (read-reply-code port)))) + + (define smtp (socket AF_INET SOCK_STREAM 0)) + (define addr (make-socket-address AF_INET INADDR_LOOPBACK 1025= )) + + (mkdir #$output) + (chdir #$output) + + (test-begin "exim") + + (test-assert "service is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'exim) + #t) + marionette)) + + (sleep 1) ;; give the service time to start talking + + (connect smtp addr) + ;; Be greeted. + (test-eq "greeting received" + 220 (read-reply-code smtp)) + ;; Greet the server. + (write-line "EHLO somehost" smtp) + (test-eq "greeting successful" + 250 (read-reply-code smtp)) + ;; Set sender email. + (write-line "MAIL FROM: test@example.com" smtp) + (test-eq "sender set" + 250 (read-reply-code smtp)) ;250 + ;; Set recipient email. + (write-line "RCPT TO: root@komputilo" smtp) + (test-eq "recipient set" + 250 (read-reply-code smtp)) ;250 + ;; Send message. + (write-line "DATA" smtp) + (test-eq "data begun" + 354 (read-reply-code smtp)) ;354 + (write-line "Subject: Hello" smtp) + (newline smtp) + (write-line "Nice to meet you!" smtp) + (write-line "." smtp) + (test-eq "message sent" + 250 (read-reply-code smtp)) ;250 + ;; Say goodbye. + (write-line "QUIT" smtp) + (test-eq "quit successful" + 221 (read-reply-code smtp)) ;221 + (close smtp) + + (test-eq "the email is received" + 1 + (marionette-eval + '(begin + (use-modules (ice-9 ftw)) + (length (scandir "/var/spool/exim/msglog" + (lambda (x) (not (string-prefix? "." x)= ))))) + marionette)) + + (test-end) + (exit (=3D (test-runner-fail-count (test-runner-current)) 0)))= )) + + (gexp->derivation "exim-test" test))) + +(define %test-exim + (system-test + (name "exim") + (description "Send an email to a running an Exim server.") + (value (run-exim-test)))) =2D-=20 2.12.2 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0004-doc-Update-exim-service-documentation.patch Content-Transfer-Encoding: quoted-printable From=20f133eca18dbf1b6483050ebe9e15ba7eafc457f0 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 19 Apr 2017 23:58:24 +1000 Subject: [PATCH 4/4] doc: Update exim service documentation * doc/guix.texi (Mail Services): Update exim service documentation to remove mail-aliases, add mail-aliases-service-type documentation. =2D-- doc/guix.texi | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f2eba59d9..8cc2c43d0 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -12644,12 +12644,14 @@ should be an @code{exim-configuration} object as = in this example: @example (service exim-service-type (exim-configuration =2D (config-file (local-file "./my-exim.conf")) =2D (aliases '(("postmaster" "bob") =2D ("bob" "bob@@example.com" "bob@@example2.com"))))) + (config-file (local-file "./my-exim.conf")))) @end example @end deffn =20 +In order to use an @code{exim-service-type} service you must also have a +@code{mail-aliases-service-type} service present in your +@code{operating-system} (even if it has no aliases). + @deftp {Data Type} exim-configuration Data type representing the configuration of exim. =20 @@ -12664,16 +12666,34 @@ provided in @code{package}. The resulting configu= ration file is loaded after setting the @code{exim_user} and @code{exim_group} configuration variables. =20 =2D@item @code{aliases} (default: @code{'()}) =2DList of aliases to use when delivering mail on this system. The =2D@code{car} of each list is used to match incoming mail, with the =2D@code{cdr} of each list designating how to deliver it. There may be many =2Ddelivery methods provided, in which case the mail is delivered to them =2Dall. =2D @end table @end deftp =20 +@subsubheading Mail Aliases Service + +@deffn {Scheme Variable} mail-aliases-service-type +This is the type of the service which provides @code{/etc/aliases}, +specifying how to deliver mail to users on this system. + +@example +(service mail-aliases-service-type + '(("postmaster" "bob") + ("bob" "bob@@example.com" "bob@@example2.com"))) +@end example +@end deffn + +The configuration for a @code{mail-aliases-service-type} service is an +association list denoting how to deliver mail that comes to this +system. Each entry is of the form @code{(alias addresses ...)}, with +@code{alias} specifying the local alias and @code{addresses} specifying +where to deliver this user's mail. + +The aliases aren't required to exist as users on the local system. In +the above example, there doesn't need to be a @code{postmaster} entry in +the @code{operating-system}'s @code{user-accounts} in order to deliver +the @code{postmaster} mail to @code{bob} (which subsequently would +deliver mail to @code{bob@@example.com} and @code{bob@@example2.com}). + @node Messaging Services @subsubsection Messaging Services =20 =2D-=20 2.12.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEwWt2bKTcV+mIZ20oCShLEsLiKqIFAlj3eGEACgkQCShLEsLi KqLYAgf+O3BljnvcOUNtJEmuhwm9VUwY5bZ0T63o5fG7djYemYVxhLN4eug4fHAP gIJVyqzeync4U4CBOYb84r40cQ9WRIBNZD3+VWkHXlpntI65fS1Jatfw2my5DDIc NKY2zVO/Cehfz+o1t9XxMovDoOJGA+17T+N16fmi0dUktkD1givQfZ9C0jQ7UbB5 EXLAUjeTaJvus6i/RxXTTOJ/o1dMJ8I/rlVu4wrQVc/HfHpqMti/155ejwIDY4Xu ePVcwcQ25wdjLqfi0c0upxcQA9D2GMzI68fEIPda3Nqqnjt54zmJbogj7GWcnvDq LQvJjgfL3wpwkwoIlHPqCt63fO6R0g== =zmeN -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 19 16:13:20 2017 Received: (at 26306-done) by debbugs.gnu.org; 19 Apr 2017 20:13:20 +0000 Received: from localhost ([127.0.0.1]:57428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0vyZ-0005RF-Vp for submit@debbugs.gnu.org; Wed, 19 Apr 2017 16:13:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41805) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0vyY-0005R2-8S for 26306-done@debbugs.gnu.org; Wed, 19 Apr 2017 16:13:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0vyQ-0006g9-2l for 26306-done@debbugs.gnu.org; Wed, 19 Apr 2017 16:13:13 -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,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0vyP-0006fs-Vr; Wed, 19 Apr 2017 16:13:10 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:39200 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d0vyP-00011U-Br; Wed, 19 Apr 2017 16:13:09 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: bug#26306: exim service patches (including mail-aliases-service-type) References: <87fuhvtlko.fsf@zancanaro.id.au> <87a87ruczg.fsf@gnu.org> <8760i0o3oe.fsf@zancanaro.id.au> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 30 Germinal an 225 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 19 Apr 2017 22:13:07 +0200 In-Reply-To: <8760i0o3oe.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Thu, 20 Apr 2017 00:46:57 +1000") Message-ID: <87bmrsnoks.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26306-done Cc: 26306-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi Carlo! Carlo Zancanaro skribis: > I finally got around to fixing up my patches! How exciting. I've also > added an extra patch for updating guix.texi. Awesome! I=E2=80=99ve committed them after adding a couple of @cindex in t= he manual (to make it easier to find these bits). Thank you! Ludo=E2=80=99. From unknown Mon Aug 18 14:21:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 18 May 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator