Classifying messages in the DB by status