added support for starred and important messages