A few days ago my iPhone started reporting a bogus unread SMS message, and there was no way to get rid of it -- I tried to re-read all SMS (tedious task) to no avail. My iPhone (firmware 2.2) is jailbroken, so I was able to solve the problem in this manner. Open a terminal on the iPhone, either directly with the Terminal app or via
ssh from another machine, then enter this command:
$ cd /private/var/mobile/Library/SMS
In this directory you will find the file
sms.db; now perform the following commands:
$ sqlite3 sms.db
$ update msg_group set unread_count = 0;
$ .exit
$ reboot
Your iPhone will reboot and the unread SMS count will now be correct.
Note: it is better if you sign off from your cellular network before you attempt these steps, in case a new SMS arrives while you are editing the database.