[wellylug] Storing Mail in an SQL database ?

Phillip Hutchings sitharus at sitharus.com
Mon Feb 16 22:51:30 NZDT 2004


On 16/02/2004, at 9:33 PM, Donald Gordon wrote:

> On Mon, 16 Feb 2004 20:12:13 +1300 Nigel Walters 
> <nigel.walters at ihug.co.nz> wrote:
>
>> I want to store my mail in an SQL database AND access that mail via
>> IMAP.
>
> Question: why put it in an SQL database?

Fun :)

Virtual hosting works well with SQL databases - no need for a user to 
be created (though most normal ones allow you to reuse a uid/gid for 
virtual users, and just set a separate 'home' dir).

There are a lot of things you can do quickly with a SQL database that 
you can't do so quickly with a maildir. mboxes have some advantages 
with grep, but other than that I find maildirs to be much faster.

Anyway, since DBMail works best with MySQL (it supports PostgreSQL but 
it doesn't scale too well), the main advantage I can think of is 
setting the message column to be FULLTEXT.

SELECT COUNT(*) WHERE MATCH(message) AGAINST ('enlargen'); should get 
you a large percentage of spam ;)

Other than the quick searching, I can't really think of any reason, I 
use maildirs and have done for about 9 months. Quick and effective.

I think easier way would be to see what you need it for, and if the SQL 
database will be worthwhile. It'll take up more disk space, it's harder 
to see how much a single user is using and it is less manageable (you 
can't easily back up incrementally).

But that's just me ;P

--
Phillip Hutchings
me at sitharus.com
http://www.sitharus.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2371 bytes
Desc: not available
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20040216/aa319902/attachment.bin 


More information about the wellylug mailing list