neomutt / neomutt

✉️ Teaching an Old Dog New Tricks -- IRC: #neomutt on irc.libera.chat
https://neomutt.org/
GNU General Public License v2.0
3.26k stars 308 forks source link

Message tags in folder change on "next-undeleted" #4123

Open scottkosty opened 11 months ago

scottkosty commented 11 months ago

Expected Behaviour

I expect the message tags to be calculated when the folder is opened.

Actual Behaviour

They are calculated, but then an "s" tag is added when I just use 'next-undeleted' to change message.

Steps to Reproduce

I open a folder and I press "j".

How often does this happen?

When did it start to happen?

(EDIT) Behavior changed recently on the "main" branch. Behavior changed at some point between tag 20220415 and tag 20220429. I could do a full bisect if that would be helpful.

NeoMutt Version

NeoMutt 20231103-107-582dc1
Copyright (C) 1996-2022 Michael R. Elkins and others.
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.2.0-37-generic (x86_64)
ncurses: ncurses 6.4.20221231 (compiled with 6.4.20221231)
libidn2: 2.3.3 (compiled with 2.3.3)
OpenSSL: OpenSSL 3.0.8 7 Feb 2023
libnotmuch: 5.6.0
storage: tokyocabinet

Configure options: --ssl --sasl --enable-notmuch --enable-debug --tokyocabinet --prefix=/usr/local

Compilation CFLAGS: -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -I/usr/local/include -DNCURSES_WIDECHAR -I/usr/local/include -O2

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

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

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <neomutt-devel@neomutt.org>

Extra Info

local (maildir)

Below are before/after screenshots, note the lower case "s" as the tag. I actually don't use these tags much and don't know what the 's' means.

Here is a before screenshot:

before

Here is an after screenshot: after

gahr commented 10 months ago

s means the email is signed. It's not clear to me why it would appear only when you hitnext-undeleted.

scottkosty commented 10 months ago

@gahr Would a bisect be helpful?

gahr commented 10 months ago

Can't hurt ;) thanks!

scottkosty commented 10 months ago

Bisect leads to 1983fadb. This commit introduces a bit different behavior than described: the 's' tag only shows when the message is highlighted in the index. The current behavior is that the 's' tag shows for all messages after one 'next-undeleted'. I bisected on the first strange behavior.

scottkosty commented 10 months ago

Some additional notes: the problem doesn't occur for my signed email. Only for the signed emails of others.

scottkosty commented 10 months ago

@flatcap just thought I would ping you in case the bisected commit gives a clue. No problem if you're busy with other things.

flatcap commented 10 months ago

What's your config?

neomutt -Q index_format -Q crypt_chars

It sounds like a refresh problem, but I can't think why the crypto status wouldn't be known on the first drawing. Unless... header cache? Could you try deleting the header cache, just in case.

Side note: you have storage: tokyocabinet The LMDB database is much faster :-)


Instead of hitting <next-undeleted>, does <redraw-screen> (Ctrl-L) have the same effect?


I can't repeat this with either my normal, or minimal, config.

Please can you try with minimal config:

min.rc

set imap_user  = "USERNAME"
set imap_pass  = "PASSWORD"

run

neomutt -f imaps://example.com/inbox -F min.rc

Thanks!

scottkosty commented 10 months ago

@flatcap

Thanks for all of those details!

What's your config?

neomutt -Q index_format -Q crypt_chars
$ neomutt -Q index_format -Q crypt_chars
set index_format = "%4C %Z %[%b %d %R] %-15.15F (%X) %s"
set crypt_chars = "SPsK "

It sounds like a refresh problem, but I can't think why the crypto status wouldn't be known on the first drawing. Unless... header cache? Could you try deleting the header cache, just in case.

I deleted the cache, and I can still reproduce after.

Instead of hitting <next-undeleted>, does <redraw-screen> (Ctrl-L) have the same effect?

Yes, same effect.

Please can you try with minimal config:

I can reproduce with the following minimal config:

set realname = 'Scott Kostyshak'
set imap_user = 'scott.kostyshak@gmail.com'
set imap_pass = "thisisnotmypassword"

set folder = "~/.mail"

set smtp_url = "smtp://scott.kostyshak@smtp.gmail.com:587/"
set smtp_pass = $imap_pass

set spoolfile = +INBOX

set index_format = "%4C %Z %[%b %d %R] %-15.15F (%X) %s"

Do you know any other users who regularly receive signed emails? It might be helpful to ping them.

No problem if no other ideas come to mind. I thought this might not be too hard to debug since we have the bisected commit, but especially since you can't reproduce, and since this doesn't seem serious, I'm completely fine to let this one go. Or rather it seems reasonable the burden is on me if I want to try to dig in the code and figure out some clues.

scottkosty commented 10 months ago

I forgot to respond to this part:

Side note: you have storage: tokyocabinet The LMDB database is much faster :-)

Thank you! I will plan to make that change.