Mutt seems to sync to Gmail IMAP only on quit

6,853

Manual syncing

Try $:

$         sync-mailbox         save changes to mailbox

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 for mutt 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 or mail-notification etc.) to watch your local box for changes.

Share:
6,853

Related videos on Youtube

Sergey
Author by

Sergey

http://www.snevsky.com

Updated on September 18, 2022

Comments

  • Sergey
    Sergey over 1 year

    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.

  • Sergey
    Sergey almost 13 years
    This is good. Shamefully I hadn't noticed this before. However, the question now is: How can mutt be taught to do this periodically?
  • Aaron Massey
    Aaron Massey about 8 years
    Another alternative approach is to simply add <sync-mailbox> to any macros you use frequently, like changing folders or viewing messages or something.