Moved code for new message notifications to the mail module