Linux

Getting things done with mutt

David Allen created the <a href="http://www.davidco.com/" target="_blank">GTD (Getting Things Done)</a> work-life management system and it has really become a way of life for many people. So much so, in fact, that numerous programs are available for various operating systems: programs to aid in the categorization of e-mail messages, others for creating specialized "TODO" lists, and more. The GTD methodology can be used in many different areas and has been built upon to include concepts such as "Inbox Zero," lifehacks, and more.

David Allen created the GTD (Getting Things Done) work-life management system and it has really become a way of life for many people. So much so, in fact, that numerous programs are available for various operating systems: programs to aid in the categorization of e-mail messages, others for creating specialized "TODO" lists, and more. The GTD methodology can be used in many different areas and has been built upon to include concepts such as "Inbox Zero," lifehacks, and more.

The general idea of "Inbox Zero" is to keep your e-mail inbox empty and deal with messages as you read them: either reply, delete, or file away in a special mailbox such as "ACTION" (for later action), "RESPOND" (for later responding to messages that may require more time), and "WAITFOR" (for the messages that you can reply to quickly but still require more information before they can be acted on).

One of the most versatile e-mail programs available is the command-line client named mutt. Mutt is extremely powerful, but lacks a little when attempting to implement GTD and the "Inbox Zero" concept. With the aid of a patch that adds support for editing the X-Label header in e-mails (mutt already supports viewing and searching based on the X-Label header), implementing the "Inbox Zero" concept is a few configuration tweaks away. The original patch can be found at http://home.uchicago.edu/~dgc/mutt/ and an updated patch for mutt 1.5.16 can be found at http://linsec.ca/files/e/e3/Mutt-1.5.16-dgc-xlabel.patch.

You will need to download and patch mutt to implement this, but mutt is very easy to build and even easier to patch. Some vendors may already implement this in pre-compiled mutt packages.

Once you have mutt compiled with the X-Label support available, modifying the ~/.muttrc file is required to implement GTD in mutt. Depending on how you have mutt configured, you may need to modify a few files, but the essential configuration items are as follows:

unignore X-Label:  # make sure to display X-Label on each message

color header            red         default '^X-Label:'

bind index  Cl         edit-label
bind pager  Cl         edit-label

mailboxes =ACTION
mailboxes =RESPOND
mailboxes =WAITFOR

macro pager "Ct"    "<save-message>=ACTION" "Save to ACTION mbox"
macro pager "Cr"    "<save-message>=RESPOND" "Save to RESPOND mbox"
macro pager "Cw"    "<save-message>=WAITFOR" "Save to WAITFOR mbox"

set index_format="%4C %Z %{%b %d %H:%M} %-20.20L [%5c] [%?Y?%-10.10y&----------?] %s"
folder-hook .                 'set index_format="%4C %Z %{%b %d %H:%M} %-20.20L
folder-hook Inbox.*           'set index_format="%4C %Z %{%b %d %H:%M} %-20.20L [%5c] [%?Y?%-10.10y&----------?] %s"'
folder-hook ACTION            'set index_format="%4C %Z %{%b %d %H:%M} %-20.20L [%5c] [%?Y?%-10.10y&----------?] %s"'
folder-hook RESPOND           'set index_format="%4C %Z %{%b %d %H:%M} %-20.20L [%5c] [%?Y?%-10.10y&----------?] %s"'
folder-hook WAITFOR           'set index_format="%4C %Z %{%b %d %H:%M} %-20.20L [%5c] [%?Y?%-10.10y&----------?] %s"'

To explain the above configuration directives, the first unignore setting is to ensure that when viewing a message, the X-Label header is shown (if set). The next option makes it red so it stands out.

The next two bind commands create two bindings of CTRL-L on both the pager and index screens as a key command to edit the X-Label header.

The mailboxes' commands define three new mailboxes: ACTION, RESPOND, and WAITFOR.

The macro lines create three new macros to save the current message to the ACTION, RESPOND, and WAITFOR mailboxes by using CTRL-T, CTRL-R, and CTRL-W respectively.

The index_format and folder-hook commands define different views depending on the current mailbox. When in any Inbox folder (Inbox.*) or the ACTION, RESPOND, or WAITFOR mailboxes, the pager will have an extra 12-character field that displays the contents of the X-Label header, if it exists. This allows you to quickly see, without viewing the e-mail itself, what the set X-Label is. Otherwise, in every other mailbox (such as sentmail, mailboxes for mailing lists, etc.) that particular field isn't shown at all. the idea is that the X-Label header will only be used on messages personally directed to you and that you are storing in one of the three defined mailboxes; thus it only needs to be viewed when you in those specific mailboxes.

The GTD and "Inbox Zero" concept are great things, but they take some time and dedication to turn them from concepts into habits. If mutt is your mail application, you don't have to change to something else to enjoy these time-saving concepts. For more information on "Inbox Zero", a series of articles are available at http://www.43folders.com/izero/.

Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

About

Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.

0 comments

Editor's Picks