'Unlinks a message file from the Maildir.
:param uid: UID of a mail message
:type uid: String
:return: Nothing, or an Exception if UID but no corresponding file
found.'

def deletemessage(self, uid):

    filename = self.messagelist[uid]['filename']
    filepath = os.path.join(self.getfullname(), filename)
    try:
        os.unlink(filepath)
    except OSError:
        newmsglist = self._scanfolder()
        if (uid in newmsglist):
            filename = newmsglist[uid]['filename']
            filepath = os.path.join(self.getfullname(), filename)
            os.unlink(filepath)
    del self.messagelist[uid]
