3

OfflimeIMAP

I am trying to sync my Gmail - All Mail folder with idlefolders through offlineimap. My .offlineimaprc config has this -

idlefolders = ['INBOX', '[Gmail].All Mail']

My name of my All Mail folder in .mail (where my mailboxes are) looks like

drwx------ 5 ry ry    4096 Oct 12 18:13 [Gmail].All Mail

I think the name is wrong in idlefolders. I see a lot of people online using [Gmail]/All Mail.

My INBOX folder sync fine but All Mail does not.

MUTT

Also trying to set a macro shortcut to All Mail in .muttrc I have -

macro index ga  "<change-folder> =[Gmail].All Mail<enter>"

This does not work, but my macro for INBOX does work

macro index gi  "<change-folder> =INBOX<enter>"

What's wrong? How should I call my All Mail folder?

winchendonsprings
  • 471
  • 2
  • 7
  • 17

3 Answers3

6

for my Mutt 1.5.21, percent encoding works:

macro index ga "<change-folder>=[Gmail]/All%20Mail<enter>"
mykhal
  • 19,175
  • 11
  • 72
  • 80
3

I think the problem here is the whitespace in the folder. Possible solutions:

  1. Update: As winchendonsprings pointed out, there is a way to escape the whitespace in the folder name. Now we can use a macro to change to All Mail:

    bind editor <space> noop
    macro index ga "<change-folder>=[Gmail].All Mail<enter>" "Go to all mail"
    
  2. You use a name transalation to create mailboxes without a whitespace as described in the documentation. For example the translation could look like this:

    nametrans = lambda x: re.sub('\[|\]|\s', '_', x)
    

    You should make sure, as the documentation states, that no folder ends up with the same translated name. You can check this by running offlineimap with --info.

  3. Another possible solution could be, to register your mailboxes and simply use a macro to toggle between the index and your list of configured mailboxes, eg. in your .muttrc:

    mailboxes =[Gmail].All\ Mail =[Gmail].Important =[Gmail].Starred
    macro index <left> ':mailboxes <enter>c?<toggle-mailboxes>
    

    That provides the benefit that mutt monitors your local mailbox and tells you if you've got new mail. You can even automate this if you want. Examples can be found here.

romanofski
  • 1,122
  • 1
  • 12
  • 18
  • It says "The folderfilter operates on the UNTRANSLATED name (before any nametrans fudging takes place)." So what would be the untranslated name for 'All Mail' in Gmail? I believe your solution for nametrans would work, but as a workaround. Unless there is no way to use a folderfilter for 'All Mail.' – winchendonsprings Jan 22 '13 at 02:45
  • The UNTRANSLATED name should be: ``[Gmail]/All Mail``. At least that's what ``offlineimap --info`` spits out for me, not using a name translation. – romanofski Jan 22 '13 at 03:00
  • 1
    You were right! offlineIMAP sees Gmail All Mail folder as [Gmail]/All Mail . It saves it as [Gmail].All Mail . So Mutt needs this for a macro - bind editor noop macro index ga "=[Gmail].All Mail" "Go to all mail" @romanofski – winchendonsprings Jan 22 '13 at 20:19
  • 1
    Ah - well there you have it. The noop "escapes" the whitespace. – romanofski Jan 22 '13 at 21:24
  • I've tried all the options and having offlineimap configured to strip `[Gmail]` via `nametrans`, still space had been troublemaker for `Sent Mail` and `All Mail` until I added the ` noop` fix. Thanks! – mloskot Feb 25 '19 at 19:33
1

Another terrible solution is to just use <complete> to avoid typing a literal space:

macro index ga "<change-folder>=[Gmail]/All<complete><enter>"
Callahad
  • 1,280
  • 6
  • 9