[PATCH v5 0/6] indexing attachment contents

Subject: [PATCH v5 0/6] indexing attachment contents

Date: Sat, 15 Aug 2026 16:01:22 +0200

To: notmuch@notmuchmail.org

Cc:

From: Anton Khirnov


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

Thread: