Resetting the All Inboxes counter on your Palm Pre

I’ve been digging around on webOS for a little while, learning how it ticks. I get pretty excited about the possibilities of open source mobile development. Although I haven’t created any official apps yet, I’ve learned some pretty cool stuff.

A few weeks after I got my Palm Pre my All Inboxes mailbox counter got out of sync. If I had any unread mail it would show +5 more than what I had. I think this occurred when I removed an account or had a crash or something. I’ve forgotten the details. Anyway, it was bugging the hell out of me. So today I decided to track it down. To my surprise it wasn’t too hard to figure out.

Initially I tried different things; like removing all the email accounts, rebooting the phone, and various other attempts to “trick” the Pre into resetting the unread counter for All Inboxes. And please keep in mind that the simplest way to solve this problem (for most people) will be to reset the Palm Pre to its factory settings. I haven’t tried a reset, but I’m pretty sure it will do the trick. For me though, I knew the unread counter was just a field in a record in a database somewhere on the Pre. And updating that field was a lot more fun than a reset would have been. Below I describe how I fixed the inbox counter.

The process involves rooting your Pre in order to get access to the SQLite database that most of the Pre’s data is stored on. Although rooting is fairly straight forward and this fix is only a few commands on a rooted Pre, I do not encourage anyone to root their phone and risk messing something up. If you don’t know what you are doing and don’t feel comfortable turning your Palm Pre into a paper weight in the spirit of adventure, you might want to stop reading this article.

For everyone else, let the fun begin.

  1. First, like I said, you need to root your Palm Pre.
  2. Next, from the root prompt enter the Pre’s relevant SQLite database with this command:
    [code]sqlite3 /var/luna/data/dbdata/PalmDatabase.db3[/code]
  3. Take a peek at the record that holds the unread message counter for All Inboxes:
    [code]SELECT * FROM com_palm_accounts_ActiveRecordFolder WHERE syncKey=’_All_Inboxes_’;[/code]
    You’ll see something like this:
    [code]|1|5|7|45079976738820|EMAIL|_All_Inboxes_|0|-9999991||All inboxes|0|0|48378511622153|44|4182610||||||0|0|0|0|0|All inboxes||||||||||||||||[/code]

    For those who care, you can see the details of the com_palm_accounts_ActiveRecordFolder table by running:
    [code].schema com_palm_accounts_ActiveRecordFolder[/code]
    That’s how I learned about the syncKey and the unreadCount used below.

  4. Now let’s update the counter:
    [code]UPDATE com_palm_accounts_ActiveRecordFolder SET unreadCount=1 WHERE syncKey=’_All_Inboxes_’;[/code]
    In the above example I set unreadCount=1 because I had one unread mail across all my email accounts. You’ll probably want to change the number to your actual unread count. At this point you should be able to look at your Pre and see that the counter is fixed.
  5. Exit SQLite:

That’s it. I restarted my Pre after doing this, but it probably isn’t necessary.

I hope this proves useful to someone/anyone. If you have any comments or need some help let me know. I’m really enjoying webOS and plan to learn more.

2 Replies to “Resetting the All Inboxes counter on your Palm Pre”

  1. I found a much easier way. Simply mark all of the emails in your inbox as unread using your computer’s mail reader. Now let the Mail card (app) on your WebOS device recount all of the unread emails. Quit the Mail card in WebOS. Then mark all of the emails in your inbox as read and relaunch the WebOS Mail card. My counter reset itself.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.