From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aIbDKlu9imNwDwAAbAwnHQ (envelope-from ) for ; Sat, 03 Dec 2022 04:07:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +J3WKVu9imP6VQEAG6o9tA (envelope-from ) for ; Sat, 03 Dec 2022 04:07:07 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3044ADDC9 for ; Sat, 3 Dec 2022 04:07:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1IDG-0002VI-AS; Fri, 02 Dec 2022 21:25:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1ID9-0002V0-90 for bug-guix@gnu.org; Fri, 02 Dec 2022 21:25:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1ID8-0004i5-Px for bug-guix@gnu.org; Fri, 02 Dec 2022 21:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1ID8-0002rV-B5 for bug-guix@gnu.org; Fri, 02 Dec 2022 21:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#59423: Invalid 'location' field generated in dovecot configuration Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 03 Dec 2022 02:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59423 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Pierre Langlois Cc: mirai , 59423@debbugs.gnu.org Received: via spool by 59423-submit@debbugs.gnu.org id=B59423.167003428210986 (code B ref 59423); Sat, 03 Dec 2022 02:25:02 +0000 Received: (at 59423) by debbugs.gnu.org; 3 Dec 2022 02:24:42 +0000 Received: from localhost ([127.0.0.1]:50289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1ICo-0002r8-9F for submit@debbugs.gnu.org; Fri, 02 Dec 2022 21:24:42 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:42759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1ICk-0002r1-7I for 59423@debbugs.gnu.org; Fri, 02 Dec 2022 21:24:40 -0500 Received: by mail-qt1-f178.google.com with SMTP id h24so7693088qta.9 for <59423@debbugs.gnu.org>; Fri, 02 Dec 2022 18:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=8Qbuuzc9llTquXxiyRKB3tW6vZlHgAyGWcfVKiU/uQk=; b=gaAgkntzD35lpWYictNZLkt+agLsaCcfepaG+q1IR7+eN5J2fRqn9xgqrmN73/8Z3Z pDhi5Gko7EIHBV6TmL1c9XULYTU4bb5Cvaf4a6EV35Hazy4v9J+DaaYDF7cHFD2cGJnu P8eFKzNHzpb/pjSpIqVvvTN/Tfix0qRabENaDH0evzjOnVLdHNEYKVqvm44zNmMQDGd1 /+vbiGzhcCAhJJiVXovjADa+L8xhsEkAeQIOxv0j8dlwF4xYzq0XC+NtCSZAVxHArujS 691l5uuhENO0erRvbARDGXhFK4aA1Xp6nAGn3JByIomilYnSRZH9DP1sqZ4X3p/dJf4a o6XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8Qbuuzc9llTquXxiyRKB3tW6vZlHgAyGWcfVKiU/uQk=; b=39xWx3A3sIjPCsU9zgjj93B54q9HuZRREWBGgXYR2qzxBt90kqoeZH+JOXiR1DjdpE TnRPHEbGNiXOd2EqksWfcfVYzw3njb89LSEcxe+/ysxvqZAVXEiGyeeBM9DJpTcAJTAa xUl/GDXu/4UIJgN6S1yI0LFZNSfuwhm8Hlg8eJRmoqrEUiXjBMcENqhkeedcgfNFTg1n TC+/mLp6RSPclWLKMUgyjY0HvA8Hu2rLgdmW8zO5u/ixXILMYlnMhyCpGfq0uz3bpUEY A+waABVhnOH29pKTtFiOquH0urAexvWnJNat6rvjtpMbmkC8taNM50EXBcD1wABHFoik dSdQ== X-Gm-Message-State: ANoB5pl+ymxWP7Uwyl+Y2XQGkhPVWevOTz4Ug6BJU66etZtcHKzR/zwO byEJymuiEoYUl62v+JUwIxk= X-Google-Smtp-Source: AA0mqf7xqD6BLhEyEvp+JSKtRWRkrQslBPf2hUUKUveSx3kYssBLjoOCH0Wjx31yHCbNdnj9/7/a/w== X-Received: by 2002:ac8:6f19:0:b0:3a5:3cee:e35 with SMTP id bs25-20020ac86f19000000b003a53cee0e35mr68192602qtb.526.1670034272526; Fri, 02 Dec 2022 18:24:32 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id j11-20020ac8550b000000b003434d3b5938sm5317939qtq.2.2022.12.02.18.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 18:24:31 -0800 (PST) From: Maxim Cournoyer References: <87y1s5wa4p.fsf@gmx.com> <87359ydbnq.fsf@gmx.com> Date: Fri, 02 Dec 2022 21:24:29 -0500 In-Reply-To: <87359ydbnq.fsf@gmx.com> (Pierre Langlois's message of "Thu, 01 Dec 2022 21:55:27 +0000") Message-ID: <878rjpgr6q.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670036827; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=8Qbuuzc9llTquXxiyRKB3tW6vZlHgAyGWcfVKiU/uQk=; b=PS3bTFb+VXuF0xMmS2jCss+hgsSyutr/d2dWlZMv5LE2aRvAQXWg5rQyAebH9vGlrZmE9u W0LXOeSeqcWC+0W/Shv/DaXHttLZmlqPbguT3RoVcRc2Fda1K5UXBYMn7akfR0iSc0beuN voI2JcsVKkkpUWthGtZFrqgeLgXbgQGT6lldyk3ISO5mmONY2rYLVufy1xK4jzG+swupWS v1zH7VltQKESVo21G5ako3iuFei+ugvesUg0yM+k7/qL3ra4HKCTr6HkfS1bmkr9SKmTOY Rdkaba60f7+NeAGk8viWklS4sG+aJAxkMJ3QgnS/SQ5KdRG8E4NdaGLocKniBA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670036827; a=rsa-sha256; cv=none; b=m1n8OcWgfJ5iialAH6b2MEZD+XkQao0GStZkeYx7gmTXrwO8kBmiRm+v28wVjZRZnkQ9Xt 6yDAOrL4sFCdZ1hlv5N4rHHSWyjXrbcUu1Ds0WZzaB1Vyv0AbG31UGne6tSClkO3TqL6Og 0zFHm4CMID7iPVzmuaUPsPjiy8/z5e6HkE3rTwKSbBMU62woxuMMm5OBarGxz/2SNZOUu7 IcsdehvLlWSI2H+N0y52Ax6mJdBUurMNNiVyTchj9cYHRdayBQ2Fs5rd8R0DYyzY3pKKSN QuBL1nwwobQLD4tM6Ws8GIdOoMYsHKZzmWwFvTDEzxH7xzQXhdkW2dNqdehouw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=gaAgkntz; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=gaAgkntz; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3044ADDC9 X-Spam-Score: 6.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: rdf63JLishl9 --=-=-= Content-Type: text/plain Hi Pierre, Pierre Langlois writes: > Hi all! > > As suggested by mirai off-list, it would be nice to have a test that > would have caught the issue. How do people feel about something along > the following patch? The idea is to use namespaces in the dovecot config > to declare the INBOX and another additional mailbox. > > The bug is quite obscure and not really about dovecot itself, so I don't > think adding such a test is strictly necessary, maybe more tests for the > configuration macro would be good instead. But I figured expanding the > dovecot system test can't hurt. Let me know if you agree and I'll format > it properly. Thanks for the diff! I've turned it into a patch and was ready to apply it, but 2 tests are always failing, even after addressing this issue; could you look into why? It looks good otherwise. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-tests-Expound-Dovecot-test-suite.patch >From 149790c4bd264d81938596cdbfa3376f31f9182f Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Fri, 2 Dec 2022 14:17:25 -0500 Subject: [PATCH] tests: Expound Dovecot test suite. Relates to . * gnu/tests/mail.scm (%dovecot-os) [services] : Add two namespaces. (run-dovecot-test) : New syntax. : New test. : Use with-imap-connection. : New test. : Adjust test. : New test. Signed-off-by: Maxim Cournoyer --- gnu/tests/mail.scm | 79 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 19 deletions(-) diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm index f13751b72f..8a2dbd798f 100644 --- a/gnu/tests/mail.scm +++ b/gnu/tests/mail.scm @@ -301,8 +301,19 @@ (define %dovecot-os (auth-anonymous-username "alice") (mail-location (string-append "maildir:~/Maildir" - ":INBOX=~/Maildir/INBOX" - ":LAYOUT=fs")))))) + ":LAYOUT=fs")) + (namespaces + (list + (namespace-configuration + (name "INBOX") + (inbox? #t) + (separator "/") + (location "maildir:~/Maildir/INBOX")) + (namespace-configuration + (name "guix-devel") + (separator "/") + (prefix "guix-devel/") + (location "maildir:~/Maildir/guix-devel")))))))) (define (run-dovecot-test) "Return a test of an OS running Dovecot service." @@ -351,9 +362,10 @@ (define message "From: test@example.com\n\ (marionette-eval `(file-exists? (string-append "/proc/" ,pid)) marionette))) - (test-assert "accept an email" + (define-syntax-rule (with-imap-connection imap exp ...) (let ((imap (socket AF_INET SOCK_STREAM 0)) - (addr (make-socket-address AF_INET INADDR_LOOPBACK 8143))) + (addr (make-socket-address AF_INET INADDR_LOOPBACK 8143)) + (body (lambda (imap) exp ...))) (connect imap addr) ;; Be greeted. (read-line imap) ;OK @@ -362,6 +374,43 @@ (define message "From: test@example.com\n\ (read-line imap) ;+ (write-line "c2lyaGM=" imap) (read-line imap) ;OK + + (let ((ok (body imap))) + ;; Logout + (write-line "a LOGOUT" imap) + (close imap) + ok))) + + (define (marionette-read-new-mail mailbox marionette) + (marionette-eval + `(begin + (use-modules (ice-9 ftw) + (ice-9 match)) + (match (scandir ,mailbox) + (("." ".." message-file) + (call-with-input-file + (string-append ,mailbox message-file) + get-string-all)))) + marionette)) + + (test-assert "accept an email" + (with-imap-connection imap + ;; Append a message to the INBOX mailbox + (write-line (format #f "a APPEND INBOX {~a}" + (number->string (message-length message))) + imap) + (read-line imap) ;+ + (write-line message imap) + (read-line imap) ;OK + #t)) + + (test-equal "mail arrived" + message + (marionette-read-new-mail "/home/alice/Maildir/INBOX/new/" + marionette)) + + (test-assert "accept an email in fresh mailbox" + (with-imap-connection imap ;; Create a TESTBOX mailbox (write-line "a CREATE TESTBOX" imap) (read-line imap) ;OK @@ -372,24 +421,16 @@ (define message "From: test@example.com\n\ (read-line imap) ;+ (write-line message imap) (read-line imap) ;OK - ;; Logout - (write-line "a LOGOUT" imap) - (close imap) #t)) - (test-equal "mail arrived" + (test-equal "mail arrived in fresh mailbox" message - (marionette-eval - '(begin - (use-modules (ice-9 ftw) - (ice-9 match)) - (let ((TESTBOX/new "/home/alice/Maildir/TESTBOX/new/")) - (match (scandir TESTBOX/new) - (("." ".." message-file) - (call-with-input-file - (string-append TESTBOX/new message-file) - get-string-all))))) - marionette)) + (marionette-read-new-mail "/home/alice/Maildir/TESTBOX/new/" + marionette)) + + (test-assert "mailbox exists" + (marionette-eval `(file-exists? "/home/alice/Maildir/guix-devel") + marionette)) (test-end)))) base-commit: 83350bf56b20f3106cd9eeab80b70a9eaf810a48 -- 2.38.1 --=-=-= Content-Type: text/plain -- Thanks, Maxim --=-=-=--