Complete.Org: Mailing Lists: Archives: offlineimap: September 2008:
Re: HUGE list of folders
Home

Re: HUGE list of folders

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: Re: HUGE list of folders
From: "David L. Emerson" <demerson3x@xxxxxxxxxxxxx>
Date: Wed, 24 Sep 2008 00:53:16 -0700

Hi Ajeet,

Wow, that sounds like a pretty lame imap server!

At any rate, it ought to be possible to overcome. I'll paste some 
snippets from my config files:


snippets from ~/.offlineimaprc:

[general]
accounts = david1, etc....
pythonfile = /home/david/.offlineimap/david-scripts.py

[Account david1]
localrepository = local-david1
remoterepository = remote-david1

[Repository remote-david1]
folderfilter = exclude_junk_folders
foldersort = mycmp

# note you can use foldersort to check the important folder(s) first


snippets from /home/david/.offlineimap/david-scripts.py:

junk_re = re.compile('^junk ', re.IGNORECASE)

def exclude_junk_folders (fn):
        return not junk_re.match(fn)

cmpdict = {}
defaulval = 1   # prioritized values start at 0 and go down

def mycmp(x, y):
        if cmpdict=={}: return cmp(x,y)
        if x in cmpdict: xp=cmpdict[x]
        else: xp=1
        if y in cmpdict: yp=cmpdict[y]
        else: yp=1
        if (xp<yp): return -1
        elif (xp>yp): return +1
        return cmp (x,y)

cmpdict['folder_A']=0
cmpdict['folder_B']=-1


Good luck!
~David.


On Tuesday 23 September 2008 10:16 pm, Ajeet wrote:
> Hi guys,
> 
> My imap server unfortunately lists all the files / folders in the home
> directory as an IMAP folder (I have symlinks to all sorts of package 
folders) .
> So while syncing, offlineimap takes a long time just to get the one 
folder that
> I really want to sync. This happens even if I specify the -f option. 
Is there
> someway to overcome this?
> 
> Thanks.
> -- 
> Regards,
> Ajeet
> 
> 
> 




[Prev in Thread] Current Thread [Next in Thread]