Shannon Roddy <[EMAIL PROTECTED]> writes: > I know I have asked this question before, but I have not been able to > find anything worth while. It seems like someone at some time would > have written a script to take email messages and archive them in a > MySQL or other database. I have WAY too many emails on an imap server > right now. It takes me forever to search for an email when I need to > find something say from a year ago. > > So - Anyone seen any projects out there lately to do precisely this? > Say read in maildir or mbox format and output it to a DB. If no one > knows of anything I may spend some time and write a python script to > do this. I just don't feel like dealing with attachments.
Someone's already done a python script to do something like this. It's called mdirarchive and it's at http://gray.mine.nu/maildirarchive/. I run a cron job that tells archivemail to archive any mails older than 31 days. It creates maildirs with names like .Archivemail.2003-12. It automatically names and creates the directories with proper dates. I also run it over my sent box as well. Just run it every day out of cron: /home/scotth/bin/mdirarchive-0.1.py -a 31 /home/scotth/.maildir/ [EMAIL PROTECTED] scotth $ ls -la .maildir total 19 drwx------ 24 scotth users 816 Mar 4 00:00 . drwx------ 33 scotth users 2176 Mar 8 14:28 .. drwx------ 6 scotth users 192 Nov 4 10:42 .2002 drwx------ 6 scotth users 192 Dec 4 13:07 .Archive.Sent.2003-10 drwx------ 6 scotth users 192 Dec 29 09:37 .Archive.Sent.2003-11 drwx------ 6 scotth users 192 Feb 3 17:38 .Archive.Sent.2003-12 drwx------ 6 scotth users 192 Feb 29 18:14 .Archive.Sent.2004-01 drwx------ 6 scotth users 160 Mar 4 13:56 .Archive.Sent.2004-02 drwx------ 6 scotth users 192 Oct 23 10:19 .ArchiveMail.2003-08 drwx------ 6 scotth users 192 Oct 31 09:05 .ArchiveMail.2003-09 drwx------ 6 scotth users 192 Dec 4 13:07 .ArchiveMail.2003-10 drwx------ 6 scotth users 192 Dec 31 07:58 .ArchiveMail.2003-11 drwx------ 6 scotth users 192 Feb 3 17:37 .ArchiveMail.2003-12 drwx------ 6 scotth users 192 Mar 2 17:30 .ArchiveMail.2004-01 drwx------ 6 scotth users 160 Mar 4 13:56 .ArchiveMail.2004-02 drwx------ 6 scotth users 192 Mar 10 16:31 .Sent drwx------ 6 scotth users 192 Feb 4 11:10 .Tips drwx------ 6 scotth users 224 Nov 7 14:51 .Trash drwx------ 2 scotth users 48 Nov 4 10:42 courierimapkeywords -rw-r--r-- 1 scotth users 16 Aug 1 2003 courierimapuiddb drwx------ 2 scotth users 48 Aug 1 2003 cur drwx------ 2 scotth users 48 Jun 16 2003 new drwx------ 2 scotth users 48 Mar 4 14:05 tmp There's also archivemail at archivemail.sourceforge.net which handles more than maildir. -- Scott Harney<[EMAIL PROTECTED]> "Asking the wrong questions is the leading cause of wrong answers" gpg key fingerprint=7125 0BD3 8EC4 08D7 321D CEE9 F024 7DA6 0BC7 94E5
