Post

lei & mutt

In my previous post we have discussed how we can leverage lei tool to grab the emails & patches of interest from lore. In this post lets explore more of lei and also see how we can configure mutt to grab the data that we got from lei.

More options of lei

By default, lei -q will save your search and start keeping track of it. To see your saved searches, run:

1
2
$ lei ls-search
    /home/manojeda/Mail/openbmc

To fetch the newest messages that matches our query:

1
lei up ~/Mail/openbmc

You will notice that the first line of output will say that lei automatically limited the results to only those that arrived since the last time lei was invoked for this particular saved search, so you will most likely get no new messages.

As you add more queries in the future, you can update them all at once using:

1
lei up --all

To delete a saved search, run:

1
lei forget-search ~/Mail/openbmc

This doesn’t delete anything from ~/Mail/openbmc, it just makes it impossible to run lei up to update it.

What’s mutt ?

Mutt is a small but very powerful text-based mail client for Unix operating systems. why mutt ? well let me quote the reason from mutt’s philosophy :

1
All mail clients suck. This one just sucks less.

So the requirement is that, I want to be able to look at what requires my attention, respond if I need to, ignore it if I don’t. Configuring mutt takes a little more time and patience. To that end I wrote up a basic .muttrc that uses the lei setup, and incorporates the settings I care about with comments about what each section does so you can take and leave the parts of it you care about.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Configure mutt to read from the lei maildir inbox
set mbox_type=Maildir
set folder="~/Mail/openbmc"
set mbox="~/Mail/openbmc"
set record="+.Sent"
set postponed="+.Drafts"
set spoolfile="~/Mail/openbmc"

# Sort by threads so I can see wtf is going on
set sort="threads"
set strict_threads="yes"
set sort_browser="reverse-date"
set sort_aux="last-date-received"
set collapse_unread="yes"

# Lets me collapse fucking everything
bind index = collapse-all
bind index - collapse-thread

# Show Message-Id in the window
unignore Message-Id:

# Use msmtp to send email
set sendmail = "/usr/bin/msmtp"
set realname = "Manojkiran Eda"
set from = "manojkiran.eda@gmail.com"
set use_from = "yes"
set envelope_from = "yes"

# Use vim as my editor
set editor = "vim"

# Show the headers in the compose view
set edit_headers = "yes"

A nice, straightforward .muttrc that gets the job done. There might some other things that you might wanna tweak based on your usage, but by-in-large this lets me do the job for now.

now run mutt:

1
mutt

There is separate setup needed to configure the msmtp. In fact the next post would talk more about msmtp and how to configure it to work with gmail to send patches straight from mutt.

This post is licensed under CC BY 4.0 by the author.