Monday, 21 of May of 2012

Category » openSUSE

mutt + notmuch : searching multiple mailboxes in mutt

This post explains the installation of the email indexing programme notmuch and its integration with the mutt email programme under openSuSE 11.4.

I have recently changed the way I use email. Previously, I had my email auto-sorted into folders, which meant that I had unread emails scattered over several folders and often neglected to read emails in categories that I felt were not immediately important.
In order to change that, I emptied my INBOX, which contained hundreds of unsorted messages, and moved them all into folders. It is now my resolution to work through my email once it comes in, and then move it into an appropriate folder. This way I should keep a nice and empty INBOX and I know that anything which is still in there, has yet to be addressed.

However, mutt does not allow you to search in more than one mailbox at a time. Now, if I need to look up a certain email, I would have to run the same search in all my folders. This is unacceptable. To address the issue, I looked into indexers that work with mutt. After reading zack’s post from 2009 on mairix, maildir-utils and nmzmail, and his newer post on notmuch, I decided to go with notmuch.

Notmuch is not currently in any of the openSuSE repositories, so you will have to grab it from the web. I simply google searched for “notmuch rpm” and found the latest version (notmuch-0.5-4.fc15.i686.rpm) on http://rpm.pbone.net

The following dependencies have to be satisfied:

  • libgmime-2.6
  • libtalloc (version > 2.0.2)

libgmime

This requirement may be fulfilled by installing the gmime-2.5.1-4.fc15.i686.rpm (this is a fedore package from http://rpm.pbone.net)

libtalloc

libtalloc may be found in the openSuSE online package search. I used the
libtalloc-2.0.5-8.fc15.i686.rpm package from http://rpm.pbone.net. Make sure that the installed version of libtalloc is 2.0.2 or higher.

other

The following packages aren’t required at the time of the installation, but if you later get an error when you first try to use notmuch from mutt, then it may be because you are missing the following packages:

  • perl
  • perl-MailTools
  • perl-Email-Sender
  • perl-Mail-Box

You will also need libxapian and sqlite3, but those dependencies may be resolved automatically when you install notmuch.

setup and indexing

Now that notmuch has been successfully installed, you need to run the configuration and then the indexing. In order to run the setup, open a terminal and enter “notmuch setup”, then press enter. This will take you through a short setup procedure which should be self-explanatory.

Once the setup is complete, it asks you to start the indexing by executing “notmuch new” in the terminal. Depending on how much mail you have, this may take some time. Future indexing is done incremental and will only take a very short time.

notmuch integration with mutt

As explained in Zack’s post, you should download the mutt-notmuch script and save it to a location of your choice. Then make it executable by the user (chmod u+x ./mutt-notmuch). Now you only need to include a macro in your mutt configuration file. The instructions are here.

notmuch integration with offlineimap

You could use a cron job to repeatedly run the “notmuch new” command, but I personally prefer to use the posthook command in the offlineimap configuration file. This way, every time I gab new mail, the indexer runs automatically. Since I grab mail from several imap servers, I set the number of simultaneous connections to 1 in the offlineimaprc config file (maxconnections = 1), this way offlineimap works through the accounts one after the next and I simply set the postsynchook in the last account i.e.
[Account last-account]
postsynchook = notmuch new

Alternatively you could write a short bash script, first calling offlineimap and then notmuch new

Now, if all went well, you should be able to call a search from within mutt simply by pressing the F8 key. It works wonderfully for me.


openSUSE 11.2 linux on Intel Core i3 with Intel HD Graphics

I bought I new PC system, based on a motherboard with the H57 chipset and the intel core i3 530 CPU. After a faultless installation of openSUSE 11.2, I had some initial problems getting the integrated Intel HD graphics to work. A kernel update to linux kernel-2.6.34-35 using the latest openSUSE 11.3 Milestone7 DVD, solved the problem for me. Read on for a few more details.

The System

The components for my new PC arrived last week and I finally got a chance to put it all together last night. The system components were chosen with low-energy consumption and silent operation in mind.  The specs are as follows:

  • ASUS P7H57D-V EVO motherboard
  • Intel Core i3 530 2.93GHz Socket 1156
  • Zalman CNPS10x Flex CPU cooler (intended to operating without fans)
  • 2x Crucial 1GB DDR3
  • OCZ 400W Stealth XStream PSU (140mm Fan for silent operation)
  • Seagate Barracuda LP ST3500412AS 500GB HD SATA2 5900 rpm 16MB Cache

Evidently, I did not really see the low-energy idea through to the end. If I had, I would have traded the ATX motherboard for one of the mini-ITX LG1156 motherboards from ZOTAC.

Installing openSUSE 11.2

The installation from an openSUSE 11.2 DVD completed without problems. It was only on the first boot-up, that the problem with the integrated Intel HD Graphics became apparent. The system attempted to start the X server, but just flashed the screen a few times and then reverted to a console login.

The solution

openSUSE 11.2 (kernel-2.6.34-25)

openSUSE 11.2 (kernel-2.6.34-25) on intel core i3

Reading some more information on the internet revealed that the problem could most likely be solved by a kernel upgrade and/or that of the xf86-video-intel graphics driver. The trouble is, that the most current kernel for openSUSE 11.2 is still the kernel-2.6.31 release.

So in short, the solution was to download last nights build of the very latest and greatest openSUSE 11.3 Milestone7 DVD using wget from the console. I then started YAST in the graphical console mode and added the openSUSE 11.3-Milestone7-DVD iso-file as a repository. After this, the new kernel-2.6.34.35 shows up in the normal YAST Software Management tool, and can be installed like any other package. A reboot of the system presented me with the lovely green login-screen of an openSUSE 11.2 installation. The graphics now work, wobbly windows, animations, cube-switcher and all. The current kernel is 2.6.34-35-default.

Notice, that I haven’t yet upgraded the xf86-video-intel driver. I am going to do that next , just for fun.