[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Homemade email system using LuaSocket and LuaPOP3
- From: Tim Channon <tc@...>
- Date: Wed, 28 Sep 2011 02:36:04 +0100
Not mad, bad, as in why not.
A suggestion which has a sound basis even if it is not obvious why.
If you intend to store the emails on disk consider storing in sqlite, in
other words a database and single disk file.
The downside revolves around speed issues, such as search. Whether this
actually matters is an opinion and on circumstances.
There are almost no email clients or servers which store in database, an
exception perhaps is Outlook Express (dbx) and a 'nix server the name of
which escapes me, specific feature.
A major why is about hammering general purpose computer resources, not good.
Choice is usually either: store in a zillion individual files in the
general purpose disk filing system, try a million messages; use some
kind of single file where it is necessary to update small sections of
the single file.
Both have problems. The former crucifies file systems which are not
designed for extreme numbers of small files, also leading to
considerable allocation inefficiency. The latter, good example is mbox
as used by Thunderbird where file locking problems have been endemic and
corruption is known. (as mature these are fairly rare today)
Any single file system is going to have compaction problems, in the case
of t/b this hits realtime issues.
sqlite is stable and suitably permissively licenced. It uses a single
file. The database files are OS agnostic therefore portable. Downsides
are single task and a need for compaction. Compression can be used but
this is possibly large and with licence issues.
If you do a core, a gui could turn it into a mail client.
I can think of some curiosities. Sqlite can actually be a bundle of
database, is limited in number allowed to be joined as one. Possibility
of database per email account or subject.
The header parsing problem has been mentioned. Too right, is quite a
problem. In reality broken message formats are common, things go wrong
or are that way. This is about mature software which can workaround reality.
On 18/09/2011 21:54, Alex Marinko wrote:
> Hi,
>
> a bizarre idea came to my mind: instead of relying on an email client,
> I would like
> to construct my own email system by assembling together existing code
> (LuaSocket,
...