On 6/16/07, Timo Sirainen <tss@iki.fi> wrote:
I guess you mean http://dovecot.org/patches/mail-sql.tar.gz?
Yes.
If you're thinking about making it actually usable, it would be nice to store the message body instead as MIME parts (with separated header/body). That would allow identical attachments to be stored only once.
Right now I am just experimenting, so do not know how far I will be able to work on it. But my idea is to have one db per email address. each db will have 3 tables, one table, let me call it header will have
- from address
- subject
- message date
- message size
- flags (replied, new etc)
- attachment_flag (boolean, true if there is an attachment)
Second table will have all other headers as well as the message body. Third table will have attachments as blobs, along with some metadata like content type, file name and so on.
The idea is to optimise for common webmail operations. Again this is just some experiments, if this works out it's great!
raj
All headers could also be stored as rows (with ID<->header name mapping in its own table so they could be searched quickly), but the headers should probably still be left as their own complete header text block in another table so that the full header can be quickly downloaded.