Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com May 20 '11 at 13:54

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

up vote 10 down vote accepted

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|improve this answer
    
This is good. Shamefully I hadn't noticed this before. However, the question now is: How can mutt be taught to do this periodically? –  Sergey Jun 9 '11 at 4:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.