At work, I receive 200 emails on average per day, including all Mercurial activities, EC2 instances activities, tickets from Jira, etc. I do not care much about messages from EC2, and some testing messages from our platform. Worse, they flood my Inbox and buries other important messages when I sort my Inbox by last-date-received. Sorting by scores inside of threads will solve this problem.

Mutt score at a glance. According to Mutt manual 1, we can use these patterns for scoring. But my Mutt (1.5.21) does not recognize some of them, i.e.: ~h, ~b, ~B, etc.

~A all messages
~b EXPR messages which contain EXPR in the message body
~B EXPR messages which contain EXPR in the whole message
~c USER messages carbon-copied to USER
~C EXPR message is either to: or cc: EXPR
~D deleted messages
~d [MIN]-[MAX] messages with ``date-sent'' in a Date range
~E expired messages
~e EXPR message which contains EXPR in the ``Sender'' field
~F flagged messages
~f USER messages originating from USER
~g PGP signed messages
~G PGP encrypted messages
~h EXPR messages which contain EXPR in the message header
~k message contains PGP key material
~i ID message which match ID in the ``Message-ID'' field
~L EXPR message is either originated or received by EXPR
~l message is addressed to a known mailing list
~m [MIN]-[MAX] message in the range MIN to MAX *)
~n [MIN]-[MAX] messages with a score in the range MIN to MAX *)
~N new messages
~O old messages
~p message is addressed to you (consults $alternates)
~P message is from you (consults $alternates)
~Q messages which have been replied to
~R read messages
~r [MIN]-[MAX] messages with ``date-received'' in a Date range
~S superseded messages
~s SUBJECT messages having SUBJECT in the ``Subject'' field.
~T tagged messages
~t USER messages addressed to USER
~U unread messages
~v message is part of a collapsed thread.
~x EXPR messages which contain EXPR in the `References' field
~y EXPR messages which contain EXPR in the `X-Label' field
~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)
~= duplicated messages (see $duplicatethreads)

The interesting ones are ~f, ~C, and ~s. They are pretty straight-forward. One thing needs to mention about ~f is that it only check sender's actual email address, instead of sender's name. For example, if the sender is "hello world <morediff@moreisdifferent.info>", it does not check the "hello world" part, but the "morediff@moreisdifferent.info" part. As the following configuration file shows, you can AND multiple patterns together. score "patternOne patternTwo patternMore" scoreNum means if a message satisfies all the conditions patternOne, patternTwo, and patternMore, then it will be assigned the score scoreNum. You can get a good idea of how to configure it by understanding the following example.

# sorting method
set sort = 'threads'
set sort_aux = 'score'

# score messages
set index_format= "%2N %Z %{%b %d} %-15.15F %s"
unscore *
# addressed to myself
score "~p" 7
score "!(~f trac@domain\.com) ~C name@domain\.com" 7
# replied to
score "~Q" 6
# company group email
score "~C yaname@domain\.com" 6
# ticket assignment
score "~f yaaname@domain\.com" 5
# from me
score "~P" 4
# mercurial push, commit
score "~f mercurial" 3
score "!(~s Informational) !(~s Warning) !(~s Error) !(~s Unknown) ~f dev" 3
score "~f monitoring" 3
# new messages
score "~N" 2
# flagged messages
score "~F" 1

Posted on .
blog comments powered by Disqus