/head: changeset 86

Added folderincludes capability
This commit is contained in:
jgoerzen 2002-07-09 03:32:35 +01:00
parent a82eb46871
commit c83141656e
4 changed files with 48 additions and 11 deletions

View File

@ -1,6 +1,8 @@
offlineimap (2.0.5) unstable; urgency=low
* Placeholder
* Fixed a folderfilter example. Partially fixes #152079.
* Added folderincludes capability. Partially fixes #152079.
* More fixes for read-only folders.
-- John Goerzen <jgoerzen@complete.org> Fri, 5 Jul 2002 09:21:52 -0500

View File

@ -79,6 +79,15 @@ footer = "\n"
# for each account listed in general/accounts above.
[Test]
########## Basic settings
# Specify local repository. Your IMAP folders will be synchronized
# to maildirs created under this path. OfflineIMAP will create the
# maildirs for you as needed.
localfolders = ~/Test
# Specify the remote hostname.
remotehost = examplehost
@ -118,6 +127,9 @@ remoteuser = username
# preauthtunnel = ssh -q imaphost '/usr/bin/imapd ./Maildir'
#
########## Advanced settings
# Some IMAP servers need a "reference" which often refers to the
# "folder root". This is most commonly needed with UW IMAP, where
# you might need to specify the directory in which your mail is
@ -125,12 +137,6 @@ remoteuser = username
#
# reference = Mail
# Specify local repository. Your IMAP folders will be synchronized
# to maildirs created under this path. OfflineIMAP will create the
# maildirs for you as needed.
localfolders = ~/Test
# You can specify a folder translator. This must be a eval-able
# Python expression that takes a foldername arg and returns the new
# value. I suggest a lambda. This example below will remove "INBOX." from
@ -179,6 +185,27 @@ localfolders = ~/Test
#
# folderfilter = lambda foldername: 0
# You can specify folderincludes to include additional folders.
# It should return a Python list. This might be used to include a
# folder that was excluded by your folderfilter rule, to include a
# folder that your server does not specify with its LIST option, or
# to include a folder that is outside your basic reference. Some examples:
#
# To include debian.user and debian.personal:
#
# folderincludes = ['debian.user', 'debian.personal']
#
# To include your INBOX (UW IMAPd users will find this useful if they
# specify a reference):
#
# folderincludes = ['INBOX']
#
# To specify a long list:
#
# folderincludes = ['box1', 'box2', 'box3', 'box4',
# 'box5', 'box6']
# OfflineIMAP can use multiple connections to the server in order
# to perform multiple synchronization actions simultaneously.
# This may place a higher burden on the server. In most cases,

View File

@ -45,6 +45,7 @@ class IMAPFolder(BaseFolder):
def getuidvalidity(self):
imapobj = self.imapserver.acquireconnection()
try:
try:
x = imapobj.status(self.getfullname(), '(UIDVALIDITY)')[1][0]
except imapobj.readonly:

View File

@ -31,10 +31,13 @@ class IMAPRepository(BaseRepository):
self.folders = None
self.nametrans = lambda foldername: foldername
self.folderfilter = lambda foldername: 1
self.folderincludes = []
if config.has_option(accountname, 'nametrans'):
self.nametrans = eval(config.get(accountname, 'nametrans'))
if config.has_option(accountname, 'folderfilter'):
self.folderfilter = eval(config.get(accountname, 'folderfilter'))
if config.has_option(accountname, 'folderincludes'):
self.folderincludes = eval(config.get(accountname, 'folderincludes'))
def getsep(self):
return self.imapserver.delim
@ -61,7 +64,11 @@ class IMAPRepository(BaseRepository):
foldername = imaputil.dequote(name)
if not self.folderfilter(foldername):
continue
retval.append(folder.IMAP.IMAPFolder(self.imapserver, name,
retval.append(folder.IMAP.IMAPFolder(self.imapserver, foldername,
self.nametrans(foldername),
self.accountname))
for foldername in self.folderincludes:
retval.append(folder.IMAP.IMAPFolder(self.imapserver, foldername,
self.nametrans(foldername),
self.accountname))
retval.sort(lambda x, y: cmp(x.getvisiblename(), y.getvisiblename()))