Re: [PATCH] Output unmodified Content-Type header value for JSON format.
authorAustin Clements <amdragon@MIT.EDU>
Thu, 12 Jan 2012 17:28:40 +0000 (12:28 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:59 +0000 (09:41 -0800)
5d/140810d04a3cadeb0e4685b14c6ac618fc3501 [new file with mode: 0644]

diff --git a/5d/140810d04a3cadeb0e4685b14c6ac618fc3501 b/5d/140810d04a3cadeb0e4685b14c6ac618fc3501
new file mode 100644 (file)
index 0000000..a66381e
--- /dev/null
@@ -0,0 +1,121 @@
+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 A672C429E36\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:28:40 -0800 (PST)\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 q5ymqneYazP4 for <notmuch@notmuchmail.org>;\r
+       Thu, 12 Jan 2012 09:28:40 -0800 (PST)\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 D1F58431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:28:39 -0800 (PST)\r
+X-AuditID: 1209190c-b7fad6d000000920-94-4f0f18479d6f\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 9B.1D.02336.7481F0F4; Thu, 12 Jan 2012 12:28:39 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q0CHSceN001908; \r
+       Thu, 12 Jan 2012 12:28:39 -0500\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 q0CHSb3v009914\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 12 Jan 2012 12:28:38 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1RlOS8-0006F8-Py; Thu, 12 Jan 2012 12:28:40 -0500\r
+Date: Thu, 12 Jan 2012 12:28:40 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Pieter Praet <pieter@praet.org>\r
+Subject: Re: [PATCH] Output unmodified Content-Type header value for JSON\r
+       format.\r
+Message-ID: <20120112172840.GC18625@mit.edu>\r
+References: <1321659905-24367-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+       <87fwhkyisj.fsf@servo.finestructure.net> <87wrawq1dz.fsf@gmail.com>\r
+       <87d3coxu7s.fsf@servo.finestructure.net> <87r512pru2.fsf@gmail.com>\r
+       <87ipmewo4z.fsf@servo.finestructure.net>\r
+       <20111123034021.GL9351@mit.edu> <87ipkglui4.fsf@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87ipkglui4.fsf@praet.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsUixCmqrOsuwe9vsPKFlMWefV4W12/OZLb4\r
+       /foGswOzx93TXB7PVt1i9ujYd5k1gDmKyyYlNSezLLVI3y6BK+PEmxNsBUcEK87s38HewNjD\r
+       18XIySEhYCIx6ekTJghbTOLCvfVsXYxcHEIC+xglfk6ewQ7hbGCUaJjezwThnGSSWLb6HwuE\r
+       s4RR4sXhFcxdjBwcLAKqEi3LqkBGsQloSGzbv5wRxBYRUJY4/eQnO4jNLBAhMWXGR7B1wgLB\r
+       Ei+XtYPZvAI6EgfmHmMFsYUEjjBJXJhZDBEXlDg58wkLRK+WxI1/L5lAVjELSEss/8cBEuYU\r
+       UJd4tGwJWKuogIrElJPb2CYwCs1C0j0LSfcshO4FjMyrGGVTcqt0cxMzc4pTk3WLkxPz8lKL\r
+       dA31cjNL9FJTSjcxgsNckmcH45uDSocYBTgYlXh4Xwnz+wuxJpYVV+YeYpTkYFIS5c0XAwrx\r
+       JeWnVGYkFmfEF5XmpBYfYpTgYFYS4Z18ns9fiDclsbIqtSgfJiXNwaIkzqui9c5PSCA9sSQ1\r
+       OzW1ILUIJivDwaEkwTtPHGioYFFqempFWmZOCUKaiYMTZDgP0PCjIDW8xQWJucWZ6RD5U4y6\r
+       HCfXXjnHKMSSl5+XKiXOuxekSACkKKM0D24OLD29YhQHekuYdw5IFQ8wtcFNegW0hAloSVkK\r
+       yAfFJYkIKakGxvpDU7dMFfxxSVJo/U4/tVWvn8YGbfWovFjv0W6aXTG5K2b2kq+uky+5Pt5R\r
+       fMLiu5TrwuUZh1wfNyhG2OU+ur2zZMGSvgeip3WtUmTsl21P/LCSyaeiXHntau8Ak+9L7O4f\r
+       kdLqffuowmhuoWWUfH/xCo21Xy48fBr562oC2523LK8O5xq9eKPEUpyRaKjFXFScCACbddDL\r
+       KgMAAA==\r
+Cc: notmuch@notmuchmail.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, 12 Jan 2012 17:28:40 -0000\r
+\r
+Quoth Pieter Praet on Jan 12 at  6:07 pm:\r
+> On Tue, 22 Nov 2011 22:40:21 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> > Quoth Jameson Graef Rollins on Nov 20 at 12:10 pm:\r
+> > > The open question seems to be how we handle the content encoding\r
+> > > parameters.  My argument is that those should either be used by notmuch\r
+> > > to properly encode the content for the consumer.  If that's not\r
+> > > possible, then just those parameters needed by the consumer to decode\r
+> > > the content should be output.\r
+> > \r
+> > If notmuch is going to include part content in the JSON output (which\r
+> > perhaps it shouldn't, as per recent IRC discussions), then it must\r
+> > handle content encodings because JSON must be Unicode and therefore\r
+> > the content strings in the JSON must be Unicode.\r
+> \r
+> Having missed the IRC discussions: what is the rationale for not\r
+> including (specific types of?) part content in the JSON output ?\r
+> Eg. how about inline attached text/x-patch ?\r
+\r
+Technically the IRC discussion was about not including *any* part\r
+content in the JSON output, and always using show --format=raw or\r
+similar to retrieve desired parts.  Currently, notmuch includes part\r
+content in the JSON only for text/*, *except* when it's text/html.  I\r
+assume non-text parts are omitted because binary data is hard to\r
+represent in JSON and text/html is omitted because some people don't\r
+need it.  However, this leads to some peculiar asymmetry in the Emacs\r
+code where sometimes it pulls part content out of the JSON and\r
+sometimes it retrieves it using show --format=raw.  This in turn leads\r
+to asymmetry in content encoding handling, since notmuch handles\r
+content encoding for parts included in the JSON (and there's no good\r
+way around that since JSON is Unicode), but not for parts retrieved as\r
+raw.\r
+\r
+The idea discussed on IRC was to remove all part content from the JSON\r
+output and to always use show to retrieve it, possibly beefing up\r
+show's support for content decoding (and possibly introducing a way to\r
+retrieve multiple raw parts at once to avoid re-parsing).  This would\r
+get the JSON format out of the business of guessing what consumers\r
+need, simplify the Emacs code, and normalize content encoding\r
+handling.\r