From 3ba09a74642152cf70bd2c862464826c1e1e4eab Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Wed, 11 Sep 2013 20:36:42 +0300 Subject: [PATCH] [PATCH v2 1/2] test: add known broken tests for known broken RFC 2047 encodings --- 4a/8d60438b353a9cab850a6970e9d47b842e27bd | 107 ++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 4a/8d60438b353a9cab850a6970e9d47b842e27bd diff --git a/4a/8d60438b353a9cab850a6970e9d47b842e27bd b/4a/8d60438b353a9cab850a6970e9d47b842e27bd new file mode 100644 index 000000000..6c93e5ac9 --- /dev/null +++ b/4a/8d60438b353a9cab850a6970e9d47b842e27bd @@ -0,0 +1,107 @@ +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 223D5431FB6 + for ; Wed, 11 Sep 2013 10:36:54 -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 f1kipYalFF3q for ; + Wed, 11 Sep 2013 10:36:46 -0700 (PDT) +Received: from mail-ea0-f176.google.com (mail-ea0-f176.google.com + [209.85.215.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 697B8431FAF + for ; Wed, 11 Sep 2013 10:36:46 -0700 (PDT) +Received: by mail-ea0-f176.google.com with SMTP id q16so4717672ead.7 + for ; Wed, 11 Sep 2013 10:36:45 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references:mime-version:content-type:content-transfer-encoding; + bh=JqvkZtZE2GfUrgh+jAJ0NhTIxpKg1o/KS+9+4F8M7e4=; + b=cqCWsYNBtwf7mOzIGdNRpKYC0MnUaUuw9WdeEA/fn+qYp7af5t0I/nF58+CKJ6Zj88 + st2zLuDEXhMp4YHf+8ISxAgqokXHSI2/zSAUsDhsh+/oqwHv5tcUAb6UXKkiVSFWyoa3 + UBKuoKrv7nkE/Pkb2lQ6xcJtpm+j+aAq9k7MNiUEkK9TaCwpxhM2IMB/rLrGbbs3Zv8Y + lC0jtnFRMr48i9DvsvkzNXH5DJ1mIbYPKlMJsjkGrSYoywcePZXSv+QmxgrYgNoEE+BC + G9M7x8nEO/yQySfiiNpeYfDQebtO/jlWLP6WEmm463pPC6StL9c39jX6SLM1djsFPh4I + zm5w== +X-Gm-Message-State: + ALoCoQmGu1XfNXsLWbt5R3BwMDy90adxcyyuciouCbmJLG2ebw+WbfLNlmPOCIuC60bPxC8hlxtf +X-Received: by 10.14.213.68 with SMTP id z44mr3856661eeo.70.1378921005069; + Wed, 11 Sep 2013 10:36:45 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id a6sm42086629eei.10.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Wed, 11 Sep 2013 10:36:44 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v2 1/2] test: add known broken tests for known broken RFC 2047 + encodings +Date: Wed, 11 Sep 2013 20:36:42 +0300 +Message-Id: <1378921003-14639-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.8.4.rc3 +In-Reply-To: <8738pcjet4.fsf@awakening.csail.mit.edu> +References: <8738pcjet4.fsf@awakening.csail.mit.edu> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Cc: Daniel Kahn Gillmor +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: Wed, 11 Sep 2013 17:36:54 -0000 + +Some common broken RFC 2047 encodings that we currently let gmime +parse strictly. We could tell gmime to be forgiving in what it accepts +as RFC 2047 encoding, making these tests pass. +--- + test/encoding | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/test/encoding b/test/encoding +index 2e1326e..7372b6b 100755 +--- a/test/encoding ++++ b/test/encoding +@@ -29,4 +29,22 @@ add_message '[content-type]="text/plain; charset=iso-8859-2"' \ + output=$(notmuch search tučňáččí 2>&1 | notmuch_show_sanitize) + test_expect_equal "$output" "thread:0000000000000002 2001-01-05 [1/1] Notmuch Test Suite; ISO-8859-2 encoded message (inbox unread)" + ++test_begin_subtest "RFC 2047 encoded word with spaces" ++test_subtest_known_broken ++add_message '[subject]="=?utf-8?q?encoded word with spaces?="' ++output=$(notmuch search id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) ++test_expect_equal "$output" "thread:0000000000000003 2001-01-05 [1/1] Notmuch Test Suite; encoded word with spaces (inbox unread)" ++ ++test_begin_subtest "RFC 2047 encoded words back to back" ++test_subtest_known_broken ++add_message '[subject]="=?utf-8?q?encoded-words-back?==?utf-8?q?to-back?="' ++output=$(notmuch search id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) ++test_expect_equal "$output" "thread:0000000000000004 2001-01-05 [1/1] Notmuch Test Suite; encoded-words-backto-back (inbox unread)" ++ ++test_begin_subtest "RFC 2047 encoded words without space before or after" ++test_subtest_known_broken ++add_message '[subject]="=?utf-8?q?encoded?=word without=?utf-8?q?space?=" ' ++output=$(notmuch search id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) ++test_expect_equal "$output" "thread:0000000000000005 2001-01-05 [1/1] Notmuch Test Suite; encodedword withoutspace (inbox unread)" ++ + test_done +-- +1.8.4.rc3 + -- 2.26.2