I started using mu4e a few months ago. I synchronize several Gmail
accounts with my local ~/Maildir using mbsync (AKA isync-isync). Wow is
this setup fast! After the initial sync of 18,170 messages in 4 Gmail
accounts, it takes, like, 6 seconds to sync with Gmail (3.4 GHz server
w/SSD & 30 Mbps inet).
FWIW, I tried offlineimap and found it to be many times slower. For
those that, upon hearing this, want to try mbsync, I have attached part
of my ~/.mbsyncrc file. It includes a description of the associated
Gmail settings and the ~/Maildir folder layout that is produced.
My mbsync setup produces 2 local Maildir copies of each "new" Gmail
message. These are either in "All Mail" & "INBOX" or "ALL Mail" & "Sent
Mail", depending on whether Gmail received or sent the message,
respectively. (And possibly other folders, if the message has been moved
around or tagged on the Gmail side.)
Now, as best I can tell, the only way to make a message REALLY go away
on the Gmail side, which I want to be able to do, is to delete the
message from all the local ~/Maildir folders in which it appears. In
practice I typically do this by marking two messages with "D" and then
"x".
Note: There may be a timing issue because I have observed that Gmail
behaves most deterministically if I first delete the message from
"INBOX" or "Sent Mail", then sync with Gmail, and then Delete it from
"All Mail" and sync again. At any rate, when I first delete it in "All
Mail" it seems to hang around longer in Gmail.
Anyway, being a lazy engineer, I would prefer to see and delete the
message only once ;-) So I tried mu4e-headers-toggle-skip-duplicates. It
hides duplicates nicely, but when I delete the message, only one copy
gets deleted and I still have to delete it a second time :-(
I figure there might be two ways to go ...
1) Delete the "INBOX" and "Send Mail" copies of messages upon
receipt. Looking at the mu toolset, which is a rich environment
indeed, (elisp, script, Guile), I am wondering which tool you would
recommend to try this?
2) Alternatively, maybe it would be possible to turn
mu4e-headers-toggle-skip-duplicates on and hack the mu4e delete
function so that it finds and deletes all duplicates? Would this be a
feasible/better approach?
I see that the TODO file says, "- don't show duplicate e-mails
(i.e.. for Gmail); check the message-id" so I am hoping for guidance to
avoid doing something that quickly becomes obsolete.
TIA - George
$ mbsync --version
isync 1.3.0
$ mu --version
mu (mail indexer/searcher) version 0.9.16
Copyright (C) 2008-2015 Dirk-Jan C. Binnema
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~/.mbsyncrc file:
vvvvvvvvvvvvvvvvv
# usage:
# mbsync --all --verbose
# ... or for a single channel ...
# mbsync --verbose --debug cm
#
# With Gmail configured this way ...
#
# > Settings > Labels
#
# > System labels
# Inbox X Show in Imap
# Starred Show in Imap
# Important Show in Imap
# Chats Show in Imap
# Sent Mail X Show in Imap
# Drafts Show in Imap
# All Mail X Show in Imap
# Spam Show in Imap
# Trash Show in Imap
#
# > Labels
# <remove all labels>
#
# > Settings > Forwarding and POP/IMAP
#
# > When I mark a message in IMAP as deleted:
# X Auto-Expung off
#
# > When a message is marked as deleted and expunged...
# X Immediately delete the message forever
#
# ... the 'cm' config below produces a Mairdir store like ...
#
# +--cm
# | +--INBOX
# | +--[Gmail]
# | | +--Sent Mail
# | | +--All Mail
#
# Any "new" Gmail message initially appears in two ~/Maildir folders,
# either in 'cm/INBOX' + 'cm/[Gmail]/All Mail', or 'cm/[Gmail]/Sent
# Mail' + 'cm/[Gmail]/All Mail'. When you delete a message from both
# of the ~/Maildir folders it will be deleted from Gmail.
# Gmail to ~/Maildir
###### cm START
IMAPAccount cm
Host
imap.gmail.com
User <
US...@GMAIL.COM>
Pass <PASSWORD>
AuthMechs LOGIN
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
IMAPStore cm-remote
Account cm
MaildirStore cm-local
Path ~/Maildir/cm/
Inbox ~/Maildir/cm/INBOX
SubFolders Verbatim
Channel cm
Master :cm-remote:
Slave :cm-local:
Patterns "*"
Create Both
Expunge Both
SyncState *
# To (re-)initialize channel cm:
# mu mkdir /home/g1/Maildir/cm && mbsync --all --verbose && mu index
###### cm END
^^^^^^^^^^^^^^^^^