Page 1 of 1

libraries for handling mail files

Posted: Wed Jul 20, 2005 5:56 am
by brucelina
Hi,

I need some help in file indexing and parsing.

I need to store messages (to and from ) in mail file format and parse them to show up. [I would not be sending actual mails)

Directory structure would be like userid/inbox , userid/sent etc .. ( 1 file per users per folder)

Is there any library which convertis message in mail like format and parse it for reading.

what about indexing this file? how to do indexing of a file ( mail file or text file in any format) so that it would give good performance (while adding, searching), considering the file may have 1000 msgs or so ..

Please let me know if you have any ideas on how to do this, or where i can find out more.

Thank you!
Brucelina

Posted: Wed Jul 20, 2005 12:39 pm
by timvw
imho the best way to do searching/indexing/parsing is by storing the data in a dbms...

what do you mean with mail format? mbox or Maildir?

more details about my reuirement

Posted: Thu Jul 21, 2005 3:32 am
by brucelina
Thanks for the reply.

Let me tell you the reqirement here. I am curretly storing the messages from and to users in database, it is affecting a performance of a page (bcoz of database calls). In future, number of records will increase in number so i am thinking of shifting to flat file database..(currently using MySql)

for that -

1. I will be storing the message in text file in

mail like format -
To: ---[email address]
From: ---
message: ----

just like unix stores mails. (Say mbox)

I guess that is simple and most used format + I can get libraries to parse these file easily... I am worried about indexing.. IF these files are
not indexed, adding or searchign message can be a performance issue again..

so need help in that regards.

how to do indexing on flat files? how to update index etc.. what will happen after deleting record , For each insert n deletion, i will need to
update index .. how feasible that it etc..

Hope that gives you idea. Let me knwo if u have any query regarding that.

Thanks,
Brucelina

Posted: Thu Jul 21, 2005 5:01 am
by Chris Corbyn
You can't do indexing on flat files. There's just plain text files.

mbox is known to be slow and messy and that's why Maildir was brought in.

That said... parsing mbox files should be relatively easy... ;)