Quantcast

EPmail-0.2 released

classic Classic list List threaded Threaded
8 messages Options
shk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

EPmail-0.2 released

shk
Hello,

Yeasterday i released EPmail-0.2 mail system written in Erlang.

Changes of new version:

* Pop3 server compliant with rfc 1939

* Smtp server, a minimal implementation of rfc 5321

* Pop3 and Smtp servers remake with gen_fsm

* Abilities to work with multiple domain names

* Configuration file now in erlang term

* User data storage is ets, dets or mnesia

Install system:
    > make

Sytem running with runing main supervisor:

    > epmail_sup:start_link().

Links:

EPmail -  https://github.com/onlyshk/epmail

EPmail wiki - https://github.com/onlyshk/epmail/wiki

EPmail bugs - https://github.com/onlyshk/epmail/issues

Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EPmail-0.2 released

Max Lapshin-2
On Fri, Feb 18, 2011 at 9:41 AM, shk <[hidden email]> wrote:

> * User data storage is ets, dets or mnesia

I have 4 GB of mail. It would be more, if google allowed to send 100 MB emails.
I don't see any reason to store user emails in anything except plain files.


> Sytem running with runing main supervisor:
>
>    > epmail_sup:start_link().
>

Change it to application:start(epmail).

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

shk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EPmail-0.2 released

shk
Hello Max,

>I have 4 GB of mail. It would be more, if google allowed to send 100 MB emails.
>I don't see any reason to store user emails in anything except plain files.

User email storing in plain files, in dets storing only Username --
Password data.

>Change it to application:start(epmail)

Yes now i work on it.

Thank you.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EPmail-0.2 released

Max Lapshin-2
On Fri, Feb 18, 2011 at 3:21 PM, Alexander Kuleshov
<[hidden email]> wrote:
> Hello Max,
>
>>I have 4 GB of mail. It would be more, if google allowed to send 100 MB emails.
>>I don't see any reason to store user emails in anything except plain files.
>
> User email storing in plain files, in dets storing only Username --
> Password data.

I STRONGLY advise you to hide mnesia/dets in module.
Someone will require to use postgresql user storage, other one will
need /etc/passwd storage.

mnesia is the most badly administrable choice, because there are no
command line tools to look inside mnesia file
and I can hardly imaging clustering abilities for mail server =)

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EPmail-0.2 released

Rickard Cardell
Hello

2011/2/18 Max Lapshin <[hidden email]>

> On Fri, Feb 18, 2011 at 3:21 PM, Alexander Kuleshov
> <[hidden email]> wrote:
> > Hello Max,
> >
> >>I have 4 GB of mail. It would be more, if google allowed to send 100 MB
> emails.
> >>I don't see any reason to store user emails in anything except plain
> files.
>

Quite nice if you have a decent low number of files but as emails can be
somewhat private I personally wouldn't prefer it as easy readable files.



> >
> > User email storing in plain files, in dets storing only Username --
> > Password data.
>
> I STRONGLY advise you to hide mnesia/dets in module.
> Someone will require to use postgresql user storage, other one will
> need /etc/passwd storage.
>

OT:
I would add CouchDB. It would be a quite nice fit since you can store
attachments inline in documents or directly on disk. It would also be quite
easy to write a light weight frontend to display the emails for the user.
User authentication, replication are also in-built.


>
> mnesia is the most badly administrable choice, because there are no
> command line tools to look inside mnesia file
> and I can hardly imaging clustering abilities for mail server =)
>


//Rickard

--
Rickard Cardell
------------------------------
Klarna AB
Norra Stationsgatan 61
SE-113 43 Stockholm

Tel: +468- 120 120 00
Dir: +4670- 16 12 644
Fax: +468- 120 120 99
Web: www.klarna.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EPmail-0.2 released

Andre Nathan
In reply to this post by Max Lapshin-2
On Fri, 2011-02-18 at 16:41 +0300, Max Lapshin wrote:
> User email storing in plain files

Dovecot's mdbox format is a nice alternative to plain text storage:

  http://wiki2.dovecot.org/MailboxFormat/dbox

Not sure how well documented the implementation is though.

Andre


________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EPmail-0.2 released

Andrew Thompson-2
In reply to this post by shk
On Thu, Feb 17, 2011 at 10:41:25PM -0800, shk wrote:
> Yeasterday i released EPmail-0.2 mail system written in Erlang.

First of all, congratulations on making so much progress.
>
> Changes of new version:
>
> * Pop3 server compliant with rfc 1939
>
> * Smtp server, a minimal implementation of rfc 5321
>
> * Pop3 and Smtp servers remake with gen_fsm
>
Your FSMs aren't really very complete, since all you have is
'autorization' (which should probably be 'authorization') and
'transaction'. If you're going to use a FSM you should implement
each SMTP/POP verb as a state. So for SMTP, you'd do something like this:

State       Next Available States
Start       EHLO, HELO, QUIT
EHLO        AUTH, STARTTLS, MAIL FROM, QUIT
MAIL FROM   MAIL FROM, RCPT TO, QUIT, RSET
RCPT TO     RCPT TO, DATA, RSET, QUIT

and so on. Obviously you can't go from EHLO to RCPT TO, or MAIL FROM to
DATA, so those should be disallowed. You should capture this in the
representation of the FSM, not in a bunch of try/catches.

In gen_smtp I don't use a FSM (maybe I should have) to represent the
state of a connection, I do it manually via pattern matching on the
state (do we have a from address in the envelope when we get a RCPT TO,
etc).

Also, implementing the SMTP client for relaying on to a smarthost inline
like that is kinda... ugly. Your handling of the message body also looks
like its not ideal, especially if the message is large. You can't be
sure that gen_tcp:recv(State#state.socket, 0) is going to give you
everything you need, you need to check for /r/n./r/n at the end.

I'd also suggest writing a lot of unit tests to make sure the code
behaves as you expect.

Finally, if you're interested, I'd like to invite you to use gen_smtp
for your SMTP stack. That way you don't have to *write* a SMTP stack and
I get another user for mine to yell at me for bugs or other issues; we
both win. Although, if you're writing this just as a learning
experience, then I can understand the desire to reimplement the wheel
(although, having written a whole SMTP/MIME stack, I would call it one
of the more painful wheels to reinvent).

Andrew

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

shk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EPmail-0.2 released

shk
Hello,

First of all thank you Andrew for your advices.

>Your FSMs aren't really very complete, since all you have is
>'autorization' (which should probably be 'authorization') and
>'transaction'. If you're going to use a FSM you should implement...

Yes, now i think about beter FSM implementation.

>Also, implementing the SMTP client for relaying on to a smarthost inline
>like that is kinda... ugly. Your handling of the message body also looks
>like its not ideal, especially if the message is large. You can't be
>sure that gen_tcp:recv(State#state.socket, 0) is going to give you
>everything you need, you need to check for /r/n./r/n at the end.

Yes, i know about it. This is the weakest point. This piece of code is
my top priority in the fixing.

>I'd also suggest writing a lot of unit tests to make sure the code
>behaves as you expect.
Yes i write tests, only they aren't in github.

>Finally, if you're interested, I'd like to invite you to use gen_smtp
>for your SMTP stack. That way you don't have to *write* a SMTP stack and
>I get another user for mine to yell at me for bugs or other issues; we
>both win. Although, if you're writing this just as a learning
>experience, then I can understand the desire to reimplement the wheel
>(although, having written a whole SMTP/MIME stack, I would call it one
>of the more painful wheels to reinvent).

Thank you very much for your offer. You say right: i do it for my
expirience, i want to deep learn Erlang and functional programming.

Thank you.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Loading...