From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kGdeE5DV/mFAAgAAgWs5BA (envelope-from ) for ; Sat, 05 Feb 2022 20:52:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kL8OEJDV/mFjxgAAauVa8A (envelope-from ) for ; Sat, 05 Feb 2022 20:52:48 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 081CB2EA96 for ; Sat, 5 Feb 2022 20:52:48 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 73E8D5F71D; Sat, 5 Feb 2022 19:52:35 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id B28C35F70F for ; Sat, 5 Feb 2022 19:52:32 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id CADF95FBD2; Sat, 5 Feb 2022 14:52:31 -0500 (EST) Received: (nullmailer pid 166352 invoked by uid 1000); Sat, 05 Feb 2022 19:52:28 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 6/6] lib/message-file: allow disabling check for mbox files. Date: Sat, 5 Feb 2022 15:52:15 -0400 Message-Id: <20220205195215.166213-7-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220205195215.166213-1-david@tethera.net> References: <20220205195215.166213-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: TUG56TSCSGCCEZL674VQ726FQJ4IT6NO X-Message-ID-Hash: TUG56TSCSGCCEZL674VQ726FQJ4IT6NO X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644090768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=w4avSCS7hP2IN/d99rpJJryWWcDasPCOORh5uuRl5rg=; b=ZP27lrcwGaubyX70+k43sfaJxY+bxklEpS1Cd61rSYxtJsg3GfHaoWqVbECpDSU8Hs73cx XQr9nGUn/KnjxzOzdHi2SfQWGuXjejV1DY/d8dhLMW+6VEx+9Q5NQ0JoI5nz7RhilwaKAN bDl4GVobcBLlkiy86pmRLQzQDfcOcDUjRpGDrZM45FRVhp34UkEJ4wrllJP1+MsZ8Bo9uk +I0O8/T2o9AaWOvnqrWbH7H2QSpahXXrSx4WNvyHnMdgoMotyz/WXjkN/iZuzl1tucZ4YW 3ItihTjT/NWjsyNrOZhnVv3XO4aWpXEw+4LqFAch1wiwrxALhlUlLC9oOsSOcg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644090768; a=rsa-sha256; cv=none; b=H/2NWei2pDMXLUzlTMeBPNG0uZFAnq3Wyty5q5WNqFwMPHuqDSxKZAYDGnYQhAC9Vl64xF lAhee3WNWfSIZjUNZd88Vr3KufETdZlAA4V7t7dL0IcTKalm8zq79t+S59+Xr+zP28Xijf 2+TeidFPNombntREbhoSovOgi+NvKrcZUFbpIpUSwr3hKMEJB+bUI7WPHmAR62vhtpyp04 py+kJYUpQX5VGvKYJYQzXM1TzOl4+/s/Wb+3Wyc+o/yK6erJiyDUmcpNkB+X/ujTrv5qFb cSzgzOsDsvqeacd5eF8WKJwUKa5QjOBVq0iuPiKIn1YzRjK3palsEa8xy7km/g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.34 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 081CB2EA96 X-Spam-Score: -1.34 X-Migadu-Scanner: scn1.migadu.com X-TUID: j2M64XFaKufV This does not change the default (of enforcing the check) but does allow users to disable the check if they want. --- lib/message-file.c | 9 +++++++-- test/T050-new.sh | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/message-file.c b/lib/message-file.c index 0f356cf1..e2bd406b 100644 --- a/lib/message-file.c +++ b/lib/message-file.c @@ -145,14 +145,19 @@ _notmuch_message_file_parse (notmuch_message_file_t *message) GMimeParser *parser; notmuch_status_t status = NOTMUCH_STATUS_SUCCESS; bool is_mbox; + notmuch_bool_t check_mbox; if (message->message) return NOTMUCH_STATUS_SUCCESS; - is_mbox = _is_mbox (message->stream); - _notmuch_init (); + status = notmuch_config_get_bool (message->notmuch, NOTMUCH_CONFIG_CHECK_MBOX, &check_mbox); + if (status) + return status; + + is_mbox = check_mbox && _is_mbox (message->stream); + message->headers = g_hash_table_new_full (strcase_hash, strcase_equal, free, g_free); if (! message->headers) diff --git a/test/T050-new.sh b/test/T050-new.sh index e779bd2f..aa777235 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -464,7 +464,6 @@ output=$(notmuch search --output=messages id:87k0e9o0pu.fsf@tethera.net) test_expect_equal "$output" "id:87k0e9o0pu.fsf@tethera.net" test_begin_subtest "id:87k0e9o0pu.fsf@tethera.net is indexed with index.check_mbox=false" -test_subtest_known_broken cp notmuch-config notmuch-config.old notmuch config set index.check_mbox false notmuch new -- 2.34.1