OfflineIMAP and Mutt with Gmail's All Mail folder

我怕爱的太早我们不能终老 提交于 2019-12-07 19:37:34

问题


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?


回答1:


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.




回答2:


for my Mutt 1.5.21, percent encoding works:

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



回答3:


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

macro index ga "<change-folder>=[Gmail]/All<complete><enter>"


来源:https://stackoverflow.com/questions/14448179/offlineimap-and-mutt-with-gmails-all-mail-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!