X-Envelope-From: notmuch-bounces@notmuchmail.org  Thu Jun 18 09:50:24 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 6ADE15F87A;
	Thu, 18 Jun 2026 09:50:24 +0000 (UTC)
Received: from dsmtpq1-prd-nl2-vfz.edge.unified.services (dsmtpq1-prd-nl2-vfz.edge.unified.services [84.116.73.68])
	by mail.notmuchmail.org (Postfix) with ESMTPS id 6DBB25F86D
	for <notmuch@notmuchmail.org>; Thu, 18 Jun 2026 09:50:21 +0000 (UTC)
Received: from dsmtpq1-prd-nl1-vfz.edge.unified.services ([84.116.6.67])
	by dsmtpq1-prd-nl2-vfz.edge.unified.services with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
	(Exim 4.97)
	(envelope-from <dick@mrns.nl>)
	id 1wa9O8-0000000Bh00-20jk
	for notmuch@notmuchmail.org;
	Thu, 18 Jun 2026 11:50:20 +0200
Received: from csmtpq1-prd-nl1-vfz.edge.unified.services ([84.116.50.19])
	by dsmtpq1-prd-nl1-vfz.edge.unified.services with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
	(Exim 4.95)
	(envelope-from <dick@mrns.nl>)
	id 1wa9O7-008mro-Ab
	for notmuch@notmuchmail.org;
	Thu, 18 Jun 2026 11:50:19 +0200
Received: from csmtp1-prd-nl2-vfz.nl2.unified.services ([100.105.153.66] helo=csmtp1-prd-nl2-vfz.edge.unified.services)
	by csmtpq1-prd-nl1-vfz.edge.unified.services with esmtp (Exim 4.95)
	(envelope-from <dick@mrns.nl>)
	id 1wa9O6-00GAQc-8o
	for notmuch@notmuchmail.org;
	Thu, 18 Jun 2026 11:50:18 +0200
Received: from routi.mrns.nl ([IPv6:2001:1c00:e7ab:b100::1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 256/256 bits)
	(Client did not present a certificate)
	by csmtp1-prd-nl2-vfz.edge.unified.services with ESMTPSA
	id a9O4w4osAxjv0a9O5weBdP; Thu, 18 Jun 2026 11:50:18 +0200
X-Env-Mailfrom: dick@mrns.nl
X-Env-Rcptto: notmuch@notmuchmail.org
X-SourceIP: 2001:1c00:e7ab:b100::1
X-CNFS-Analysis: v=2.4 cv=UI3t2ify c=1 sm=1 tr=0 ts=6a33bf5a cx=a_exe
 a=zoMZDlfXL7gFr1RgeGQq5Q==:617 a=xqWC_Br6kY4A:10 a=FelO9ux0wxsA:10
 a=LQrtYbNyCH8A:10 a=eKs0HTMTFucpvQ4dKGgA:9 a=Av7yWsGLcrdQWtvRfR4n:22
X-Authenticated-Sender: ieb1yoh3@ziggo.nl
Received: by routi.mrns.nl (sSMTP sendmail emulation); Thu, 18 Jun 2026 11:50:16 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mrns.nl;
 i=@mrns.nl; q=dns/txt; s=mail; t=1781776216; h=from : to : cc :
 subject : date : message-id : mime-version : content-transfer-encoding
 : from; bh=GHBNfYBS19NuiMthbxEm+R50VSTV2GSC8daf3tRRErw=;
 b=c1iD60Fxx1AVRSj3MeI6X9vxs77F05ueghiYqoMCijPdQAlHGGE+2gvvUBtIWigbFIrIn
 WUWP6RNYjmKu7M+AD7UIv3JvasmhLm1G3S5cES8Jw2dqF0vWxjRqcYMUV6yFLGWOpHWTqzV
 ojHZy9mMxkO4sLVjjHvW6GVibjokPsA=
From: Dick Marinus <dick@mrns.nl>
To: notmuch@notmuchmail.org
Subject: [PATCH 0/2] Configurable maildir flag tags
Date: Thu, 18 Jun 2026 11:50:08 +0200
Message-ID: <20260618095008.3571281-1-dick@mrns.nl>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
X-CMAE-Envelope: MS4xfKZYXA4L1aQdFsGJiVzZ4HPxKEELHbrphlz7HG9ShDni/t3CH3DRM8Pu2SRevShRw1QW6orOhbZDYJe3k4nxYSWXcmMzdZIJh3x/x3UNprZz9U3908d7
 geMwGKMXvFmkIU0TtoXxCIV1MXf1Oa5lzFZOCBNkOIPAorpmGaAI/DiGUQGCSFNgAa5tKP/L5mbVypADvJUeaHtgAN8QhxFbrhPeIz9Iz0VWPfHnXsUF7ORh
Message-ID-Hash: SFIP3EHH3ZENNPBLYRSNQWPT4WHAQQSM
X-Message-ID-Hash: SFIP3EHH3ZENNPBLYRSNQWPT4WHAQQSM
X-MailFrom: dick@mrns.nl
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
CC: Dick Marinus <dick@mrns.nl>
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!

I'm using notmuch with maildir synchronization so I can also read my
mails on my phone using K9-Mail/Dovecot IMAP. This is all working pretty
nice but tags aren't visible.

Dovecot allows you to map 26 IMAP keywords to maildir flags (a..z) and
these keywords can be used in a search pattern for virtual mailboxes.

This change also allows you to customize (localize) the tags used.

I got a lot of help from a code agent (deepseek) as I'm not programming
in C/C++ very often, I thought a lot how this should be implemented and
the following idea's were mine:

- The configuration format (;/: separated)
- Using a static allocated, fixed sized maildir_flag_tags array
- Using a numbered index to maildir_flag_tags for tag2flag, sorted by
  tag name so bsearch can be used
- Lazy initialization of the index

I could never have found the problem of the segmentation fault in
notmuch-reply.c myself. This can be reproduced using Fedora 44 GCC.

Please take a look and let me know what can/should be improved.

Thanks in advance!

Dick Marinus (2):
  CLI/reply: use static const for reply_to_map
  lib/message: make maildir flags configurable

 contrib/python-legacy/notmuch/message.py      |  14 --
 doc/man1/notmuch-config.rst                   |  23 +--
 lib/config.cc                                 |   4 +
 lib/message.cc                                | 189 ++++++++++++++----
 lib/notmuch.h                                 |  26 +--
 notmuch-config.c                              |  14 +-
 notmuch-reply.c                               |   2 +-
 test/T030-config.sh                           |   1 +
 test/T055-path-config.sh                      |   2 +
 test/T590-libconfig.sh                        |  70 ++++---
 .../config-with-comments                      |  14 +-
 11 files changed, 225 insertions(+), 134 deletions(-)

-- 
2.54.0

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