Sunday, 5 of February of 2012

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.


Panasonic CF-51 Toughbook: No sound or hotkeys.

If you ever find yourself in front of a Panasonic CF-51 toughbook running Windows XP, you may encounter the following situation.

You installed all the latest updates from the Panasonic website, but neither the sound nor the hot-keys work.

If you check the hardware-manager, you may find an unknown device left over, which upon closer examination, seems to have something to do with the ACPI. I believe it was called “ACPI \ MAT0019″. It is in fact the Panasonic hot-key device for which the driver wasn’t installed correctly and which you have to install manually.

Before you go and install the driver for the hot-keys, be sure to check that you have installed the other two parts of the hot-key situation. The correct order seems to be to install the hot-key app first, then the hot-key settings application and finally the driver.

You can find the driver and other applications on the Panasonic website or alternatively you may want to look here. To install proceed with the manual installation, you go to the hardware manager (System settings->System (select the hardware tab), then click on the hardware manager button). Select the unknown device, click on “Update Driver”, select the manual installation route and then select the folder to which you downloaded the driver. The installation should complete successfully and upon restart, the hot-keys as well as the sound should work. This presumes that not only did you installed the sound driver correctly beforehand but, if I remember correctly, the hot-key driver installation outlined above is the third step in installing the hot-key device. First you have to install the hotkey-app, then the hot-key settings and finally the driver as outlined above.


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.


INKredible also credible.

When I was looking for new ink cartridges last night, I found the website INKredible.co.uk and they had a really good price against a very promising looking set of replacement cartridges. Unfortunately, when I got to the checkout stage, my SSL-Blacklist Extension in Firefox warned me about a connection based on md5 which is not deemed secure any more. I dropped them a ticket explaining the situation and within less than 24 hours they had re-issued their certificate and notified me of the changes. Since I had been unwilling tto spend more money on a similar product somewhere else, I promptly went and bought the set of cartridges I had had in mind before. I love good customer service, I am sure we all do, and so I thought I put this little praise out there. Maybe it will help other people make a more informed decision, who knows.


Installing the Canon PIXMA iP4500 printer on 64bit Linux – openSUSE 10.3

Ok, so this wasn’t too hard, but there was a little hiccup and so I thought I’d briefly note down the solution.

The first step is to find the actual driver because the iP4500 model not listed in the standard set of drivers (at least not in mine). Choosing one of the other PIXMA drivers (like the 4100) will only result in blanc pages.

1) Find the drivers on the Canon website (google search for it. I would post the link but the page is currently not working for me, it did so a minute ago though).
There are two files, one is a common driver (file name: cnijfilter-common-2.80-1.i386.rpm) and the other one is the model specific driver (file name: cnijfilter-ip4500series-2.80-1.i386.rpm). They need to be installed in order, so I suggest you also download the instructions, a file called: guideip4500series-pd-2.80-1.tar.tar
The instructions are very clear and come in flavours for Fedora 7, openSUSE 10.3 and Ubuntu 7.04 (all the same file).

2) After the installation I tried to print but without success. Looking at the printer properties (Control Center – Printer – <printer name> (right click) -> Properties) I found the error message /usr/lib64/cups/backend/cnij_usb failed. I did a google search, and the solution is the following (as found on Linuxuser LigLog).

Open a terminal and as root, type the following two commands:

ln /usr/lib/cups/backend/cnij_usb /usr/lib64/cups/backend/cnij_usb
ln /usr/lib/cups/filter/pstocanonij /usr/lib64/cups/filter/pstocanonij

Restart CUPS ( /etc/init.d/cups restart) and it should work.