Hari's Corner

Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then

How to re-create your Claws Mail contact list and inbox

Filed under: Tutorials and HOWTOs by Hari
Posted on Sat, Jun 22, 2013 at 20:21 IST (last updated: Sat, Jun 22, 2013 @ 20:22 IST)

Recently, for some reason, Claws Mail, which I use as my mail client, suddenly stopped recognizing one of my mail boxes and my contact list was empty. However, a closer investigation showed that the mail was still on the hard disk and so were the contacts. Here's a quick way to recreate your Claws Mail contacts and mail box if they suddenly disappear from the Claws Mail interface for some reason.

Recreating your e-mail contacts list

For some reason your contacts index might be corrupted. In that case, delete the file ~/.claws-mail/addrbook/addrbook--index.xml and restart Claws Mail. Your address book will still be empty, and a new addrbook--index.xml would be created. The file will look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<addressbook>
  <book_list>
  </book_list>
  <vcard_list>
  </vcard_list>
  <jpilot_list>
  </jpilot_list>
  <ldap_list>
  </ldap_list>
</addressbook>

Check for files named addrbook-000001.xml, addrbook-000002.xml etc. in the same folder. If they exist and they contain your existing addresses, add them to the list of books manually to addrbook--index.xml using a text editor. For example:

<?xml version="1.0" encoding="UTF-8" ?>
<addressbook>
  <book_list>
    <book name="Common addresses" file="addrbook-000001.xml" />
    <book name="family" file="addrbook-000003.xml" />
    <book name="friends" file="addrbook-000004.xml" />
    <book name="work" file="addrbook-000005.xml" />
    <book name="business" file="addrbook-000006.xml" />
    <book name="misc" file="addrbook-000008.xml" />
  </book_list>
  <vcard_list>
  </vcard_list>
  <jpilot_list>
  </jpilot_list>
  <ldap_list>
  </ldap_list>
</addressbook>

Now your existing e-mail contacts should show up on Claws Mail Address Book.

Recreating Inboxes from Mail Folder

This one is simple. Fire up Claws Mail and choose File->Add Mailbox->MH. You should get this window.

Claws Mail

Choose the folder name in your Home folder. For example, if you mail is in ~/Mail/mye-mail type Mail/mye-mail. If it is a MH folder, it should re-create the mail folder inside Claws.

Hopefully this will be useful to people who had experienced the same issues.

5 comment(s)

  1. This sort of thing is what makes me happy to be on a unix system. Plain text files and open standards mean you can easily fix it when components mess up.

    ... oh wait, I forgot about Akonadi.

    Comment by DIon Moult (visitor) on Sun, Jun 23, 2013 @ 05:41 IST #
  2. Dion, yes - I prefer simple file formats and configuration files. I also prefer data that I can interchange with other programs easily without losing any information.

    Comment by Hari (blog owner) on Sun, Jun 23, 2013 @ 13:08 IST #
  3. Thanks a lot, this is exactly the kind of help I needed after claws-mail stopped accepting my addressbook. Concise and to the point.

    Comment by TobiasR (visitor) on Tue, Jul 16, 2013 @ 19:12 IST #
  4. Cheers, TobiasR. Glad to be of help.

    Comment by Hari (blog owner) on Tue, Jul 16, 2013 @ 19:28 IST #
  5. Extremely helpful, thanks!

    Comment by Terry Brown (visitor) on Tue, Mar 31, 2015 @ 19:51 IST #

Comments closed

The blog owner has closed further commenting on this entry.