On Sun, May 14, 2017 at 09:33:46AM +1000, Cameron Simpson wrote: > On 13May2017 17:32, Yubin Ruan <ablacktsh...@gmail.com> wrote: > >I am wondering whether it is possible to tell mutt to prefetch mails folder > >by > >folder so that I can read mails more quickly without waiting for the > >"Fetching > >mails..." every time. > > > >I have set up mutt's cache, so it helps a little, but it is still slow > >because I > >have to fetch the mails before mutt can cache them. > > > >I know there is something like `fetchmail', but, setting up it is tricky, > >especially with a IMAP server (or, do you have good references?) > > The other common solution for IMAP mail accounts is offlineimap, which will > mirror IMAP accounts to local storage. > > Because mutt is single threaded, all "prefetch" arrangements tend to store > the mail locally. This is several advantages: > > - you don't need to configure mutt to access a remote mailbox > > - if you're offline all your mail is still there (as of the last update) > > - access is _very_ fast, because it is local file access > > - if you run a local mail system, you can reply to email even when offline; > it will queue locally on your machine until there is network access. > I find this great for train trips. This also means you don't need mutt to > know SMTP settings; just deliver locally via the "sendmail" command. > > The advantage of offlineimap is that (by default) it mirrors your IMAP > account, keeping a local set of mail folders matching upstream. This means: > > - you can still access you imap account (eg through a phone or other device) > > - changes you make locally via mutt, such as deletions of moving messages > or marking them read etc, are pushed upstream to your IMAP account for > you > > Offlineimap _is_ a little tricky to set up, but once running you can let it > look after the mirroring in the background.
Yes offlineimap _is_ very tricky to setup. It cannot handle non-ascii characters correctly. I have several folders on the Gamil server whose name is in Chinese. I setup a `nametrans' in the .offlineimaprc: nametrans = lambda foldername: foldername.decode('imap4-utf-7').encode('utf-8') it works great in the first download, but will throw some encoding/decoding errors in the sync afterwards: 'ascii' codec can't decode byte 0xe9 in position 8: ordinal not in range(128) I don't know why a software would only support ascii in the 21st century... -- Yubin