GNOME Bugzilla – Bug 158105
Index maildirs
Last modified: 2005-06-30 17:05:57 UTC
Index mboxes and maildirs.
Filter out "joe milestone spam" to ignore these. Moving milestones from versions to target milestones, and adding in actual versions
mbox is done. we don't do maildirs. how do you set up a maildir?
JP, how do you make evo do maildir?
No, I know how to make it do maildir, I need to know how to actually CREATE a maildir. Mine on imap.ximian.com is waaaay too big to download locally, and I don't understand all the "cur" and "new" directories.
maildirs are kept outside the .evolution universe, so this will take a good amount of reworking things like crawling, and it's rare enough that I am punting it until M2.
The Util/Mozilla.cs parser is Maildir compatible. I have created a MailDirDriver that indexs the /MailDir folder I have on my computer using the Mozilla class (MessageReader and Message object). I am not sure about a few things found there, like Uri (Maildir doesn't have Uri, I have used Message-Id instead)... Should I post the files here?
Yes you should. Unfortunatly, the Mozilla.cs is probably the worst code ever produced. Maybe we should get something that's allready done and tested into Beagle for this, and so that we actually could get the Thunderbird backend working. Something like SharpMimeTools perhaps? (http://anmar.eu.org/projects/sharpwebmail/)
Created attachment 46480 [details] Beagle Patch to support MailDir
Hi, After some work, and help from #dashboard people, got it working... should work against CVS. Note the FIXME things, the work isn't complete, but its a good starting point... BTW, it will only index the /Mail/ directory not the DImap directory or Imap directory... Once this has been introduced to the tree, I will continue work... I will be also happy to receive comments on the way the code has been writen (beagle wise, has it been structured correctly).
Created attachment 46481 [details] [review] Unified patch
Created attachment 46495 [details] Filter for Maildir files Hi, If the following Filter is used, any text/x-mail or message/rfc822 will be parsed according to the content of it and not as a regular file.
The following patch will make the CVS version index MailDir directories: Index: Util/Makefile.am =================================================================== RCS file: /cvs/gnome/beagle/Util/Makefile.am,v retrieving revision 1.53 diff -r1.53 Makefile.am 66a67 < $(srcdir)/Rfc822DateTime.cs \ Index: Makefile.am =================================================================== RCS file: /cvs/gnome/beagle/beagled/Makefile.am,v retrieving revision 1.108 diff -r1.108 Makefile.am 246a247,252 < maildirqueryable = $(srcdir)/MailDirDriver < MAIL_DIR_QUERYABLE_CSFILES = \ < $(maildirqueryable)/MailDirDriver.cs \ < $(maildirqueryable)/MailDirIndexableGenerator.cs \ < $(maildirqueryable)/MailDirCrawler.cs < 275a282 < $(MAIL_DIR_QUERYABLE_CSFILES) \ See MailDir.tar.gz for additional files incessary
Created attachment 46892 [details] MailDir.tar.gz
Sorry it took me a while to look into this. I think the filter approach you took originally is the right one. The nice thing about maildir is that it's one file per message, so we can easily piggyback on the file system backend for doing things like actually crawling, creating indexables, etc. It would dramatically simplify things. The only catch is if you are trying to load maildirs from locations which aren't normally crawled (like a dot directory). The filter you posted is using the Mozilla parsing code, which Fredrik says is pretty uniformly bad. We're already requiring gmime to parse mboxes, so we might as well use it for maildir files as well.
How would you solve the hidden directory problem of MailDir? I have no problem converting my MailDir crawler (not the filter) to support Gmime, but I am not going to do work which won't be used (if the Beagle project is going to take a different approach to indexing MailDirs). P.S I am currently using the crawler, and the filter simply doesn't cut it, as it doesn't crawl into hidden directories.
I'd solve the hidden directory problem probably by creating a very simple backend that crawls the hidden directory. Look at the gaim backend to get an idea of how that might work. It might be possible to integrate that into the file system backend at some point in the future, but we can worry about that later. The bulk of the work needs to be done in the filter, that's the only appropriate place to parse the data. (And you get the added side benefit of maildirs outside the hidden directory)
Hi, have you looked into my Filter for Maildir files? (attached below) Is it work in the right direction?
The filter I'd like to see ported to GMime.
Hi, I will start working on porting it to GMime, but please "promise" that you will at least commit it, once it is ready to the CVS, as I hate doing work for nothing.
I've checked in an implementation of this.