The Lamson Mail Server
======================

Lamson is a pure Python SMTP server designed to create robust and complex mail
applications in the style of modern web frameworks such as Django. Unlike
traditional SMTP servers like Postfix or Sendmail, Lamson has all the features
of a web application stack (ORM, templates, routing, handlers, state machines,
Python) without needing to configure alias files, run newaliases, or
juggle tons of tiny fragile processes. Lamson also plays well with other web
frameworks and Python libraries.


Status
------

It is currently in the proto-development stages with enough features for an
eager developer to play with, but not recommended for production use at all.


Features
========

Lamson currently supports running as an email server and actually works well as
a SMTP client/server testing system.  If you need to find out what your current
mail server is doing, or if you need to find out why a particular application is
failing on your mail server, you can use Lamson to snoop on the protocol.

As for actual features, it has enough to run, but probably not enough to be a
real application yet:

* Listen on arbitrary ports, and multiple ports at the same time.
* Handle mail for arbitrary hosts and addresses using simple regex routing.
* Process requests including full access to Python's complete MIME email
libraries.
* Routing requests in a standard web application framework style based on
addresses.
* Processing mail messages (requests) in either simple generic handlers, or in
more complex and robust state machines.
* The state in statemachines is stored in your ORM layer without much work.
* Full access to SQLAlchemy for ORM or Mako for templates.
* Ability to craft and send plain text or HTML email including attachments.

Features planned for the 1.0 release:

* Tighter integration with Django's ORM and templating.
* A fully operational sample application for developers to review.
* Documentation for running and using Lamson.

Suggestions for other features are always welcome.


Project Information
===================

Lamson lives on Launchpad at https://launchpad.net/lamson where you can get
the code via:

bzr branch lp:lamson

Bazaar may ask you to login, but it should still give you the source.


Installing
==========

Installing Lamson is a little complicated at the moment, mostly because testing
an SMTP server is difficult due to port 25 requirements.  Follow these
instructions as exactly as you can and report any errors to me:

1. bzr branch lp:lamson
2. cd lamson
3. sudo python setup.py install

At this point you should have lamson installed, but you need some dependencies:

1. sudo easy_install sqlalchemy
2. sudo easy_install mako
3. sudo easy_install vellum
4. sudo easy_install nose

WARNING: Vellum might not work since the project was donated to PIDA.  Contact
me if it does blow up.

Now that you have the requirements installed, you can try running the tests and
sample application:

1. lamson log
  a. This runs a lamson server that acts as a debug/logging server only.  It's
  running on port 8825.
2. cat logs/lamson.out logs/lamson.err
  a. You should see no errors in the above.
3. vellum
  a. You can also run nosetests if vellum is broke.

You now have lamson installed and operational.  You can try to send some email
to the debug server:

  lamson send zedshaw@zedshaw.com test@lamson.com 'Hello!' localhost 8825

This will send a test message, and dump the protocol as it works.  If you need
to test out an email server, this is very handy.  To see what the debug server
received, look in logs/lamson.out and logs/lamson.err for catastrophic errors.


Testing
=======

Need to rewrite this.

Development
===========

Lamson is currently very small, so read through the code and tell me any ideas
you have.  When working on the project, keep the following things in mind:

1. Keep things small.  If you even think about Greenlets, Twisted, factory
patterns, XML, or Java then you are doing it wrong.
2. Write as much testing as you can, especially if you add a feature.
3. Follow the Python style guidelines withou being stupid about it.

Other than that, feel free to branch and notify me about changes you've
got.

Enjoy.
