From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 813CF6DE38DE for ; Sat, 13 Aug 2016 04:39:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: 0.287 X-Spam-Level: X-Spam-Status: No, score=0.287 tagged_above=-999 required=5 tests=[AWL=1.007, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A4O2DLaEoskB for ; Sat, 13 Aug 2016 04:39:05 -0700 (PDT) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id ED02E6DE3856 for ; Sat, 13 Aug 2016 04:39:04 -0700 (PDT) Received: by mail-wm0-f67.google.com with SMTP id i5so2016185wmg.2 for ; Sat, 13 Aug 2016 04:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=MqUvdPEzLcM1AS99XOhBgD9cHCnU0FvV2NoTJNRdIJM=; b=qn4O3wb+YSpif6ZLd9oPuwyfHL/OUPOEJEBe/UAJQi8aLy5IVsS7Jk7yRF9WkiQjEm YTHX3Sg62vfiDOyPdDO73gWSdoAe5/vY+nt0Ql/6iBl7QbjKeMaFZbqHD1mlstpwe1Cs ZCov9RMoq+ObyDcWVA7UO2jpWPuzlHa29/FjgSvtsYDkNNafoVFTYom4+9Kpos6CcbJ1 eY2ONvJvHpBUBLr6F+/Tt+hLa6+9qRuevgjSLJ+t1M3G01wSLJCAypbb46RiGS8hXHag lkAfRyHjz65YnR8VSzK/zcIPPkvzdWvvEmPOO0FqE2uUmevSdielU4ds2UBGqOayA3sR EDUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=MqUvdPEzLcM1AS99XOhBgD9cHCnU0FvV2NoTJNRdIJM=; b=OyclY3Ey4+i9sWRyuMIOPZP/o6g60KAhErKlBp2NIkYcPEzEQA40cUvdKCXmIFN1mp uMZd4qvY7n3NEed3WOBCHZFryaYjVmVBL23NF3QofzJKr7g5ewms6G+bcyKX0sZVEnoc mGOJUvQ8f+kwypHLE/5C7l4lW7wMMgSyTE55pMpuI06N39cg2Vz/E6WNJlNNDuKqUNkb d+ui6ZsIpC3RW+kTlZeXjXRBkECuyeWghv8udQANDFBFLE5taue0JUOMf7PyLNJt0pOO /OyzDyW7yRvnv8yM2pZsMTG4XKxrtoUYvKaAKQIAyH3nq8FPpSH98ACOKhjxxLq9k+hP sq7Q== X-Gm-Message-State: AEkoout3UZLNPHyWC7hZggnTX8WY0tFPmSuxtcojUB7VeSUbWsDA0LAn6KNvP8zl/LGhgw== X-Received: by 10.195.13.18 with SMTP id eu18mr19662613wjd.121.1471088343587; Sat, 13 Aug 2016 04:39:03 -0700 (PDT) Received: from localhost (dsl-hkibrasgw2-58c368-70.dhcp.inet.fi. [88.195.104.70]) by smtp.gmail.com with ESMTPSA id d7sm11802590wjg.13.2016.08.13.04.39.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Aug 2016 04:39:03 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Cc: Daniel Kahn Gillmor , jani@nikula.org Subject: [PATCH v2 01/14] test: add known broken test for reply to message with multiple Cc headers Date: Sat, 13 Aug 2016 14:37:25 +0300 Message-Id: <8c280fe978c12eccb662b0ebc97d9d3c794f6688.1471088022.git.jani@nikula.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2016 11:39:14 -0000 As Daniel Kahn Gillmor reports in id:87d1ngv95p.fsf@alice.fifthhorseman.net, notmuch show combines multiple Cc: fields into one, while notmuch reply does not. While such messages are in violation of RFC 5322, it would be reasonable to expect notmuch to be consistent. Add a known broken test to document this expectation. Details: The original message is formatted using the message printing in notmuch-show.c. For Cc:, it uses g_mime_message_get_recipients(), which apparently combines all Cc: fields into one internally. The addresses in the reply headers, OTOH, are based on headers queried through libnotmuch. It boils down to g_mime_object_get_header() in lib/message-file.c, which returns only the first occurence of header. --- test/T220-reply.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/T220-reply.sh b/test/T220-reply.sh index 30b78f679d97..d6f3a839ca48 100755 --- a/test/T220-reply.sh +++ b/test/T220-reply.sh @@ -253,5 +253,30 @@ test_expect_equal_json "$output" ' } }' +test_begin_subtest "Reply to a message with multiple Cc headers" +test_subtest_known_broken +cat > "${MAIL_DIR}"/broken_cc < +To: Daniel Kahn Gillmor +Cc: Bob +Subject: wowsers! +cc: Charles +Message-Id: +Date: Thu, 16 Jun 2016 22:14:41 -0400 + +Note the Cc: and cc: headers. +EOF +notmuch new >/dev/null +output=$(notmuch reply id:abc123@example.org) +notmuch reply id:abc123@example.com +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: wowsers! +To: Alice , Daniel Kahn Gillmor +Cc: Bob , Charles +In-Reply-To: +References: + +On Thu, 16 Jun 2016 22:14:41 -0400, Alice wrote: +> Note the Cc: and cc: headers." test_done -- 2.1.4