Discussion:
Mutt, gmail, "All Mail" folder
(too old to reply)
Albert Schueller
9 years ago
Permalink
I've been using mutt for many years on a local mail spool. Our enterprise recently migrated to gmail. I'm trying to get mutt working with gmail. I've had a lot of success so far, thanks to the many wonderful examples out there.

I have one minor issue that I think, if someone can resolve it for me, will help me understand some other things about imap, mutt and gmail.

Many of the mutt/gmail/imap examples out there have a macro like this:

macro index ga "<change-folder>=[Gmail]/All Mail<enter><enter>" "Go to all mail"

Now, I have

set spoolfile = +INBOX

and when I change "folders", e.g. hit 'c' and enter something like =COMMUNITY (which is a label I use), it works just fine. Or when I hit 'c' and then <tab><tab> I get my list of "folders" (really labels) and can switch to whatever I want. There is even a [Gmail] folder with subfolders like "All Mail" that I can successfully navigate. I say this, just to convince everyone that my imap setup is working.

However, when I use the 'ga' macro above, mutt doesn't switch to the "All Mail" folder, but instead just gives a somewhat cryptic error:

"Mail is not a mailbox."

So, in an attempt to debug, I removed the <enter>'s from my macro, like this:

macro index ga "<change-folder>=[Gmail]/All Mail" "Go to all mail"

When I type 'ga' now, I get the prompt:

Open mailbox: Mail

Since there is no mailbox "Mail", this explains the previous error message. :)

Is it the <space> in the mailbox name that's fouling things up? If so, why is the macro everywhere in mutt/imap/gmail examples? Can any one advise me how to get this working?

On a side note, I have starred emails in gmail, but this doesn't work either:

macro index gs "<change-folder>=[Gmail]/Starred<enter>" "Go to starred messages"

In fact, there is no "Starred" folder in the list of folders under [Gmail]

Thanks,

Albert
Eike Rathke
9 years ago
Permalink
Post by Albert Schueller
macro index ga "<change-folder>=[Gmail]/All Mail<enter><enter>" "Go to all mail"
Is it the <space> in the mailbox name that's fouling things up?
Likely. Try to enquote the entire mailbox name in single quotes, as in

macro index ga "<change-folder>='[Gmail]/All Mail'<enter><enter>" "Go to all mail"

Eike
--
OpenPGP/GnuPG encrypted mail preferred in all private communication.
Key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack
Use LibreOffice! https://www.libreoffice.org/
Grant Edwards
9 years ago
Permalink
Post by Eike Rathke
Post by Albert Schueller
macro index ga "<change-folder>=[Gmail]/All Mail<enter><enter>" "Go to all mail"
Is it the <space> in the mailbox name that's fouling things up?
Likely. Try to enquote the entire mailbox name in single quotes, as in
macro index ga "<change-folder>='[Gmail]/All Mail'<enter><enter>" "Go to all mail"
I've never had any luck trying to enter IMAP mailbox paths that
contain spaces.

What I do is enter "=[Gail]/All" then hit tab.

Well, actually, what I do is this

=[<tab>A<tab>

But, that may fail if you've got more than one top level folder that
starts with '[' or any gmail tags that start with 'A'.
--
Grant Edwards grant.b.edwards Yow! I'll show you MY
at telex number if you show me
gmail.com YOURS ...
Albert Schueller
9 years ago
Permalink
Thanks for the inspiration Grant, this is a nice workaround macro:

macro index ga "<change-folder>=[Gmail]/All<tab><enter>" "Go to all mail"

I'll consider this solved.
Orfeas
about a year ago
Permalink
Post by Albert Schueller
macro index ga "<change-folder>=[Gmail]/All<tab><enter>" "Go to all mail"
I'll consider this solved.
I 've had the same exact problem trying to setup neomutt recently and I stumbled upon this post (which even after 7 years it remained relevant).
I did however found a better workaround:

{{{
macro index ga "<change-folder>?/[Gmail]/All Mail<enter><enter>"
}}}

The "<change-folder>?/" opens up the browser and begins searching, the "[Gmail]/All Mail" is the search query which can take spaces without issues and the "<enter><enter>" selects and enters the folder.
This macro doesn't rely on auto-completing and should be better to use.
Loading...