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 8ObkEYvV/mE2UQAAgWs5BA (envelope-from ) for ; Sat, 05 Feb 2022 20:52:43 +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 aPSyDovV/mHYCwEAauVa8A (envelope-from ) for ; Sat, 05 Feb 2022 20:52:43 +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 0E6412E95F for ; Sat, 5 Feb 2022 20:52:43 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id EC29B5F716; Sat, 5 Feb 2022 19:52:34 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 24CCF5F70C for ; Sat, 5 Feb 2022 19:52:31 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 96E8A5FBD4; Sat, 5 Feb 2022 14:52:30 -0500 (EST) Received: (nullmailer pid 166341 invoked by uid 1000); Sat, 05 Feb 2022 19:52:28 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 3/6] lib/config: add configuration item for controlling check for mbox Date: Sat, 5 Feb 2022 15:52:12 -0400 Message-Id: <20220205195215.166213-4-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: YZ3WZFEBD3EDDHEMGXEWYKJNCXHSMACN X-Message-ID-Hash: YZ3WZFEBD3EDDHEMGXEWYKJNCXHSMACN 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=1644090763; 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=kS89AgXsSDHRw6h2DidJXxfrziqeIDohCJm9qUYgqRk=; b=Smvq5BGsnfxfIQsAeIBcKpszVedzfukxKCvSQZ6wlUAhXhMCo+5/yM5Hv4Pz2SOEaIcVtf 2OSHVmisuEnMr9Czrdu7SIWQNCHljM/zCHxvLiN6qG3h0PK+TBA9s7OewyCQ24PJBL4Vo5 w4a0YXWP/pNgQWRmxhzBo8cn8ZOeFBH3N6KOM4gNq4s+e7bIeLt1W824YVvVWN/X7GAx6k re+1IDVotff+fL2TkcgK5O83xdcahkKqPZ9i1PPnF/QscmqsBLtEMSUgDEPtzXrWJj8KeU KtJ7WFj/erREt8R9HcaAki/8txWIg/Ov+Y1BI+qHKscNbD7+uLhvDZ8McsGtSA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644090763; a=rsa-sha256; cv=none; b=IKZdQnP7WcE56I8vrrc+TrImXNYwcpNamb20a8ymaFMa3UJT537cFTovfszq4EsK80qaPL xzSRlfu29aEFisN43nf0V4q0GIoKtaFNGLpraDt11dNqqIoKb45x2ho0+4ubbMON1LyTdp iyjYbaJAsxqMMFtEQ5xHxDV0Lo0NHLbzduG7/CnWqxY613XXGVRnXLzlEfhlYOTsyIR8C7 /JlO61g/83YMIe02pBAiuJOi2m+ahDTt/GYDyqOPf9f3Wzqt9WuvjzeJuz1nn3Bi1pgz/8 aVQckik55RKDNjEA6hgl10//coptl8guOwYJFNrrB1kBzSk4lOSAxCXOIkvuMg== 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: 0E6412E95F X-Spam-Score: -1.34 X-Migadu-Scanner: scn1.migadu.com X-TUID: /f5uoiq6l+bw Currently we always check for multi-message mboxes, but some people would prefer to disable this check. Set up infrastructure to disable check. --- lib/config.cc | 4 ++++ lib/notmuch.h | 1 + test/T030-config.sh | 1 + test/T055-path-config.sh | 1 + test/T590-libconfig.sh | 4 ++++ 5 files changed, 11 insertions(+) diff --git a/lib/config.cc b/lib/config.cc index 503a0c8b..296bc3b8 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -581,6 +581,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key) return "database.hook_dir"; case NOTMUCH_CONFIG_BACKUP_DIR: return "database.backup_dir"; + case NOTMUCH_CONFIG_CHECK_MBOX: + return "index.check_mbox"; case NOTMUCH_CONFIG_EXCLUDE_TAGS: return "search.exclude_tags"; case NOTMUCH_CONFIG_NEW_TAGS: @@ -628,6 +630,8 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key) return "unread;inbox"; case NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS: return "true"; + case NOTMUCH_CONFIG_CHECK_MBOX: + return "true"; case NOTMUCH_CONFIG_USER_NAME: name = getenv ("NAME"); if (name) diff --git a/lib/notmuch.h b/lib/notmuch.h index 2e6ec2af..f0cf1a09 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -2551,6 +2551,7 @@ typedef enum { NOTMUCH_CONFIG_USER_NAME, NOTMUCH_CONFIG_AUTOCOMMIT, NOTMUCH_CONFIG_EXTRA_HEADERS, + NOTMUCH_CONFIG_CHECK_MBOX, NOTMUCH_CONFIG_LAST } notmuch_config_key_t; diff --git a/test/T030-config.sh b/test/T030-config.sh index 43bbce31..fe7ac4a6 100755 --- a/test/T030-config.sh +++ b/test/T030-config.sh @@ -57,6 +57,7 @@ database.mail_root=MAIL_DIR database.path=MAIL_DIR foo.list=this;is another;list value; foo.string=this is another string value +index.check_mbox=true maildir.synchronize_flags=true new.ignore= new.tags=unread;inbox diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 1df240dd..2a518892 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -283,6 +283,7 @@ database.backup_dir database.hook_dir database.mail_root=MAIL_DIR database.path +index.check_mbox=true maildir.synchronize_flags=true new.ignore= new.tags=unread;inbox diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 26a1f033..034ac8e6 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -440,6 +440,7 @@ cat <<'EOF' >EXPECTED 10: 'USER_FULL_NAME' 11: '8000' 12: 'NULL' +13: 'true' == stderr == EOF unset MAILDIR @@ -751,6 +752,7 @@ cat <<'EOF' >EXPECTED 10: 'Notmuch Test Suite' 11: '8000' 12: 'NULL' +13: 'true' == stderr == EOF test_expect_equal_file EXPECTED OUTPUT @@ -785,6 +787,7 @@ cat <<'EOF' >EXPECTED 10: 'USER_FULL_NAME' 11: '8000' 12: 'NULL' +13: 'true' == stderr == EOF test_expect_equal_file EXPECTED OUTPUT.clean @@ -856,6 +859,7 @@ database.backup_dir MAIL_DIR/.notmuch/backups database.hook_dir MAIL_DIR/.notmuch/hooks database.mail_root MAIL_DIR database.path MAIL_DIR +index.check_mbox true key with spaces value, with, spaces! maildir.synchronize_flags true new.ignore sekrit_junk -- 2.34.1