LukeSmithxyz / mutt-wizard

A system for automatically configuring mutt and isync with a simple interface and safe passwords
GNU General Public License v3.0
2.39k stars 382 forks source link

Messages disappear from INBOX after having opened them #974

Closed clauseggers closed 8 months ago

clauseggers commented 8 months ago

I have run into an issue that I can’t fix. After I have opened messages in my inbox, these messages disappear closing and re-opening NeoMutt – sometimes even after shifting to another account and then back again from within NeoMutt. I can usually see that the message still exists in ~/.local/share/mail/user@domain.tld/INBOX/new/123456789xxx while this happens, but running mbsync -a removes it. It is also removed from the server. I’m at a lost as to what might be wrong. It happens to all the accounts I have configured and try using in NeoMutt.

Now this is not the stock config as generated by MW, it contains my custom changes. I have tried to turn things one and off in the mutt config files, but I didn’t find anything helpful. I should also mention that MW was not able to successfully generate the config files. Only when using the -f flag could it generate them.

I built MW from my Git clone on Fedora 39 Workstation (x86-64).

Here are my config files, muttrc

# vim: filetype=neomuttrc

# Source the Mutt Wizard defaults
source /usr/local/share/mutt-wizard/mutt-wizard.muttrc
# source /home/claus/Git/mutt-wizard/share/mutt-wizard.muttrc

# Set the paths I want to use
set mbox_type = Maildir
set folder = /home/claus/.local/share/mail
set header_cache = /home/claus/.cache/mutt/headers
set message_cachedir = /home/claus/.cache/mutt

# Stop the beeping
set beep = no
set beep_new = no

# Skip confirmations on saving and moving messages
unset confirmappend

# Stop asking if I want to move read messages
set move = no

# My `mailcap` override file
# NOTE: Must be absolute path.
set mailcap_path = /home/claus/.config/mutt/mailcap:$mailcap_path

# Source the first account here:
source /home/claus/.config/mutt/accounts/1-first@domain.tld.muttrc

# Here is the list of accounts and their keyboard shortcuts.
macro index,pager i1 '<sync-mailbox><enter-command>source /home/claus/.config/mutt/accounts/1-first@domain.tld.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to first@domain.tld"

macro index,pager i2 '<sync-mailbox><enter-command>source /home/claus/.config/mutt/accounts/2-second@domain.tld.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to second@domain.tld"

# Source the Solarized (Dark) colour schema
source /home/claus/.config/mutt/mutt-colors-solarized/mutt-colors-solarized-dark-16.muttrc

# Powerline shennanigans
source /home/claus/.config/mutt/powerline/powerline.neomuttrc

# Bind delete key in the pager
bind index,pager d noop
macro index,pager dd "<delete-message><sync-mailbox>" "Move message to trash"
bind index,pager u noop
bind index,pager ud undelete-message

And the first account 1-first@domain.tld.muttrc (the second account config is similar)

# vim: filetype=neomuttrc

# muttrc file for account first@domain.tld
set realname = "Claus Eggers Sørensen"
set from = "first@domain.tld"
set sendmail = "msmtp -a first@domain.tld"
alias me es <first@domain.tld>

# Define far and near folders
# set folder = /home/claus/.local/share/mail/first@domain.tld
set folder = imaps://first@domain.tld@imap.one.com:993

# Set cashing
set header_cache = /home/claus/.cache/mutt/first_domain.tld/headers
set message_cachedir = /home/claus/.cache/mutt/first_domain.tld
set message_cache_dir = /home/claus/.cache/mutt/first_domain.tld

# Credentials
set mbox_type = Maildir
set hostname = "domain.tld"
set imap_user = "first@domain.tld"
set imap_pass = "`pass Email/first@domain.tld`"
set ssl_starttls = yes
set ssl_force_tls = yes

# Press `o` to pull mail
macro index o "<shell-escape>mailsync first@domain.tld<enter>" "sync first@domain.tld"

# Free keystrokes for other combinations (see below)
bind index,pager g noop
bind index,pager gg noop
bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
unmailboxes *
unalternates *
unset signature

# Show messages in threads, with the newest on top.
set sort = threads
set strict_threads = yes

# Threads with new messages will appear at the top.
set sort_browser = reverse-date
set sort_aux = reverse-last-date-received
unset collapse_unread

# Collapse threads with no new messages
set uncollapse_new = yes

# Jump to the new messages
set uncollapse_jump = yes
set collapse_unread = no

# Don't ask for confirmation for the following actions
set delete = no
set confirmappend = no
set move = yes

# Collapse everything by default
folder-hook . push '<collapse-all>'

# Delimiters
set imap_delim_chars=/.
set sidebar_delim_chars=/.

# First get all folders, then get subscribed folders
set imap_list_subscribed
set imap_check_subscribed
mailboxes "=INBOX"
set spoolfile = "=INBOX"

# Keyboard shortcuts for common actions
macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox"
macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox"

set trash = "+INBOX.Trash"
macro index,pager gt "<change-folder>=INBOX.Trash<enter>" "go to trash"
macro index,pager Mt ";<save-message>=INBOX.Trash<enter>" "move mail to trash"
macro index,pager Ct ";<copy-message>=INBOX.Trash<enter>" "copy mail to trash"

set record = "+INBOX.Sent"
macro index,pager gs "<change-folder>=INBOX.Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=INBOX.Sent<enter>" "move mail to sent"
macro index,pager Cs ";<copy-message>=INBOX.Sent<enter>" "copy mail to sent"

set postponed = "+INBOX.Drafts"
macro index,pager gd "<change-folder>=INBOX.Drafts<enter>" "go to drafts"
macro index,pager Md ";<save-message>=INBOX.Drafts<enter>" "move mail to drafts"
macro index,pager Cd ";<copy-message>=INBOX.Drafts<enter>" "copy mail to drafts"

# `INBOX.Spam` is the one.com assigned junk/spam folder
macro index,pager gj "<change-folder>=INBOX.Spam<enter>" "go to junk"
macro index,pager Mj ";<save-message>=INBOX.Spam<enter>" "move mail to junk"
macro index,pager Cj ";<copy-message>=INBOX.Spam<enter>" "copy mail to junk"

# `INBOX.Archive` is the one.com assigned archive folder
macro index,pager ga "<change-folder>=INBOX.Archive<enter>" "go to archive"
macro index,pager Ma ";<save-message>=INBOX.Archive<enter>" "move mail to archive"
macro index,pager Ca ";<copy-message>=INBOX.Archive<enter>" "copy mail to archive"
clauseggers commented 8 months ago

I went through the config line by line, and I found the issue. I had set set move = yes, and this caused the read new messages to be moved to a mbox directory in my user root directory. I’m guessing the mbox for read messages was undefined, therefore a new one was created in user root. Setting set move = no fixed the issue.