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