I'm thinking about switching to mutt for email. However, I have a few requirements.I'd like to be able to store the email offline.I'd like to have email pushed immediately to my local computer as opposed to periodic polling (e.g. using IMAP IDLE).For offline storage, I could use imapoffline or isync. I understand that the latter is more stable. However, to have email pushed on demand, the only option I've found for isync is mswatch. Unfortunately, this requires a program to be installed on the remote email server, which is not possible. Is there a solution that will allow me to use mutt, with offline email storage and instant email delivery?
How can I use mutt with local storage, IMAP and instant pushing of new email?
email;mutt
Unfortunately, the two possibilities suggested in the other answer were imperfect. offlineimap was fairly buggy at the best of times. For example, there is no way to automatically run a script after new mail arrives. fetchmail doesn't synchronise bidirectionally.Instead, the solution that I ended up using was a combination of imapnotify and isync. I configured imapnotify to run a script when new mail is triggered (via IDLE).This script runs mbsync ${channel}:INBOX depending on which account has mail. Next it runs notmuch new. Finally, it records the number of unread emails to a file as below. The contents of this file is displayed on a panel of my desktop environment.mail_count_file=/home/foo/.cache/new_mail_countnew_count=$(find ~/.mail/*/Inbox/new -type f | wc -l)if [[ $new_count > 0 ]]; then  echo $new_count > $mail_count_fileelse  if [[ -f $mail_count_file ]]; then    rm $mail_count_file  fifi