💾 Archived View for republic.circumlunar.space › users › johngodlee › posts › 2019-06-25-mutt-key.gm… captured on 2024-08-31 at 12:56:57. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

-=-=-=-=-=-=-

Fetching mail with offlineimap within Mutt

DATE: 2019-06-25

AUTHOR: John L. Godlee

I wanted to be able to press a key in mutt which would run offlineimap in the background to get new messages, then ask Mutt to put them on screen. This line goes in my .muttrc:

macro index,pager @ "<enter-command>unset wait_key<enter><shell-escape>offlineimap -o -u quiet &<enter><sync-mailbox>" "Run offlineimap"

It defines a macro which can be run in the index or the pager of mutt by pressing the @ key.

First it stops mutt from asking the user to press any key to continue once the shell command is finished.

Next it invokes offlineimap in the background (&). Then afterwards it syncs mutt with its mailboxes (:sync-mailbox).