':param name: Path & name of folder minus root or reference
:param repository: Repository() in which the folder is.'

def __init__(self, name, repository):

    self.ui = getglobalui()
    self.messagelist = {}
    self.ffilter_name = name
    self.root = None
    self.name = (name if (not (name == self.getsep())) else '')
    self.newmail_hook = None
    if (self.name == 'INBOX'):
        self.newmail_hook = repository.newmail_hook
    self.have_newmail = False
    self.copy_ignoreUIDs = None
    self.repository = repository
    self.visiblename = repository.nametrans(name)
    if (self.visiblename == self.getsep()):
        self.visiblename = ''
    self.repoconfname = ('Repository    ' + repository.name)
    self.config = repository.getconfig()
    filename_use_mail_timestamp_global = self.config.getdefaultboolean('general', 'filename_use_mail_timestamp', False)
    self._filename_use_mail_timestamp = self.config.getdefaultboolean(self.repoconfname, 'filename_use_mail_timestamp', filename_use_mail_timestamp_global)
    self._sync_deletes = self.config.getdefaultboolean(self.repoconfname, 'sync_deletes', True)
    self._dofsync = self.config.getdefaultboolean('general', 'fsync', True)
    self._dynamic_folderfilter = self.config.getdefaultboolean(self.repoconfname, 'dynamic_folderfilter', False)
    self._sync_this = repository.should_sync_folder(self.ffilter_name)
    if self._dynamic_folderfilter:
        self.ui.debug('', ("Running    dynamic    folder    filtering    on    '%s'[%s]" % (self.ffilter_name, repository)))
    elif (not self._sync_this):
        self.ui.debug('', ("Filtering    out    '%s'[%s]    due    to    folderfilter" % (self.ffilter_name, repository)))
    self.syncmessagesto_passes = [self.__syncmessagesto_copy, self.__syncmessagesto_delete, self.__syncmessagesto_flags]
