how to use mu4e and gmail on multiple devices

37 views
Skip to first unread message

Daniel Goldin

unread,
Mar 28, 2024, 8:36:06 PM3/28/24
to mu-di...@googlegroups.com
Hi all,

Again, a disclaimer, I am a non-programmer who uses Mu4e for academic papers. It's a wonderful program, but I am struggling to figure out how to use mu4e in a coherent way across multiple devices (same gmail address). Right now, I am using rclone to bring Maildir back and forth between the two devices, but on my second device, the inbox shows up with 133 messages vs. the 3 in the inbox in the other device (the rest I sent to various folders under the maildir). Right now, all I am downloading from gmail is in the inbox. I am sure this is a clumsy system. Any hep of pointers would be greatly appreciated.
--
Daniel Goldin
Editor, Psychoanalytic Inquiry

Tim Cross

unread,
Mar 28, 2024, 10:04:00 PM3/28/24
to mu-di...@googlegroups.com

I use mu4e on multiple devices with a gmail account. This is what I do.

- I use isync to synchronize local and gmail mailboxes
- I use the IMAP configruation options available in yhour gmail account
to set which mailboxes are available via IMAP

and thats pretty much it. I don't mess around with rclone or anything
else between devices. This is what IMAP takes care of. I do have my
isync setup so that the sent folders is uploaded/synchronised and when I
put something into trash locally, it expunges that message on the gmail
side as well (so that when I next check mail on the other device, it all
just works).

Likewise, this also 'just works' when using other clients, such as the
email client on my phone. Just let imap take care of it all.

mag...@therning.org

unread,
Mar 29, 2024, 2:59:42 AM3/29/24
to mu-di...@googlegroups.com
Tim Cross <theop...@gmail.com> writes:

> I use mu4e on multiple devices with a gmail account. This is
> what I do.
>
> - I use isync to synchronize local and gmail mailboxes
> - I use the IMAP configruation options available in yhour gmail
> account
> to set which mailboxes are available via IMAP
>
> and thats pretty much it. I don't mess around with rclone or
> anything
> else between devices. This is what IMAP takes care of. I do have
> my
> isync setup so that the sent folders is uploaded/synchronised
> and when I
> put something into trash locally, it expunges that message on
> the gmail
> side as well (so that when I next check mail on the other
> device, it all
> just works).
>
> Likewise, this also 'just works' when using other clients, such
> as the
> email client on my phone. Just let imap take care of it all.

Yes, exactly! I do the same, though I'm using offlineimap[1]
instead of isync.

It's worth noting that GMail's use of IMAP, in particular how they
map tags to folders, may result in duplicated messages locally.
[2] is a good starting point, but you may want to limit what
folders you sync.

[1]: https://www.offlineimap.org/
[2]:
https://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html

>> Hi all,
>>
>> Again, a disclaimer, I am a non-programmer who uses Mu4e for
>> academic papers. It's a wonderful program, but I am struggling
>> to figure out how to use mu4e in a coherent way across multiple
>> devices (same
>> gmail address). Right now, I am using rclone to
>> bring Maildir back and forth between the two devices, but on my
>> second device,
>> the inbox shows up with 133 messages vs. the 3
>> in the inbox in the other device (the rest I sent to various
>> folders under the
>> maildir). Right now, all I am downloading from gmail
>> is in the inbox. I am sure this is a clumsy system. Any hep of
>> pointers would be greatly appreciated.
>> --
>> Daniel Goldin
>> Editor, Psychoanalytic Inquiry
>> 626-817-2462

--
Magnus Therning OpenPGP: 0x927912051716CE39
email: mag...@therning.org
@mag...@mastodon.technology http://magnus.therning.org/

"In the beginning the Universe was created. This has made a lot of
people very angry and been widely regarded as a bad move."

— The Book just racapping what happened in the last book.

Tim Cross

unread,
Mar 29, 2024, 4:57:47 AM3/29/24
to mu-di...@googlegroups.com


mag...@therning.org writes:

>
> It's worth noting that GMail's use of IMAP, in particular how they map tags to folders,
> may result in duplicated messages locally. [2] is a good starting point, but you may want
> to limit what folders you sync.
>
> [1]: https://www.offlineimap.org/
> [2]: https://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html
>
That is a good point. I forgot to mention that.

One of the things I have changed in my workflow is that I now use far
fewer mailboxes with gmail. Instead of mailboxes, I just rely on Mu's
fine searching capabilities.

Previously, I had a lot of different folders in Gmail and even ha quite
a few gmail filters which would automatically sort messages into
different folders. However, I now just have a couple of folders. My
basic workflow is

1. I just sync
- 'All Mail'
- INBOX
- sent
- bin/trash
- draft
- Refile

The 'Refile' folder is one where I put messages I've read, no longer
need in my INBOX, but I want to keep. Every few weeks I go through this
folder in Gmail and move messages to different folders in gmail. None of
these additional folders are synced locally. I found this gove me the
fastest syncing and minimal number of duplicates locally. I could get by
without the 'All Mail', but then again, if I want to search through my
messages with mu/mu4e, the All Mail mailbox is very useful.

Due to the way Gmail uses tags rather than real folders to store mail,
when I 'move' mail using the gmail interface (when processing my
'refile' folder), all that gmail is really doing is tagging messages. I
do this only because sometimes I do use different clients (such as on my
phone) where I don't have the power of mu4e/mu searches, so having
things tagged into different folders can make life a little easier.

Setting which 'folders' are visible via imap was really uiseful as it
made setting up the mbsyncrc file really easy. I just needed something
like

Channel gmail
Far :gmail-remote:
Near :gmail-local:
Patterns * !"[Gmail]/Important" !"[Gmail]/Starred"
Create Both
Expunge Both
SyncState *

If you don't set which folders are visible (via the gmail/google
settings), then you will get a 'mailbox' for every 'tag' in gmail and
the messages in each of those mailboxes will be duplicates of messages
in 'All Mail', so you willl be donwloading them twice! (or even more if
you have any with multiple tags)

I actually don't like Gmail and would move to something like Proton
Mail, but I've been using Gmail for so long and have so much associated
with that address, it is now just too painful to consider changing. I
could setup complicated forwarding and relaying, but that becomes a PITA
and getting it to work correctly wrt the many broken anti-spam systems
out there is simply a boring task I don't have the energy to maintain!

The great benefit of mu4e is that to a large extent, what I do now is
just dump all my messages into one big box and if I need to find some
specific message, I just use mu search.

Jerry Lee Daniel

unread,
May 7, 2024, 5:41:44 AM5/7/24
to mu-discuss

Loans, Project and Digital Investment financing available up to $150m.
Have a Business Plan, Fundable Project and Collateral.

Contact: danielj...@gmail.com
Whatsapp: ‪+1 (918) 707‑0858

bvk

unread,
Oct 28, 2025, 7:21:27 PM (12 days ago) Oct 28
to mu-discuss
Hi,

I am resurrecting this old thread, hoping to find a solution for my problem with GMail.

I am syncing both INBOX and All Mail folders using mbsync. However, when I trash a mail using mu4e from INBOX, a copy of it still stays in the All-Mail folder. How do I avoid this?


Thank you,
Chaitanya

Dirk-Jan C. Binnema

unread,
Oct 31, 2025, 2:55:28 PM (9 days ago) Oct 31
to mu-di...@googlegroups.com
On Tuesday Oct 28 2025, bvk wrote:

> Hi,
>
> I am resurrecting this old thread, hoping to find a solution for my problem
> with GMail.
>
> I am syncing both INBOX and All Mail folders using mbsync. However, when I
> trash a mail using mu4e from INBOX, a copy of it still stays in the
> All-Mail folder. How do I avoid this?

I think the below advise is still good. And/or perhaps simply not sync
the All-Mail folder.

My personal solution is to not worry about server-side folders, and use
e.g Gmail just as a kind of backup. Use e.g. `fetchmail` to read your
Gmail inbox, and don't bother syncing back.

Kind regards,
Dirk.
--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
gpg: 6987 9CED 1745 9375 0F14 DA98 11DD FEA9 DCC4 A036

BVK Chaitanya

unread,
Oct 31, 2025, 4:38:56 PM (9 days ago) Oct 31
to mu-di...@googlegroups.com
Hi,


Thanks for the response. I see that not syncing the All-Mail folder kinda solves the problem, but it is unpleasant for me. All-Mail on GMail accumulates all kinds of spam overtime. Even if I drop the web based use case, I will still need access to my mails on my mobile.

I resorted to the following solution, which handles multiple copies of the mail:

(mu4e--server-remove docid)
(mu4e--server-move msgid (mur3-get-trash-folder msg) nil)

First clause deletes the current message whose docid can be retrieved easily and blindly moves the duplicates (if any) to the trash by the message-id. Second clause fails if there are no duplicates.

IMO this could be made more robust if we could have access to *all* docids with a given message-id. I can take a stab at this if you think this is acceptable. 


Thanks,
Chaitanya




--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mu-discuss/87jz0ahpf1.fsf%40djcbsoftware.nl.

Tim Cross

unread,
Oct 31, 2025, 8:22:48 PM (9 days ago) Oct 31
to mu-di...@googlegroups.com
I use gmail on multiple devices and here is what I do.

1. Change gmail settings in google. In particular, you can control which
'labels' gmail exposes as imap directories. I only have the very few
ones I'm interested in made visible.

2. Ignore 'All Mail'. You simply don't need it. Gmail doesn't have email
folders. It only has 1 folder, 'All Mail'. Everything else is just
labels. The gmail imap interface presents the labels you define (and if
you have configured it, just a subset) as 'pseudo' imap folders.

3. I use mbsync and by default fetch/sync all the 'folders' I have set
in the gmail config i.e. I don't export all labels and I don't export
'All Mail'.

I also turn off most of gmail's 'special' folders i.e. important,
purchases, starred etc. I don't use them and don't need them. I really
just use 'sent', 'drafts', 'inbox', 'archive', 'later' and 2 specific
email list folders/labels. About once a week or so, I will log into
gmail on the web and check/delete the messages in the spam folder. I
also have gmail configured to 'purge' the trash folder every 30
days. From memory, I think I may have also made some other tweaks to how
gmail handles mail, archiving and all mail in the google gmail config.

The really big change I made was to stop using mail folders as much as I
use to. This was one of the big benefits of mu4e. Because it has such
powerful search capabilities, I don't need to put messages in different
folders or use lots of labels. This saves me lots of time as I don't
need to sort/store messages like I use to. My basic workflow is

1. All new messages come into either INBOX or one of my two mail
lists. Gmail sorting rules puts the messages into the mail list
'folders'.

2. I look at messages in inbox, mostly on my Linux system using mu4e,
but also on my mobile and sometimes my tablet. ;

3. After reading the message, I either move it to 'archive' if I'm done
wsith it and want to keep it, to 'later' if I need to do something
with/abolut it and will need to reference it and trash if I no longer
need it. Every few weeks I will go through my 'later' folder and move
anything no longer needing action to archive or delete it. The big
advantage I find with this approach is that my inbox is small and only
contains messages I need to read, my 'later' inboxs is relatively small
and only contains messages that either I need to take action on
i.e. request to do something, or contain info which may be useful
e.g. tracking number of a delivery I'm waiting on.

Most of the time, I'm reading messages from INBOX or referencing
information in 'later'. I rarely need to use 'archive', but when I do, I
just use mu4e to search for what I'm looking for. This setup also has
the advantage of keeping my sync process with mbsync short. With?he
default of pulling everything, you are pulling many messages multiple
times. With my scheme, I onlyh pull them once.

I don't find 'All Mail' fills up with spam. Not sure why I don't and you
do. I do find it can be confusing because messages you have deleted and
spam messages will sit in their until you have deleted spam and your
deleted expunge perod, configured within google, has been
reached. Reality is, I just don't look at it.

HTH

mag...@therning.org

unread,
Nov 2, 2025, 6:36:13 PM (7 days ago) Nov 2
to mu-di...@googlegroups.com
bvk <bvk....@gmail.com> writes:

> Hi,
>
> I am resurrecting this old thread, hoping to find a solution for
> my problem with GMail.
>
> I am syncing both INBOX and All Mail folders using mbsync.
> However, when I trash a mail using mu4e from INBOX, a copy of it
> still stays
> in the All-Mail folder. How do I avoid this?

My use, and advice, seems to be completely counter to what
everyone else does. I only sync

- All Mail
- Bin
- Drafts
- Spam

as that seems give me all emails and no local duplicates and it's
easy to recreate the inbox locally using search.

/M

--
Magnus Therning OpenPGP: 0x927912051716CE39
email: mag...@therning.org
@mag...@mastodon.technology http://magnus.therning.org/

For a successful technology, reality must take precedence over
public
relations, for nature cannot be fooled.
— R.P. Feynman

BVK Chaitanya

unread,
Nov 8, 2025, 1:31:13 PM (23 hours ago) Nov 8
to mu-di...@googlegroups.com
On Sun, Nov 2, 2025 at 3:36 PM <mag...@therning.org> wrote:

My use, and advice, seems to be completely counter to what
everyone else does. I only sync

- All Mail
- Bin
- Drafts
- Spam

as that seems give me all emails and no local duplicates and it's
easy to recreate the inbox locally using search.

I think this looks like the best solution for my needs as well. If you don't mind, could you share your bookmark rules?


Thanks,
Chaitanya
Reply all
Reply to author
Forward
0 new messages