'Change the message from existing uid to new_uid
This will not update the statusfolder UID, you need to do that yourself.
:param new_uid: (optional) If given, the old UID will be changed
to a new UID. The Maildir backend can implement this as
an efficient rename.'

def change_message_uid(self, uid, new_uid):

    if (not (uid in self.messagelist)):
        raise OfflineImapError(('Cannot    change    unknown    Maildir    UID    %s' % uid), OfflineImapError.ERROR.MESSAGE)
    if (uid == new_uid):
        return
    oldfilename = self.messagelist[uid]['filename']
    (dir_prefix, filename) = os.path.split(oldfilename)
    flags = self.getmessageflags(uid)
    newfilename = os.path.join(dir_prefix, self.new_message_filename(new_uid, flags))
    os.rename(os.path.join(self.getfullname(), oldfilename), os.path.join(self.getfullname(), newfilename))
    self.messagelist[new_uid] = self.messagelist[uid]
    self.messagelist[new_uid]['filename'] = newfilename
    del self.messagelist[uid]
