def __init__(self, imapserver, name, repository, decode=True): # decode the folder name from IMAP4_utf_7 to utf_8 if # - utf8foldernames is enabled for the *account* # - the decode argument is given # (default True is used when the folder name is the result of # querying the IMAP server, while False is used when creating # a folder object from a locally available utf_8 name) # In any case the given name is first dequoted. name = imaputil.dequote(name) if decode and repository.account.utf_8_support: name = imaputil.IMAP_utf8(name) self.sep = imapserver.delim super(IMAPFolder, self).__init__(name, repository) if repository.getdecodefoldernames(): self.visiblename = imaputil.decode_mailbox_name(self.visiblename) self.idle_mode = False self.expunge = repository.getexpunge() self.root = None # imapserver.root self.imapserver = imapserver self.randomgenerator = random.Random() # self.ui is set in BaseFolder. self.imap_query = ['BODY.PEEK[]'] # number of times to retry fetching messages self.retrycount = self.repository.getconfint('retrycount', 2) fh_conf = self.repository.account.getconf('filterheaders', '') self.filterheaders = [h for h in re.split(r'\s*,\s*', fh_conf) if h] # self.copy_ignoreUIDs is used by BaseFolder. self.copy_ignoreUIDs = repository.get_copy_ignore_UIDs( self.getvisiblename()) if self.repository.getidlefolders(): self.idle_mode = True
def __init__(self, imapserver, name, repository, decode=True): # decode the folder name from IMAP4_utf_7 to utf_8 if # - utf8foldernames is enabled for the *account* # - the decode argument is given # (default True is used when the folder name is the result of # querying the IMAP server, while False is used when creating # a folder object from a locally available utf_8 name) # In any case the given name is first dequoted. name = imaputil.dequote(name) if decode and repository.account.utf_8_support: name = imaputil.IMAP_utf8(name) self.sep = imapserver.delim super(IMAPFolder, self).__init__(name, repository) if repository.getdecodefoldernames(): self.visiblename = imaputil.decode_mailbox_name(self.visiblename) self.idle_mode = False self.expunge = repository.getexpunge() self.root = None # imapserver.root self.imapserver = imapserver self.randomgenerator = random.Random() # self.ui is set in BaseFolder. self.imap_query = ['BODY.PEEK[]'] # number of times to retry fetching messages self.retrycount = self.repository.getconfint('retrycount', 2) fh_conf = self.repository.account.getconf('filterheaders', '') self.filterheaders = [h for h in re.split(r'\s*,\s*', fh_conf) if h] # self.copy_ignoreUIDs is used by BaseFolder. self.copy_ignoreUIDs = repository.get_copy_ignore_UIDs( self.getvisiblename()) if self.repository.getidlefolders(): self.idle_mode = True
def getvisiblename(self): vname = super(IMAPFolder, self).getvisiblename() if self.repository.getdecodefoldernames(): return imaputil.decode_mailbox_name(vname) return vname
def getvisiblename(self): vname = super(IMAPFolder, self).getvisiblename() if self.repository.getdecodefoldernames(): return imaputil.decode_mailbox_name(vname) return vname