[Dovecot] SQL mail storage

Timo Sirainen tss at iki.fi
Sat Mar 31 17:34:23 EEST 2007


I wasted some time yesterday and today implementing a SQL storage
plugin. It seems to be working, but:

 - Saving new messages is done in a regular INSERT statement, which is
bad. PostgreSQL has at least this COPY TO command which could be used
instead.
 - It breaks in stress testing
 - It's not that well optimized. Especially it could support caching
some commonly requested fields (same as dovecot.index.cache file).
 - Currently works only with PostgreSQL.

Nothing is committed to CVS yet. I'm not sure if I should even do that.
I'm not sure if those lib-sql API changes were that great. Maybe there's
a better way..

If you're interested in trying it, you need the latest CVS HEAD sources
and these patches:

http://dovecot.org/patches/sql-storage-changes.diff
http://dovecot.org/patches/sql-storage-plugin.diff

The SQL schema is in src/plugins/mail-sql/schema.sql file. It creates a
"tss" named user by default, so you might want to modify that. :)

Then set:

mail_location = sql:pgsql:host=localhost dbname=mails user=mailuser
password=foo
mail_plugins = mail_sql

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070331/b4c4973e/attachment.pgp 


More information about the dovecot mailing list