From d78611f546f805f5d77259617a78caa8977bfe22 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 31 Aug 2012 20:24:34 +2100 Subject: [PATCH] [PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP" --- 8f/cef060f575f05079acff85325f5759e5fe9ca6 | 95 +++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 8f/cef060f575f05079acff85325f5759e5fe9ca6 diff --git a/8f/cef060f575f05079acff85325f5759e5fe9ca6 b/8f/cef060f575f05079acff85325f5759e5fe9ca6 new file mode 100644 index 000000000..c9d92791e --- /dev/null +++ b/8f/cef060f575f05079acff85325f5759e5fe9ca6 @@ -0,0 +1,95 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id F0E2D431FAF + for ; Thu, 30 Aug 2012 16:24:56 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 71YeM-tsvMvH for ; + Thu, 30 Aug 2012 16:24:55 -0700 (PDT) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id F3C54431FAE + for ; Thu, 30 Aug 2012 16:24:54 -0700 (PDT) +Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net + ([156.34.89.108] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa + (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) + (envelope-from ) + id 1T7E6T-00048P-Nl; Thu, 30 Aug 2012 20:24:53 -0300 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1T7E6O-0002Cl-AA; Thu, 30 Aug 2012 20:24:44 -0300 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [PATCH] test: canonicalize content-type in "Sending a message via + (fake) SMTP" +Date: Thu, 30 Aug 2012 20:24:34 -0300 +Message-Id: <1346369074-8366-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <20120830013653.GF11179@mit.edu> +References: <20120830013653.GF11179@mit.edu> +X-Spam_bar: - +Cc: David Bremner +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Thu, 30 Aug 2012 23:24:57 -0000 + +From: David Bremner + +The version of message.el in emacs24 omits the charset=us-ascii, +causing the current version of this test to fail. With this patch, we +accept either option. According to RFC 2046, they are semantically +equivalent. +--- + +as discussed on IRC, the $ is not quite as nice as \b, but it is +POSIX.2, at least according to "man 7 regex" + + test/emacs | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/test/emacs b/test/emacs +index afe35ba..5d118b6 100755 +--- a/test/emacs ++++ b/test/emacs +@@ -169,7 +169,8 @@ emacs_deliver_message \ + (insert "To: user@example.com\n")' + sed \ + -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \ +- -e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message >OUTPUT ++ -e s',^Message-ID: <.*>$,Message-ID: ,' \ ++ -e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message >OUTPUT + cat <EXPECTED + From: Notmuch Test Suite + To: user@example.com +@@ -178,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -0000 + User-Agent: Notmuch/XXX Emacs/XXX + Message-ID: + MIME-Version: 1.0 +-Content-Type: text/plain; charset=us-ascii ++Content-Type: text/plain + + This is a test that messages are sent via SMTP + EOF +-- +1.7.10.4 + -- 2.26.2