From 692e0ea12c7d013d39e69d3c2f8894b5650d43d1 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 13 Mar 2016 14:48:41 +0200 Subject: [PATCH] Re: [PATCH] Don't bother checking for mbox files --- 68/b0d1ac55c14a67b4a290f628b7148cca18187f | 116 ++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 68/b0d1ac55c14a67b4a290f628b7148cca18187f diff --git a/68/b0d1ac55c14a67b4a290f628b7148cca18187f b/68/b0d1ac55c14a67b4a290f628b7148cca18187f new file mode 100644 index 000000000..94f43375b --- /dev/null +++ b/68/b0d1ac55c14a67b4a290f628b7148cca18187f @@ -0,0 +1,116 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id C065C6DE1894 + for ; Sun, 13 Mar 2016 05:49:47 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.556 +X-Spam-Level: +X-Spam-Status: No, score=-0.556 tagged_above=-999 required=5 tests=[AWL=0.164, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id aMPacOtH7BWg for ; + Sun, 13 Mar 2016 05:49:46 -0700 (PDT) +Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com + [74.125.82.46]) by arlo.cworth.org (Postfix) with ESMTPS id 96E2F6DE1890 for + ; Sun, 13 Mar 2016 05:49:45 -0700 (PDT) +Received: by mail-wm0-f46.google.com with SMTP id p65so70153332wmp.1 + for ; Sun, 13 Mar 2016 05:49:45 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=nikula-org.20150623.gappssmtp.com; s=20150623; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version; bh=RuyyUyY+WCsOHTJcRhRivkAIhlk45H/xet/vdC4uqs8=; + b=PpJkW7tKcBU8R/vAz6QF9TBTfCAD2HFO76WU5ZnmOKV/ph/ukFYuW4HiUwKjaPPqwF + ck5N06YISB4bUrJp4PX8HtGG4zIW/WHJMmCxxnzQSn6yx8pd/VAAQCm4DZnR+CpJDld3 + 9bm3PEtDU6RIPT0E8KuQcsbAnmihX8ALACc4FDmtG1qzFiIgk7mE1VPMyW0EZPmBzYO9 + Sb+ekHj/UwlgxzoZ+5bPxsPQp2TyNKbmOGDAc+masph9WaIfrYUipt21IW79ZRU1ygzI + Qwdl8fuDe94GqkGgrkAkEzFyWRFlpghX3uRjAzdFGHEW9PnNq4Ynj686oKr5Y4RoEuI1 + U5Iw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version; + bh=RuyyUyY+WCsOHTJcRhRivkAIhlk45H/xet/vdC4uqs8=; + b=CoeJAN8IHjIKUnxfJGoQE6yluNCUb0KvSWWf8LhdLfms8PSv2fU4J4aoZpdbvxX1Op + DjkXXQY219cDdb2GnY5okUQ42gYo/2PgEnivLpRWWphBVbjapbtChPmqYd+8Qv1BkgIO + +r5zVcQQyc3tvBNUjvHXKWXtEPoyVDj5+M/zhj535tgt3JbjN0HjRDYMifcL5XkCwaaV + k0wa6YwYE3X69o3xT+BuC11ZEKGYkmaN4iZLibwhkmTX5Xz6F4rU7aZ8K+5Au6OjhbmG + Aer2+9mGVSZh2chHjA9RnLqLdfDQrxB62SWNl4UPwJt0iVVqxAm4xocnkpivEc104uSl + WHTQ== +X-Gm-Message-State: + AD7BkJKom0YWKyyOQAEfXQ3QQP/3TG+U9b3VI3JpTwgizvHnY0wS6+p2k7wElBkdizlOkw== +X-Received: by 10.194.83.134 with SMTP id q6mr19025171wjy.131.1457873384094; + Sun, 13 Mar 2016 05:49:44 -0700 (PDT) +Received: from localhost (mobile-access-bcee39-255.dhcp.inet.fi. + [188.238.57.255]) + by smtp.gmail.com with ESMTPSA id v2sm11433321wmd.24.2016.03.13.05.49.43 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 13 Mar 2016 05:49:43 -0700 (PDT) +From: Jani Nikula +To: Edward Betts , notmuch@notmuchmail.org +Subject: Re: [PATCH] Don't bother checking for mbox files +In-Reply-To: <20160313105742.GA9173@4angle.com> +References: <86io0v9oum.fsf@hiro.keithp.com> + <20160313105742.GA9173@4angle.com> +User-Agent: Notmuch/0.21+74~g711eac8 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Sun, 13 Mar 2016 14:48:41 +0200 +Message-ID: <87mvq2pmqe.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Sun, 13 Mar 2016 12:49:47 -0000 + +On Sun, 13 Mar 2016, Edward Betts wrote: +> Keith Packard wrote: +>> Postfix adds mbox-style From lines when used in combination with +>> maildrop or .forward files. If they have another line starting with +>> 'From ' in them, notmuch complains about them not being mail files. +>> +>> If we assume the user hasn't screwed up and misconfigured their mail +>> system, then we can safely ignore whether the file started with an +>> mbox header and just parse it as a single-message file. +> +> I think it is fine to go ahead with this change. At the same time the +> behaviour of Postfix should be corrected so it doesn't add mbox-style From +> lines to mails in maildir format. + +I disagree with making the change (as-is, at least). + +In general, Notmuch does not support mboxes. We expect maildir style one +message per file mail storage. We support single-message mboxes as a +special case, in part because, as you note, there's plenty of other +software that adds the mbox "From " line even though delivering to +maildir. + +I think it's misleading and confusing to the users to accept and index +the first message of mboxes, and silently ignore the rest (or worse, +index all of the mbox and associate the text with the first message). I +think we should reject multi-message mboxes, because we have no code to +handle them. This patch throws away that check. + +Now, IIUC, the problem here is not that the files actually are +multi-message mboxes. We could use a sample message (even a crafted one) +that exhibits the problem, so we could add a test case, and fix Notmuch +to deal with it gracefully (if we decide catering to potentially broken +other software is the way to go), while retaining the code to reject +multi-message mboxes. With the test case, we'd also avoid accidentally +breaking this in the future. + +BR, +Jani. -- 2.26.2