On Mon, Dec 20, 2010 at 16:57, shk <[hidden email]> wrote:
> I need advice.
> I'm going to create smtp/pop3 mail server in erlang and i want to ask
> question: What store the best for e-mail messages text( + maybe attachment):
> database, files or something else?
Don't dwell too much on that. Build a fast, easy storage first, but
keep in mind it will be replaced later if it proves to be too
ugly/slow/incorrect. There are other things in your project which are
far more important getting right first. In the long run, you should
spy on what postfix does :)
I'd suggest using MailDir including the method outlined for creating
files and moving them. . I'd then build a database on top of that to
find individual messages. This has the advantages that,
* it's easy to manage individual messages using standard unix shell
* if it crashes you can rebuild the database using the message files
* if you suffer file system corruption it's easier to at least get some
of the messages back.
* You can use existing tools, eg a MUA, to inspect the messages during
If you haven't already take a look at qmail but don't copy it. It has
some nice ideas, but (to my mind) is not easy to work with. Look at
postfix as a good example of how to do things. There are things that it
could do better or doesn't do, and should be easier with Erlang, eg
distributed mail process and mail boxes.
Please keep us informed. I'd like to help if you start to make progress.
Anyway, hope that helps.
On 21/12/10 4:58 AM, Jesper Louis Andersen wrote:
> On Mon, Dec 20, 2010 at 16:57, shk<[hidden email]> wrote:
> Don't dwell too much on that. Build a fast, easy storage first, but
> keep in mind it will be replaced later if it proves to be too
> ugly/slow/incorrect. There are other things in your project which are
> far more important getting right first. In the long run, you should
> spy on what postfix does :)
mnesia is incredibly slow to restart a node if there's a lot of data and you
don't shut the node down correctly, at least in my experience - it's great
for certain types of data but i'd never build an email storage system around