neomutt / neomutt

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

IMAP office365: saving a new message while open in pager saves it as new instead of read #2063

Closed freshprince closed 4 years ago

freshprince commented 4 years ago

Expected Behaviour

In neomutt-20180716 and earlier when you used on a new message while it was open in the pager it was saved in the new folder as read.

Actual Behaviour

Since neomut-20191025 on Office365 IMAP accounts such messages get saved as unread.

Steps to Reproduce

In an Office365 IMAP account create two mailboxes for instance test1 and test2:

c ? <Tab> C test1 <CR> C test2 <CR>

Find any mail and copy it to +test1:

C +test1 <CR>

Mark this message in test1 as new:

c +test1 <CR> N $

Now open it in the pager and save it to test2:

<CR> s +test2 <CR> $

Now observe the mail in test2 and see that it is marked as unread:

c +test2 <CR>

How often does this happen?

Always. However it doesn't happen on my dovecot IMAP account or on my google IMAP account when I tried to reproduce it there.

When did it start to happen?

As mentioned since neomut-20191025.

NeoMutt Version

NeoMutt 20191207
Copyright (C) 1996-2016 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 5.4.5_1 (x86_64)
ncurses: ncurses 6.1.20180127 (compiled with 6.1.20180127)
libidn: 1.35 (compiled with 1.35)
GPGme: 1.13.1
libnotmuch: 5.2.0
hcache backends: gdbm

Configure options: --ssl --gpgme --notmuch --gdbm --lua --sasl

Compilation CFLAGS: -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe    -std=c99 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include -I/usr/include/lua5.3 -DNCURSES_WIDECHAR

Default options:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug 
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color 
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop 
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar 
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash 

Compile options:
  -autocrypt +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens 
  +getaddrinfo -gnutls +gpgme -gss +hcache -homespool +idn +inotify 
  -locales_hack +lua +meta -mixmaster +nls +notmuch +openssl +pgp +sasl +smime 
  -sqlite +start_color +sun_attachment +typeahead 
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/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

A possible workaround for me is to close the pager after reading the mail and forcing a sync with $ before saving the mail in another mailbox.

q $ s +test2 <CR>
freshprince commented 4 years ago

git bisect tells me that commit ff57a18b76dde4f4612e8c1f8313d62a0cad85a2 is the culprit.

reverting this commit against 20191207 fixes this problem for me.

please tell me if you need any more information.

gahr commented 4 years ago

I can't reproduce this behaviour with my hotmail account using imap-mail.outlook.com or imap-mail.outlook.com outlook.office365.com as an IMAP server and with an empty configuration.

Can you cut down your config and try with just

./neomutt -F /dev/null -f imaps://your-account@imap-mail.outlook.com -e 'set imap_pass="your-password"' -e 'set imap_check_subscribed'

If it's an on-premises office365 server, things might be different (and even less reproducible for us).

freshprince commented 4 years ago

I just reproduced it with

neomutt -F /dev/null -f imaps://...@imap-mail.outlook.com -e 'set imap_pass="...' -e 'set imap_check_subscribed' -e 'set folder="imaps://..@imap-mail.outlook.com/"

either opening a message that's marked as new or first setting a message as new, syncing with $ and opening that. saving it on a mailbox on the same imap s +Mails<CR>$. The copied message in +Mails is now flaged as new for me.

gahr commented 4 years ago

Could reproduce by sync'ing the mailbox after marking the message as New.