en
Jan 2009
Mo Tu We Th Fr Sa Su
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Last Played

» Muse – Hypermusic
» Radiohead – Ripcord
» Ben Kweller – Living Life
» Ayo – How Many Times?
» The Smashing Pumpkins – Soothe
» Archive – Sane
» Archive – Goodbye
» Modest Mouse – Styrofoam Boots / It's All Nice On IceCake – She'll Come Back to Me
» T. Rex – Jeepster

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.

Download

by Philippe Normand on Sat Apr 17 20:50:12 2004 (Viewed: 4210 / 2 comments )
  |   RSS  |   RSS2  |   Atom  |   Source  |   Edit

#.   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))
#.   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

Comments not allowed anymore on this post