X-Envelope-From: notmuch-bounces@notmuchmail.org  Sat Aug 15 14:12:10 2026
Return-Path: <notmuch-bounces@notmuchmail.org>
X-Original-To: nmbug@yantan.tethera.net
Delivered-To: nmbug@yantan.tethera.net
Received: from yantan.tethera.net (localhost [127.0.0.1])
	by mail.notmuchmail.org (Postfix) with ESMTP id 043205F88A;
	Sat, 15 Aug 2026 14:12:10 +0000 (UTC)
X-Greylist: delayed 559 seconds by postgrey-1.36 at yantan; Sat, 15 Aug 2026 14:12:05 UTC
Received: from mail1.khirnov.net (mail1.khirnov.net [IPv6:2a00:c500:561:206::5])
	by mail.notmuchmail.org (Postfix) with ESMTPS id 90FBE5F882
	for <notmuch@notmuchmail.org>; Sat, 15 Aug 2026 14:12:05 +0000 (UTC)
Authentication-Results: mail1.khirnov.net;
	dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=RHwGcmmi;
	dkim-atps=neutral
Received: from localhost (mail1.khirnov.net [IPv6:::1])
	by mail1.khirnov.net (Postfix) with ESMTP id BFAB41FEB
	for <notmuch@notmuchmail.org>; Sat, 15 Aug 2026 16:02:48 +0200 (CEST)
Received: from mail1.khirnov.net ([IPv6:::1])
 by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP
 id 6QIurtdfR8dz for <notmuch@notmuchmail.org>;
 Sat, 15 Aug 2026 16:02:45 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail;
	t=1786802561; bh=dNWR+NmlxHYNAmOWszuqjluhdbU7yzD3Y4uTsjyXQbU=;
	h=From:To:Subject:Date:From;
	b=RHwGcmmidUuWZgoVUOYEzWpP09LwXE1mycZZ2JG1B6Ivoxyx0mHbLv4pWIP8v6eG7
	 eKKGEZBYan5wVHZkIjcQk6DrTSb7kSkknD9wyBFjsD1LzOVVaMAC4T1LKuV/jU2acS
	 ymyTlP6MC2wIqIFd9xfrvW3pxVLPGiieEfumq2UG7qrXlGjjTW6XAlQVbo0+cUG7b+
	 oRKj0MG60tsCyN2p8Q0DHB4iXk6uly8R4T7ZKSfFO6bz6lmhoNjFtfNgTOpb6l3Hi+
	 +HB3z09Lh/5KZttrjJ2I3dbCwCRkJM++3N+N1WKDq6+2miluA9p9UhWfefAFhtoAU6
	 KS9R1lBpRJ11A==
Received: from dev0.khirnov.net (dev0.khirnov.net [IPv6:2a00:c500:561:201::6])
	(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
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "dev0.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK))
	by mail1.khirnov.net (Postfix) with ESMTPS id 9BFF73B1
	for <notmuch@notmuchmail.org>; Sat, 15 Aug 2026 16:02:40 +0200 (CEST)
Received: by dev0.khirnov.net (Postfix, from userid 1000)
	id 871FC402ACA; Sat, 15 Aug 2026 16:02:40 +0200 (CEST)
From: Anton Khirnov <anton@khirnov.net>
To: notmuch@notmuchmail.org
Subject: [PATCH v5 0/6] indexing attachment contents
Date: Sat, 15 Aug 2026 16:01:22 +0200
Message-ID: <20260815140127.26199-2-anton@khirnov.net>
X-Mailer: git-send-email 2.47.3
MIME-Version: 1.0
Message-ID-Hash: XZEWDC4V3BHG2DTLMEGLGGJZCKLXC4XI
X-Message-ID-Hash: XZEWDC4V3BHG2DTLMEGLGGJZCKLXC4XI
X-MailFrom: anton@khirnov.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." <notmuch.notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Owner: <mailto:notmuch-owner@notmuchmail.org>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Subscribe: <mailto:notmuch-join@notmuchmail.org>
List-Unsubscribe: <mailto:notmuch-leave@notmuchmail.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi,
another iteration of the set adding support for indexing attachment
contents. I believe I've addressed all the review comments from the
previous round [1].

The first patch now contains a simple performance test that runs reindex
on all emails with attachments - twice with no filter, and once with a
trivial /bin/true filter. By placing the test early in the series it is
easy to see that the following patches do not make the filter-less runs
slower.

As for the run with the filter, the test does show that the fork
overhead is susbtantial, especially with larger database sizes. As per
previous discussion I believe the cost is acceptable, since the
alternative (a persistent filter daemon) would be far more complex with
regards to both implementation and administration.

[1] id:20260307160342.16482-1-anton@khirnov.net

Cheers,
-- 
Anton Khirnov

---

Anton Khirnov (6):
  Add API for filtering attachments with an external program.
  index: implement filtering attachments with an external program
  test: add tests for attachment filtering
  doc/examples: add a Firejail profile for sandboxing filtering programs
  doc/examples: add an example Bubblewrap command for sandboxing
    filtering programs
  doc/examples: add an attachment filtering program

 Makefile.local                              |   2 +-
 bindings/python-cffi/notmuch2/_build.py     |   5 +
 bindings/python-cffi/notmuch2/_database.py  |  21 ++
 bindings/python-cffi/tests/test_database.py |  16 +
 configure                                   |   6 +
 debian/rules                                |   1 +
 doc/Makefile.local                          |  10 +-
 doc/examples/README.filter.rst              |  23 ++
 doc/examples/bwrap.sh                       |   9 +
 doc/examples/filter.py                      | 385 ++++++++++++++++++++
 doc/man1/notmuch-config.rst                 |  46 +++
 lib/config.cc                               |   3 +
 lib/index.cc                                | 312 +++++++++++++++-
 lib/indexopts.c                             |  34 ++
 lib/notmuch.h                               |  23 ++
 performance-test/T09-attachment-index.sh    |  18 +
 test/T590-libconfig.sh                      |   5 +
 test/T681-index-filter.sh                   |  84 +++++
 18 files changed, 981 insertions(+), 22 deletions(-)
 create mode 100644 doc/examples/README.filter.rst
 create mode 100755 doc/examples/bwrap.sh
 create mode 100755 doc/examples/filter.py
 create mode 100755 performance-test/T09-attachment-index.sh
 create mode 100755 test/T681-index-filter.sh

-- 
2.47.3

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org
