(I spent a while figuring this out and googling didn't help, so I
figured I'd send an email to document this for anyone who might need it
in the future.)

Gmail's behavior is quite weird by default. When you delete an email
(e.g. in mutt) and execte `mbsync`, the deleted email will actually
simply be hidden from "Inbox" (or whichever folder you deleted it from).
It will still show in "All Mail".

>From an old Gmail Support page:

> Messages that are deleted from an IMAP folder (except for those in 
> [Gmail]/Spam or [Gmail]/Trash) only have that label removed and still exist 
> in All Mail

To obtain the same behavior as the web interface (deleting a message
moves it to "Trash"), you have to perform the following steps:

1. Gmail -> Settings -> Labels > Uncheck "Show in IMAP" for "All Mail"
2. Gmail -> Settings -> Forwarding and POP/IMAP -> "When I mark a message in 
IMAP as deleted:" -> Check "Auto-Expunge off"
3. Gmail -> Settings -> Forwarding and POP/IMAP -> "When a message is marked as 
deleted and expunged from the last visible IMAP folder:" -> Check "Move the 
message to the Trash"

When you delete an email now (e.g. in mutt) and run `mbsync`, the
deletion and expunction will be propagated and since the email is no
longer in any IMAP folder (since we hid "All Mail" for IMAP), it will be
moved to "Trash".

Note: unfortunately, this means you cannot use "All Mail" in mbsync
anymore. If you depend on that, using notmuch may provide a local
alternative to replicating "All Mail".

Cheers.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to