Chip’s Technical Blog

Tech commentary of thoughts, challenges, how-to’s, and the mundane.
Note: to see my personal journal, formerly on this page, visit my personal page.

Archive for the ‘How-to’ Category

Mutt error message: “Message XXX UID YYY less than ZZZ”

Wednesday, August 22nd, 2007

If you are constantly getting this error message in Mutt (seemingly every time Mutt checks for new messages, or you change folders), then I may have a solution for you. You see, when I tried to lookup this message, I found two things:

  • Pages saying the message was harmless and to be ignored
  • Pages giving a technical explanation of the error message (which also tend to fall in the first category too)

Two pages in particular are this one from the Pine users group, and this one from the IMAP FAQs which give technical explanations. Basically, the UID’s must be increasing in a mailbox, and someone detected a dis-order. Typically, clients take the opportunity to re-order the UIDs to correct the problem.

But in my Mutt instance, this persisted restarting the client, moving messages, and more. I could not get the message to go away. After understanding the technical side, I went to find the problem. But I couldn’t find it. It did not occur in the mailboxes themselves.

Finally, I realized it had to do with the header cache. I deleted the header cache, and now I don’t have the error message anymore.

Good Luck!

Migrating to a new hard drive

Wednesday, July 18th, 2007

My laptop hard drive started showing symptoms of potential failure, so I made the decision to migrate to a new hard drive. However, since much of the windows software comes pre-installed and without a good installation disk, I needed to do so without having to re-install software.

Additionally, my laptop does not have an internal CD/DVD drive, and won’t boot off an external one unless you get the (extra-priced) one blessed by the manufacturer. Furthermore, it’s a laptop, and does not have extra IDE slots to simply plug in the new drive to do a drive copy. And finally, I did not initially have a cable to enable me to plug in a drive as an external USB device. The second time I did this I used that cable, and it did simplify things a bit.

Next I’ll describe a few pre-requisites and assumptions, then give a summary of the solution. Afterwards I’ll go into details on a few of the steps.

(more…)

Restoring email from cache

Sunday, July 15th, 2007

As some of you know, about a month and a half ago my server hard-drive crashed, and I lost all my data on the drive, most of which was un-backed-up.
One of the more important things I lost was my email archive. This included all email in the last two years, since I stopped using gmail. (I was using imap to keep the email synchronized across all my mail clients on different computers). The silver lining of this was that I was able to recover some fraction of my email (mainly from my inbox) by using the cache my email client maintains to make re-reading emails more efficient.

This post should serve as a simple how-to. It’s actually quite simple if you had my setup. So — using Mutt as my mail client, I have a great deal of control over the way its configured. One of the configuration items was to use a message cache:

set message_cachedir = "~/.mutt/imapcache"

This meant that as I read emails, they were downloaded to the computer I was reading them from, and saved in a file under my home directory, in the .mutt/imapcache directory. It was using a separate folder to store email from each remote mail folder. So, to restore them, all I needed to do once I had my new mail server up-and-running was:

  1. concatenate all the emails into a single file (cat * > ~/tempfolder)
  2. open the new “folder” from within mutt (<change-folder> ~/tempfolder)
  3. tag all the messages and save them to the appropriate folder on the remove server

The real trick is that each message is being stored in a standard format. Then, concatenating them together creates a mailbox format called mbox, making it easy to access them all at once. Then the mutt mail client can use imap to store them back on the remote server.

In my case, I was able to repeat this from each computer I use to read mail — there were about 3 of them. I was able to recover about half of my inbox, and a few other assorted messages which had been read recently. Not as good as having backups, but better than nothing!

Chip’s Technical Blog is proudly powered by WordPress
Entries (RSS) and Comments (RSS).