Re: HUGE list of folders
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Hey David,
Thanks for the response. I tried this and unfortunately it did not work.
I think it is first building the list of all the mailboxes, and then
trying to filter them out. It is this that takes most of the time. I
have pasted debug IMAP code below. I get a line like this for every
file, and there are way too many of those.
Is there some way to skip this list creation entirely?
// DEBUG OUTPUT
DEBUG[imap]: 16:32.76 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' =>
('LIST', ' (\\NoInferiors \\Marked) "/"
nl-home/packages/carmel-3.0/shared/ilinenostream.hpp', '(\\NoInferiors
\\Marked) "/" nl-home/packages/carmel-3.0/shared/ilinenostream.hpp')
// END DEBUG OUTPUT
On Wed, 24 Sep 2008 00:53:16 -0700, David L. Emerson wrote:
> 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
> >
> >
> >
>
>
>
--
Regards,
Ajeet
|
|