When IMAP lags with big folders
I'm using mutt to read my mail through IMAP4_SSL... But currently it lacks of a cache system, so dealing with big folders (~2000) is quite hard for it.
That's why I hacked an archive utility script to better fit with my needs. The original one is here. The purpose is to move old mails on subtrees of the folder we want to archive, sorted by month.
I mainly added an option relating mail dates comparisons. So now there are two possibilities :
- believe IMAP dates (appearing as timestamps in beginning of mail filenames) (default behavior)
- believe Date: Mail header (-m option)
Use-case :)
$ ./mdirarchive.py -m respyre $ tree ~/Maildir/.respyre* -L 1 /home/phil/Maildir/.respyre |-- courierimapacl |-- courierimapkeywords |-- courierimapuiddb |-- cur |-- new `-- tmp /home/phil/Maildir/.respyre.2003-06 |-- cur |-- new `-- tmp /home/phil/Maildir/.respyre.2003-09 |-- cur |-- new `-- tmp /home/phil/Maildir/.respyre.2003-10 |-- cur |-- new `-- tmp
There is now a subfolder per month. Check script online help for more options.
#. phil on Sun Apr 18 03:18:19 2004
Ask it to the guy who coded the original script. I only added things I needed ..
And I didn't knew http://archivemail.sf.net which have many many (usefull ?) features.. But it could also complete the same kind of job

#. Jkx on Sun Apr 18 02:44:39 2004
You used a Minitel to write your code ? You use a really fancy code style for example :
if doit: if (not isdir(target)): raise "Target '%s' not a directory!" % target rename("%s/cur/%s" % (folder, file), \ '%s/new/%s' % (target, file))