Sample Header Ad - 728x90

neomutt+lieer: how to make deletion in neomutt sync properly to GMail?

2 votes
0 answers
726 views
I've recently migrated from mutt to neomutt, and have at the same time been moving from accessing my mailboxes live through IMAP to working with local frequently-synced copies, with a notmuch database. I have both an Outlook (work) address and a Gmail (personal) address. The outlook mail I'm syncing with davmail and OfflineIMAP, and AFAICT it's working well. It's the GMail that's giving me grief; I'm syncing it with lieer which seems to for the most part do a good job, but I'm having a really difficult time with handling the process for message deletion. I can't find anyone else with this specific problem, so I'm guessing the answer is something stupidly simple I'm doing wrong. I'm basically trying to follow more-or-less the workflow described here , although I'm not even trying to use lieer to send mail. The issue AFACT is that neomutt seems to follow one of a few behaviors with regard to what "deleting" a message means, and none of them seem to play quite right with the kind of thing lieeer wants to see to ensure a message is trashed cloudside. Here are the prospects I've looked at: * maildir_trash set to "no", trash unset. AFAICT, this setting makes neomutt unlink (as in, remove the associated file in the appropriate Maildirs) the message. Since lieer won't/can't push deletions (which is probably a good thing), that doesn't remove the messages cloudside on sync. * maildir_trash set to "no", trash set. This is what I used to do, because IMAP connection to GMail provided a [Trash] folder. lieer seems to bring everything in with one monolithic maildir folder (called "mail", and within the lieer working directory), so unless there's a clever way to do this so that trash is a tag rather than a directory, it still doesn't seem to do what I want; changing the path to a message file seems like it would resemble a deletion to lieer, since it would take it out of the lieer sync path. * maildir_trash set to "yes". This seemed really pretty promising, because it seemed like it would set a flag rather than relocate the file, leaving it in the right directory but flagged as trash. Unfortunately, that flag never seems to make it to notmuch (this is apparently by design ) and thus never makes it to lieer. I could add another layer of byzantine automation to translate the flag myself, but I assume if that were necessary someone else would have talked about it. A nonzero number of other people use lieer, notmuch, and neomutt, and nothing I've searched on suggests others have this problem, which suggests I've somehow broken something configured correctly by default? I include below an anonymized version of my .notmuch-config and most of my .neomuttrc (there's a lot of code to color various specific message patterns which I've elided, as it's probably not relevant):
[database]
path=/home/username/Private/.mail

[user]
primary_email=username@gmail.com
other_email=username@work.edu

[new]
tags=new
ignore=/.*[.](json|lock|bak)$/

[search]

[maildir]
synchronize_flags=true

[query]
workmail=folder:account.work/INBOX
gmail=folder:/account.gmail/ AND tag:inbox AND NOT tag:trash
virtual-mailboxes work "notmuch://?query=query:workmail"
virtual-mailboxes gmail "notmuch://?query=query:gmail"
virtual-mailboxes allmail "notmuch://?query=query:workmail OR query:gmail"

send2-hook '~f gmail.com' "source ~/.mutt/accounts/muttrc.gmail"
send2-hook '~f work.edu' "source ~/.mutt/accounts/muttrc.work"

reply-hook '~C work.edu' "source ~/.mutt/accounts/muttrc.work"
reply-hook '~C username.*@gmail.com' "source ~/.mutt/accounts/muttrc.gmail"

message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec check-traditional-pgp"

unignore date

alternates '^username'

source "~/.mutt_aliases"

set abort_noattach=ask-no
set abort_noattach_regex = "\\"
set abort_unmodified=ask-yes
set alias_file="~/.mutt_aliases"
set allow_ansi=yes
set arrow_cursor=yes
set askbcc=yes
set askcc=yes
set beep=no
set beep_new=yes
set certificate_file="~/.mutt_certs"
set confirm_append=no
set copy=yes
set crypt_auto_sign=yes
set edit_headers=yes
set editor="emacs -nw"
set folder="~/.mail"
set header_cache=~/.mutt/cache/headers
set history=20
set implicit_autoview=yes
set keep_flagged=yes
set mailcap_path="~/.mailcap"
set maildir_trash=yes
set mbox_type="Maildir"
set message_cachedir=~/.mutt/cache/bodies
set mime_forward=ask-no
set move=no
set nm_default_uri  = "notmuch:///home/username/.mail"
set pager_stop=yes
set pgp_clear_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
set pgp_export_command="gpg --no-verbose --export --armor %r"
set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"
set pgp_import_command="gpg --no-verbose --import %f"
set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --list-keys %r" 
set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --list-secret-keys %r" 
set pgp_sign_as="0xXXXXXXXX"
set pgp_timeout=1800
set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f"
set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r"
set print_command="enscript -Pkether/2 --margins=:::72 --header='Page $% of $='
set realname = "My Real Name"
set record="+sent-mail"
set signature="$HOME/.signatures/sign|"
set sort = threads
set sort_aux = last-date-received
set spool_file = allmail
set text_flowed=yes
Many thanks to anyone who can help!
Asked by Jake Wildstrom (61 rep)
May 15, 2023, 04:47 PM