Re: [WIP] tests: add test for case insensitive Content-Disposition
authorJani Nikula <jani@nikula.org>
Sun, 18 Oct 2015 11:58:01 +0000 (14:58 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:49 +0000 (14:49 -0700)
da/a3080ca7f558b440705b2371f2449e430fa14f [new file with mode: 0644]

diff --git a/da/a3080ca7f558b440705b2371f2449e430fa14f b/da/a3080ca7f558b440705b2371f2449e430fa14f
new file mode 100644 (file)
index 0000000..c0b6083
--- /dev/null
@@ -0,0 +1,113 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id D00DF6DE1643\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Oct 2015 04:58:36 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.177\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.177 tagged_above=-999 required=5\r
+ tests=[AWL=-0.201, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, URIBL_SBL=0.644, URIBL_SBL_A=0.1]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id fAZ345IpErQi for <notmuch@notmuchmail.org>;\r
+ Sun, 18 Oct 2015 04:58:34 -0700 (PDT)\r
+Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com\r
+ [209.85.212.182])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id BF31B6DE0943\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Oct 2015 04:58:33 -0700 (PDT)\r
+Received: by wicfx6 with SMTP id fx6so15578945wic.1\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Oct 2015 04:58:31 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=1YFiJytSkauuI/z+hnTMLciOsBXVKpjd2WdHAm+li1o=;\r
+ b=YICtPF4EdWsrlVxs74RlN1v9rATWOqDaNb7VZ2C+ApHuTyHZsL7zjVEvJcKFlgojoK\r
+ pBYD4OBMvHafrJYex1RInOGkm3LM+ESgBPFAcplHLqzcEmZlDeZ9V3rsm9rWAlXgoV/O\r
+ HWDQms595bEl69VSZDuGJsmFoK8Qszf6rP26I4WF1IirqCNj7Sr67T1XcbxoZLacdlD5\r
+ D+yqZMbMyyh1TSFOtpuChYNwTvaGuW4xhNBpi7DT6YBNaNplf3YfjFb2drM3Y4a26GGD\r
+ MoDWSRvxW7zy2dBBIUlanMZadP1SQ/LQCWBUD5PQLdcLbEupxYj6aShS+xP/HV9NTuNO\r
+ yDaA==\r
+X-Gm-Message-State:\r
+ ALoCoQmUfUCdS7z5I/dPeEYZiII2LEcEI1VHM3lk7Gy4RVVZtNR/SLRyz2PlvsyJdMofp59PuRaq\r
+X-Received: by 10.180.189.41 with SMTP id gf9mr14034217wic.95.1445169511602;\r
+ Sun, 18 Oct 2015 04:58:31 -0700 (PDT)\r
+Received: from localhost (mobile-access-bceec0-208.dhcp.inet.fi.\r
+ [188.238.192.208])\r
+ by smtp.gmail.com with ESMTPSA id s16sm10691229wik.16.2015.10.18.04.58.30\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Sun, 18 Oct 2015 04:58:31 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: David Bremner <david@tethera.net>, David Bremner <david@tethera.net>,\r
+ Johannes Schauer <josch@debian.org>, notmuch@notmuchmail.org\r
+Subject: Re: [WIP] tests: add test for case insensitive Content-Disposition\r
+In-Reply-To: <1444126846-1918-1-git-send-email-david@tethera.net>\r
+References: <1443260122-5122-2-git-send-email-jani@nikula.org>\r
+ <1444126846-1918-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.21~rc0+2~gb7a0eab (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 18 Oct 2015 14:58:01 +0300\r
+Message-ID: <87r3kscrsm.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Sun, 18 Oct 2015 11:58:37 -0000\r
+\r
+On Tue, 06 Oct 2015, David Bremner <david@tethera.net> wrote:\r
+> These broken now, but will be fixed in the next commit\r
+> ---\r
+>\r
+> The first test is OK, but the second one currently fails. It isn't\r
+> clear to me if content dispositions permit RFC2047 style\r
+> encoding. GMime does not decode them automatically (hence this test is\r
+> failing). What is true is that the RFC states "Unrecognized\r
+> disposition types should be treated as `attachment'". So maybe the\r
+> logic in patch 1 should be reversed to check != 'inline'.\r
+\r
+> +Content-Type: text/plain\r
+> +Content-Disposition: =?utf-8?b?YXR0YWNobWVudDsgZmlsZW5hbWU9ImJlZ3LDvMOfdW5n?=\r
+> + =?utf-8?b?LnBkZiI=?=\r
+> +Content-Description: this is a very exciting file\r
+\r
+Did you handcraft the example, or did some program actually produce\r
+this? I don't think this is [RFC 2231] compliant. IIUC only the content\r
+disposition parameter values may contain encoded words with\r
+charset/language specification. Like this,\r
+\r
+Content-Disposition: attachment; filename="=?utf-8?B?cMOkw6RtaWVz?="\r
+\r
+We currently handle that correctly, and UTF-8 searches with attachment:\r
+prefix work. It's just that the disposition-type (usually "attachment"\r
+or "inline") should be interpreted case insensitive, which we currently\r
+fail at.\r
+\r
+What should we do about malformed content-disposition fields then? I\r
+think I'd just defer this to gmime.\r
+\r
+Sadly email seems to be a prime example of rampant robustness principle\r
+abuse. It has degenerated into, "Be liberal in what you send, be liberal\r
+in what you accept", which is getting dangerously close to the GIGO\r
+principle.\r
+\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+[RFC 2231] https://tools.ietf.org/html/rfc2231\r