Features

  • Avoid aliases forever! Lamson uses friendly regular expressions and FSM-based routing.

  • Lamson uses SQLAlchemy to talk to an RDBMS instead of a bizarre combination of flat-files and hashtables!

  • Get up and running quickly. Lamson can be installed and running in 30 seconds.

Get Started »

The Python SMTP Server

We've all been there, mucking around in the sendmail m4 macros trying one more time to get the damn mailing list to update for the new users. Every time we say, "This sucks, I want to rewrite this stupid thing." Yet, when we're done, we simply crawl back to our caves covered in our sendmail wounds.

Lamson's goal is to put an end to the hell that is "e-mail application development". Rather than stay suck in the 1970s, Lamson adopts modern web application framework design and uses a proven scripting language (Python).

Lamson The Python SMTP Server

Rather than stay stuck in the 1970's, Lamson adopts modern web application framework design and uses a proven scripting language (Python).

def START(message, blog_name=None, address=None, host=None):
    pending_id = confirmation.push(message)
    confirm_address = confirmation.register(message, blog_name, host, pending_id)
    msg = view.respond("confirm.msg", locals())
    relay.deliver(msg)

    return NEW_USER

Instead of hideous aliases files (that you never remember to update) Lamson uses friendly regular expressions and routing decorators that make configuring how email is handled trivial.

@route("(blog_name)@osb\\.(host)")
def START(message, blog_name=None, address=None, host=None):
    ...


@route("(blog_name)-confirm-(id_number)@osb\\.(host)", id_number="[a-z0-9]+")
def NEW_USER(message, blog_name=None, id_number=None, host=None):
    ...


@route("(blog_name)@osb\\.(host)")
@route("(blog_name)-(action)@osb\\.(host)", action="[a-z]+")
def POSTING(message, blog_name=None, host=None, action=None):
    ...


@route("(blog_name)@osb\\.(host)")
@stateless
def INDEXER(message, blog_name=None, host=None):
    ...

Rather than bizarre flat file "databases" and hashtable stores, Lamson uses a real Object-Relation Mapping system (SQLAlchemy) to talk to an RDBMS, but also lets you use any database system you can get a library for. It makes no assumptions about what you use, it just makes SQLAlchemy easier.

table = Table(table_name, metadata, 
        Column('id', Integer, primary_key=True),
        Column('recipient', String(50), nullable=False),
        Column('sender', String(50), nullable=False),
        Column('state', String(50), nullable=False, default="START"),
        Column('fsm', String(50), nullable=False),
        Column("last_modified", DateTime,
            default=datetime.datetime.now,
            onupdate=datetime.datetime.now,
            nullable=False)
)
mapper(FSMState, table)

Everything about Lamson is modern, rejecting any part of the gargantuan e-mail standards that doesn't make sense in today's world of giant attachments to MS Exchange(TM) servers through spam blockers trying their best to defend the world.

The 30 Second Introduction

If you have Python and easy_install already, then try this out:
$ easy_install lamson
$ lamson gen -project mymailserver
$ cd mymailserver
$ lamson start
$ lamson log
$ nosetests
$ lamson help -for send
$ lamson send -sender me@mydomain.com -to test@test.com \
        -subject "My test." -body "Hi there." -port 8823
$ less logs/lamson.log
$ mutt -F muttrc
$ lamson stop -ALL run

You now have a working base Lamson setup ready for you to work on with everything you need installed.

Next Steps

Grab the code and you can read through the quick start documentation. After you've gone through that, best thing to do is read the code to the examples/osb example included in the source distribution and read the rest of the documentation on this site.

At any point, you can get help for all available Lamson commands with:

$ lamson help

You can get individual command help with:

$ lamson help -for send

Finally, if you really want to get started using Lamson to implement your dream email application, but are completely lost, then you can contact me for help.