Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Neomutt index of folder contents sometimes contains duplicates #4698

@robolange

Description

@robolange

NeoMutt Version

NeoMutt 20250905
Copyright (C) 2015-2025 Richard Russon and friends
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 6.12.48+deb13-amd64 (x86_64)
ncurses: ncurses 6.5.20250216 (compiled with 6.5.20250216)
libidn2: 2.3.8 (compiled with 2.3.8)
GPGME: 1.24.2
GnuTLS: 3.8.9
libnotmuch: 5.6.0
PCRE2: 10.46 2025-08-27
storage: tokyocabinet, lmdb
compression: lz4, zlib, zstd

Configure options: --build=x86_64-linux-gnu --prefix=/usr {--includedir=${prefix}/include} {--mandir=${prefix}/share/man} {--infodir=${prefix}/share/info} --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules {--libdir=${prefix}/lib/x86_64-linux-gnu} --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --mandir=/usr/share/man --autocrypt --disable-paths-in-cflags --full-doc --gnutls --gpgme --gsasl --gss --lmdb --lua --lz4 --notmuch --pcre2 --sqlite --tokyocabinet --zlib --zstd

Compilation CFLAGS: -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -std=c11 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -DNCURSES_WIDECHAR -isystem /usr/include/mit-krb5

Compile options:
  +autocrypt +fcntl -flock -fmemopen +futimens +getaddrinfo +gnutls +gpgme
  +gsasl +gss +hcache -homespool +idn +inotify -locales_hack +lua +nls +notmuch
  -openssl +pcre2 +pgp -sasl +smime +sqlite +truecolor

MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

Expected Behaviour

I use neomutt with a Maildir mailbox that is externally synced and indexed with mu. I've been using neomutt for many using in this configuration without issue.

Actual Behaviour

After the upgrade from Debian 12 to Debian 13, I noticed that when I switch mailbox folders in neomutt, sometimes the index and mail count for the folder are wrong. For example, let's say I have N=4 mails in my Drafts folder. When I switch from Inbox to Drafts, sometimes the index shows the correct list, but sometimes it shows that I have 12 mails in the folder, and when this happens, the smallest email index is N+1. N+1 through 2N are the 4 mails that should be in the folder, in the correct order, and 2N+1 through 3N are identical copies of these mails, again in the same order. In other words, the index says that I have 3N mails in the folder, but only actually shows me 2N mails.

I can "fix" the issue by switching to another folder and switching back. This seems to be nondeterministic, as sometimes when switching into a folder the bug happens, and sometimes it does not.

I don't think this messes with the actual folder contents. I suspect it's just a display issue, but I am afraid to sync my mailbox now when in neomutt, just in case.

How often does this happen?

It happens randomly, when switching folders. Sometimes the folder contents are correct, sometimes they are not.

When did it start to happen?

I first noticed this bug using Debian 13's 20250510+dfsg-2 version of neomutt, but I then recompiled the version from Debian Sid (20250905+dfsg-1) and was able to replicate the issue.

Extra Info

  • Operating System and its version: Debian 13
  • Were you using multiple copies of NeoMutt at once? No
  • Were you using 'screen' or 'tmux'? Yes, I always use tmux.
  • Is your email local (maildir) or remote (IMAP)? Maildir

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions