Writing a mail extension that can delete messages

I am wondering if there is a way to add an ME message action that can delete a message. I see that it is possible to move messages to various folders but I want to write an extension that can delete messages if they meet certain criteria.