'Create a folder and return a Maildir instance representing it.'

def add_folder(self, folder):

    path = os.path.join(self._path, ('.' + folder))
    result = Maildir(path, factory=self._factory)
    maildirfolder_path = os.path.join(path, 'maildirfolder')
    if (not os.path.exists(maildirfolder_path)):
        os.close(os.open(maildirfolder_path, (os.O_CREAT | os.O_WRONLY), 438))
    return result
