From 83f3f47a589a697b552c5e4051f1d2ceb1e4a5df Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sat, 30 Nov 2013 17:33:49 +0200 Subject: [PATCH] [PATCH v2 0/7] lib: replace the message header parser with gmime --- 78/b10b32c5a2c6ac6538c49c12809f3d517abf15 | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 78/b10b32c5a2c6ac6538c49c12809f3d517abf15 diff --git a/78/b10b32c5a2c6ac6538c49c12809f3d517abf15 b/78/b10b32c5a2c6ac6538c49c12809f3d517abf15 new file mode 100644 index 000000000..d6ead277a --- /dev/null +++ b/78/b10b32c5a2c6ac6538c49c12809f3d517abf15 @@ -0,0 +1,105 @@ +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 68462431FD4 + for ; Sat, 30 Nov 2013 07:34:11 -0800 (PST) +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 5un8u8RWDvjG for ; + Sat, 30 Nov 2013 07:34:03 -0800 (PST) +Received: from mail-ea0-f175.google.com (mail-ea0-f175.google.com + [209.85.215.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 418E6431FAE + for ; Sat, 30 Nov 2013 07:34:03 -0800 (PST) +Received: by mail-ea0-f175.google.com with SMTP id z10so7575028ead.20 + for ; Sat, 30 Nov 2013 07:34:00 -0800 (PST) +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; + bh=Jp1PsVMY6bTG4GeGxnbnek4kDMlme+0A1DrxPE4+S9s=; + b=Z9eHU4zLOM7t8eoI4neqzfrRH8OXFc1g+w5K7paL5T4xn9cfduePi44wSouK7mXRM1 + CUdlPqX74bBqBGMLKzGMo13P7B2aO8SC74H0TwdQR+JPka3NLfIeuL6tQ1FkGjfVE15I + DW99BFAAbp/azdmvM1/lIZOkZQAHRh+V3EFtD2YCwntACb+vQFryMVVcvCOMwh2gKV0w + cHWhyMomHmwTY5GUvlcd9lnbuoi+1CiozqQi/Cyw8Kix7F8C2+EGm/ldHK0yZhGtdJ5y + 2YPZYjqmfQ/6c0VRCMVU+mhAFi02OFcORb86eKKwl0MZjHS9Tct0yOK3ZZxLLuNFV2n4 + ztJA== +X-Gm-Message-State: + ALoCoQm54+gQuf3n6B9KF12X9WLsSpMsIvH5odqAJEmhGLKN+w1xsroVBpnuMmkj029Eeu0VEJC2 +X-Received: by 10.14.9.131 with SMTP id 3mr1601964eet.45.1385825640814; + Sat, 30 Nov 2013 07:34:00 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id 44sm51851193eek.5.2013.11.30.07.33.59 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 30 Nov 2013 07:34:00 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v2 0/7] lib: replace the message header parser with gmime +Date: Sat, 30 Nov 2013 17:33:49 +0200 +Message-Id: +X-Mailer: git-send-email 1.8.4.2 +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: Sat, 30 Nov 2013 15:34:11 -0000 + +This is v2 of id:cover.1381948853.git.jani@nikula.org with more polish. + +Patches 1-4 do prep work to fix some of the differences in the parsers +in advance. Arguably they are not that bad regardless of the parser +change. + +Patches 5-6 actually make the change. Having two patches is a somewhat +artificial division, but perhaps makes it easier to review. + +Patch 7 is just a hack to make perf tests not ignore so many mails... we +have quite a bit of non-emails in the corpus by gmime parser +standards. And this illustrates one of the differences in the parsers. + + +BR, +Jani. + +Jani Nikula (7): + cli: sanitize tabs and newlines to spaces in notmuch search + cli: refactor reply from guessing + util: make sanitize string available in string util for reuse + cli: sanitize the received header before scanning for replies + lib: replace the header parser with gmime + lib: parse messages only once + HACK: fix broken messages in the perf test corpus + + lib/database.cc | 6 +- + lib/index.cc | 70 +------- + lib/message-file.c | 351 +++++++++++++------------------------- + lib/message.cc | 6 + + lib/notmuch-private.h | 20 ++- + notmuch-reply.c | 186 ++++++++++++-------- + notmuch-search.c | 17 -- + performance-test/perf-test-lib.sh | 4 + + test/search-output | 2 +- + util/string-util.c | 22 +++ + util/string-util.h | 7 + + 11 files changed, 297 insertions(+), 394 deletions(-) + +-- +1.8.4.2 + -- 2.26.2