Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mutt, gmail, "All Mail" folder

1,121 views
Skip to first unread message

Albert Schueller

unread,
May 17, 2016, 3:30:37 PM5/17/16
to
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

unread,
May 18, 2016, 2:06:37 PM5/18/16
to
* Albert Schueller, 2016-05-17 19:30 UTC:
> 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

unread,
May 18, 2016, 2:45:04 PM5/18/16
to
On 2016-05-18, Eike Rathke <erack-nu...@posteo.de> wrote:
> * Albert Schueller, 2016-05-17 19:30 UTC:
>> 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

unread,
May 18, 2016, 9:42:18 PM5/18/16
to
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

unread,
Aug 27, 2023, 11:16:07 PM8/27/23
to
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.
0 new messages