Re: [PATCH] test: canonicalize content-type in "Sending a message via (fake) SMTP"
authorAustin Clements <amdragon@MIT.EDU>
Thu, 30 Aug 2012 01:36:53 +0000 (21:36 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:14 +0000 (09:49 -0800)
6b/06a9fc087bd8d8524e81f846dda2e07bc60532 [new file with mode: 0644]

diff --git a/6b/06a9fc087bd8d8524e81f846dda2e07bc60532 b/6b/06a9fc087bd8d8524e81f846dda2e07bc60532
new file mode 100644 (file)
index 0000000..173efc1
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D8BCC431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Aug 2012 18:36:58 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7bYmbEV10FNc for <notmuch@notmuchmail.org>;\r
+       Wed, 29 Aug 2012 18:36:58 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
+       [18.9.25.12])\r
+       by olra.theworths.org (Postfix) with ESMTP id 37E30431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Aug 2012 18:36:58 -0700 (PDT)\r
+X-AuditID: 1209190c-b7f806d000006b87-aa-503ec3b92881\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A6.85.27527.9B3CE305; Wed, 29 Aug 2012 21:36:57 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q7U1au0p009629; \r
+       Wed, 29 Aug 2012 21:36:56 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q7U1arZQ025743\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Wed, 29 Aug 2012 21:36:54 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1T6tgj-0004Ar-7s; Wed, 29 Aug 2012 21:36:53 -0400\r
+Date: Wed, 29 Aug 2012 21:36:53 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: david@tethera.net\r
+Subject: Re: [PATCH] test: canonicalize content-type in "Sending a message\r
+       via (fake) SMTP"\r
+Message-ID: <20120830013653.GF11179@mit.edu>\r
+References: <1346289176-15884-1-git-send-email-david@tethera.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1346289176-15884-1-git-send-email-david@tethera.net>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFprJKsWRmVeSWpSXmKPExsUixG6nrrvzsF2AwcHdBhYbl/1ktrjR2s1o\r
+       cf3mTGYHZo9fbXOZPZ6tusXsseXQe+YA5igum5TUnMyy1CJ9uwSujBkP8wta+CpWX2hiaWBc\r
+       zd3FyMkhIWAiMWXDZyYIW0ziwr31bF2MXBxCAvsYJf7d28sK4WxglLh75xQzhHOSSeLZmgXs\r
+       EM4SRomvh+ezgvSzCKhKLPt2FGwWm4CGxLb9yxlBbBEBUYnTmyaB1TAL2Essmj2JHcQWFoiV\r
+       6Pr6iAXE5hXQkbjfvROsV0jAUeLa32tMEHFBiZMzn7BA9GpJ3Pj3EijOAWRLSyz/xwES5hRw\r
+       knjR0Ag2XlRARWLKyW1sExiFZiHpnoWkexZC9wJG5lWMsim5Vbq5iZk5xanJusXJiXl5qUW6\r
+       hnq5mSV6qSmlmxhBoc4pybOD8c1BpUOMAhyMSjy8zv52AUKsiWXFlbmHGCU5mJREed0PAYX4\r
+       kvJTKjMSizPii0pzUosPMUpwMCuJ8H5aCZTjTUmsrEotyodJSXOwKInzXk656S8kkJ5Ykpqd\r
+       mlqQWgSTleHgUJLgPQEyVLAoNT21Ii0zpwQhzcTBCTKcB2j4KpAa3uKCxNzizHSI/ClGXY7r\r
+       X8/eZRRiycvPS5US550GUiQAUpRRmgc3B5aiXjGKA70lzLsFpIoHmN7gJr0CWsIEtGS/ojXI\r
+       kpJEhJRUA2P2b5lJ3RKMXVUdez8Y/3PT2u86Y+GCV2XxlV/fzlxwfsGVbVePfHl0onjK9fyk\r
+       rruTgsNVr0xzXO51ff+X5NaJN9sX5BR6l9dJ102TWDExcGbppZdNnA/7GtVj1kTy7J8pPOuu\r
+       6/VJ300zpgbcPDBPXKHq64eH/U8PHw1eJ/dmR3D81zbXp7NfKrEUZyQaajEXFScCAJrA9m0s        AwAA\r
+Cc: notmuch@notmuchmail.org, David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 30 Aug 2012 01:36:59 -0000\r
+\r
+Quoth david@tethera.net on Aug 29 at 10:12 pm:\r
+> From: David Bremner <bremner@debian.org>\r
+> \r
+> The version of message.el in emacs24 omits the charset=us-ascii,\r
+> causing the current version of this test to fail. Here we just ask\r
+> that the content-type start with "text/plain"\r
+> ---\r
+> \r
+> Alternatively, somebody might want to dig into message.el and\r
+> understand why it behaves differently in emacs24. I could not\r
+> replicate the omission of charset=us-ascii sending a message\r
+> interactively.\r
+> \r
+>  test/emacs |    5 +++--\r
+>  1 file changed, 3 insertions(+), 2 deletions(-)\r
+> \r
+> diff --git a/test/emacs b/test/emacs\r
+> index afe35ba..6fab4db 100755\r
+> --- a/test/emacs\r
+> +++ b/test/emacs\r
+> @@ -169,7 +169,8 @@ emacs_deliver_message \\r
+>       (insert "To: user@example.com\n")'\r
+>  sed \\r
+>      -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \\r
+> -    -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' < sent_message >OUTPUT\r
+> +    -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' \\r
+> +    -e s',^Content-Type: text/plain.*$,Content-Type: XXX,' < sent_message >OUTPUT\r
+\r
+Maybe something more exact?  Since us-ascii is the default charset and\r
+equivalent to not specifying a charset (which is presumably related to\r
+the change in Emacs 24), how about\r
+  s',^\(Content-Type: text/plain\); charset=us-ascii\b,\1,'\r
+?  That would canonicalize away only the default-valued part.\r
+\r
+>  cat <<EOF >EXPECTED\r
+>  From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+>  To: user@example.com\r
+> @@ -178,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -0000\r
+>  User-Agent: Notmuch/XXX Emacs/XXX\r
+>  Message-ID: <XXX>\r
+>  MIME-Version: 1.0\r
+> -Content-Type: text/plain; charset=us-ascii\r
+> +Content-Type: XXX\r
+>  \r
+>  This is a test that messages are sent via SMTP\r
+>  EOF\r