Help with synchronsiation configuration

Sebastian Spaeth Sebastian at SSpaeth.de
Tue Mar 1 15:17:03 GMT 2011


On Tue, 01 Mar 2011 14:33:40 +0100, HeX <dietmarw at gmx.de> wrote:
> 1. It seems that the "reference = " option is identical to the folder
> filter set to the same value.
> 
> e.g.,
> reference = FOO
> folderfilter = lambda foldername: foldername in  ['FOO']

No, that is not the case. The "reference" value is prepended to the
folder name in order to access a folder. So if you access folder 'INBOX'
and have a reference setting 'Mail', it will try to access Mail/INBOX on
that repository.

Reading the archives, it seems that UW-IMAP was using the users home
directory as Mail Root by default, so a LIST command on an UW-IMAP
server would give back ALL folders in the users home directory. So the
reference option is there to prefix the "reference" value to the path
and only look/sync the Mail directory.

The filter on the other hand decides which folders to skip when syncing,
it does no translation.

So in your above example, you will access all folders below FOO (FOO/*)
while the folderfilter will skip all folders unless they equal
"FOO". Also the resulting folder names will be different, I believe:

With reference = FOO a mail in 

/FOO/INBOX will have the folderpath 'INBOX' and with

folderfilter = lambda foldername: foldername.startswith('FOO')

it would be FOO/INBOX.

I hope this makes it a bit clearer.

> 2. folderfilter and reference are global options which will be taken
> into account on *all* imap servers configured.

No, they are valid for a certain repository, ie server or maildir,you
can have a different setting for each.

> 3. I couldn't find a way to wildcard subfolders when using folderfilter

> could I get to work. So I wonder how can I include a whole set of
> subfolders of a parent folder? To be included.


This is just a python expression, so you can use whatever python
offers. The standard offlineimap.conf offers the following example:

# Example 3: Using a regular expression to exclude Trash and all folders
# containing the characters "Del".
# folderfilter = lambda foldername: not re.search('(^Trash$|Del)',
# foldername)

Similar to include all subfolders of both INBOX/* and FOO/*,
you could use:

folderfilter = lambda folder: folder.startswith(['INBOX','FOO'])

(you need python 2.5 for this syntax)

or just FOO/*:

folderfilter = lambda folder: folder.startswith('FOO')

(This works even on python 2.4)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110301/4b5d06cc/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list