[erlang-questions] Re: gen_smtp question

Andrew Thompson <>
Mon Aug 9 17:42:39 CEST 2010

On Mon, Aug 09, 2010 at 12:02:36PM +0100, Robert Raschke wrote:
> Yeah, the way I understand it, you can use gen_smtp to implement your own
> desired server behaviour. But it doesn't come with a full mail server
> itself, just the text based example one. Saying that, it is pretty easy to
> modify that to suit your needs.
Yeah, that was the plan. I wanted to let people write their own
backends, since that makes it easy to add a SMTP server to whatever you
need (which is why I wrote it in the first place). You just handle the
various SMTP verbs and return a response, and all the icky SMTP is
handled for you.

You can also advertise your own ESMTP extensions (or the standard ones I
didn't implement) and implement them via the handle_other/3 callback,
which gives you the verb, the data and your state. So you could
implement ETRN, HELP, DSN, etc.


More information about the erlang-questions mailing list