I am using Mutt 1.5.20 in Mac OS X Terminal. I have a Google mail account whose mail I fetch via IMAP. I also use a Gmail notifier app to notify me of new e-mail messages. My experience with Mutt dates no later than 1 week.
The trouble is this: When my Gmail notifier tells me about a new e-mail, I hit the Terminal to open Mutt. I can read the message and Mutt will mark it as read. However, Google's servers are not told that the message is read until Mutt is closed. Thus, my Gmail notifier continues to show a misleading unread count.
How can I force Mutt to synchronize with IMAP without having to quit every time I finish reading my e-mail? Preferably the sync will occur instantaneously, but a periodic sync would be satisfactory as well.
Best Answer
Manual syncing
Try $:
Automatic syncing?
You can't make
mutt
do that automatically/periodically, by design. The reasoning, as I understand it, is that it might lead to data loss. E.g., when you mark something as deleted, you'd normally be able to undo, and auto-syncing would interfere with that (see Re: Auto sync-mailbox - no way! and Mutt, IMAP and auto'refresh').Mailboxes should be synced in any case when you change folders/mailboxes.
Alternatives
There's a source patch adding a timeout-hook to mutt you could use to periodically call
sync-mailbox
, but it's formutt 1.5.9
and I don't know if it can be applied against the current version.You could also set up OfflineIMAP (or isync). It's designed for synchronizing local mailbox(es) with a central IMAP one. You can then use another notification system (like e.g.
mutt
's built-in one ormail-notification
etc.) to watch your local box for changes.