Help with synchronsiation configuration

HeX dietmarw at gmx.de
Tue Mar 1 13:33:40 GMT 2011


Thomas,

again thanks for trying to help. I dived into this a bit more and of
course got some more questions.

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']

At least that is the behaviour I got when playing with it. Am I correct?

2. folderfilter and reference are global options which will be taken
into account on *all* imap servers configured. No matter where the
statement is written right? So having them defined several times (e.g.,
differently for each server) will lead to problems right?

(See also
http://thread.gmane.org/gmane.mail.imap.offlineimap.general/2819 which
hints in that direction)

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

e.g.,
folderfilter = lambda foldername: foldername in  ['FOO/BAR']

works but none of

folderfilter = lambda foldername: foldername in  ['FOO/*']
folderfilter = lambda foldername: foldername in  ['FOO.*']
folderfilter = lambda foldername: foldername in  ['FOO\.*']

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


Sorry for maybe asking too many dumb question. I REALLY would like to
get this to work (and to also understand the setup ;) )

/Dietmar/

Den 25. feb. 2011 22:27, skrev Thomas Kahle:
> On 16:53 Fri 25 Feb     , HeX wrote:
>> Hi again,
>>
>> I tried a bit more and I'm still stuck on RESTRICTING the synch to only
>> one subfolder of the Gmail account.
>>
>> I definetly need something like
>>
>> folderfilter = lambda foldername: foldername in  ['LABEL']
> 
> Is there no way to use placeholders for foldernames?  Maybe the string
> you give there is actually a regexp that gets matched?  I guess you have
> to look at the source code or ask more experienced people to find out.
> 
>> on the Gmail side. The rewrite sugested by Thomas via python function
>> works great but is only useful for the sync NORMAL --> Gmail. I still
>> need to express a way to ONLY get the LABEL subfolder synched
>> (Gmail/LABEL --> NORMAL). A rewrite would not help since it will simply
>> take ALL the subfolders and rewrite them.
>>
>> The opposite way (e.g.,:
>> folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail',
>>                                                      '[Gmail]/Trash']
>> )
>> works fine but would be very cumbersome since I've got loads of labels
>> defined in that Gmail account.
>>
>> Is there perhaps a documentation available that explains all the
>> configuration options (other than the example configuration file) in a
>> bit more detail?
> 
> I don't know of any other resource, except of course the mailing list
> archive.
> 
> Cheers,
> Thomas
> 
> 
>>
>> Thanks again, HeX
>>
>> Den 25. feb. 2011 14:09, skrev HeX:
>>> Thanks Thomas,
>>>
>>> that definetly helped a lot. Still I'm mainly feeling like poking into a
>>> black box with the different configuration settings.
>>>
>>> One thing I'm particular curious about is why does the 'folderfilter'
>>> statement work on both repos when it is defined only in one specific
>>> repo definition. If this is the case should this option not belong into
>>> the [Account xxx] section rather then the [Repository xxx] section. At
>>> least this is more logically to me.
>>>
>>> I just noticed that now that offlineimap is happily running along it is
>>> generating duplicates in one of my accounts. But that's probably a bug
>>> of version 6.2.0.2ubuntu1 (shipped with Ubuntu 10.10).
>>>
>>> /HeX
>>>
>>> PS: The other thing I'm still wondering is why I can't have a Gmail type
>>> defined as "local". Actually the "local" term might not be the best for
>>> synching two IMAPS directly anyway. My first try when setting up was
>>> actually defining two remotes in the accounts section. But that failed.
>>>
>>>
>>>
>>> Den 24. feb. 2011 18:37, skrev Thomas Kahle:
>>>> Hi!
>>>>
>>>> On 15:58 Thu 24 Feb     , HeX wrote:
>>>>> Dear all,
>>>>>
>>>>> I'm really struggling getting offlineimap to work the way I like it. So
>>>>> far I could not really find the right documentation for this so perhaps
>>>>> you can help me.
>>>>>
>>>>> My user case is the following. I like to sync one normal IMAP account
>>>>> with a Gmail account. More accurately everything in the 'normal' account
>>>>> should be synched to the Gmail account under a certain 'LABEL' (i.e.,
>>>>> folder).
>>>>>
>>>>> My configuration looks like this:
>>>>>
>>>>> [general]
>>>>> accounts = Test
>>>>> ui = TTY.TTYUI
>>>>>
>>>>> [Account Test]
>>>>> localrepository = NORMAL
>>>>> remoterepository = Gmail
>>>>>
>>>>> [Repository NORMAL]
>>>>> type = IMAP
>>>>> remotehost = imap.example.org
>>>>> remoteuser = foo
>>>>> remotepass = ****
>>>>> ssl = yes
>>>>>
>>>>> [Repository Gmail]
>>>>> type = Gmail
>>>>> remoteuser = foo
>>>>> remotepass = ****
>>>>> ssl = yes
>>>>> realdelete = no
>>>>> folderfilter = lambda foldername: foldername in  ['LABEL']
>>>>
>>>>
>>>> Your usage of folderfilter is not doing what you intend to do, I think.
>>>> With your setup offlineimap will ignore every folder except a folder
>>>> called "LABEL".  I suppose there is no folder "LABEL" on the "NORMAL"
>>>> account, so offlineimap does nothing.  What you are aiming at is a
>>>> translation of folder names.  This can be done using auxilliary python
>>>> code.
>>>>
>>>> This old mail might be a starting point for further research:
>>>>
>>>> http://article.gmane.org/gmane.mail.imap.offlineimap.general/2414/match=tomka
>>>>
>>>> Hope it helps,
>>>> Thomas
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>> Offlinemap works along but in the end both mail accounts stay the same.
>>>>> I tried already swapping local and remote repository but local does not
>>>>> like 'Gmail' as type (bug?). So I must be missing something obvious and
>>>>> am more than happy of one could point out where I've failed miserably...
>>>>>
>>>>> Thanks,
>>>>> HeX
>>>>>
>>>>> _______________________________________________
>>>>> OfflineIMAP-project mailing list
>>>>> OfflineIMAP-project at lists.alioth.debian.org
>>>>> http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project
>>>>>
>>>>> OfflineIMAP homepage: http://software.complete.org/offlineimap
>>>>
> 




More information about the OfflineIMAP-project mailing list