From: Zed
Title: Lamson The Python Mail Server
template: input/home_template.html
Content-Type: text/html

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

<pre class="code prettyprint">
@route("(post_name)@(host)")
def START(message, post_name=None, host=None):
    message['X-Post-Name'] = post_name
    confirmation.send(relay, "post", message, "mail/confirm.msg", locals())
    return CONFIRMING
</pre>

<p>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.</p>

<pre class="code prettyprint">
@route("post-confirm-(id_number)@(host)", id_number="[a-z0-9]+")
def CONFIRMING(message, id_number=None, host=None):
    original = confirmation.verify(message, id_number)
    ...


@route("(post_name)@(host)")
@route("(post_name)-(action)@(host)", action="delete")
def POSTING(message, post_name=None, host=None, action=None):
    name, address = parseaddr(message['from'])
    ...
</pre>


<p>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.</p>

<pre class="code prettyprint">
table = Table(table_name, metadata, 
        Column('id', Integer, primary_key=True),
        Column('sender', String(50), nullable=False),
        Column('state', String(50), nullable=False, default="START"),
        Column('module', String(50), nullable=False),
        Column("last_modified", DateTime,
            default=datetime.datetime.now,
            onupdate=datetime.datetime.now,
            nullable=False)
)
mapper(FSMState, table)
</pre>

<p>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.</p>


<h2>The 30 Second Introduction</h2>

If you have Python and easy_install already, then try this out:

<pre class="code">
$ 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
</pre>

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

<h2>Next Steps</h2>

<p>Grab <a href="/download.html">the code</a> and you can read through the 
<a href="/docs/getting_started.html">quick start</a> documentation.  After you've gone through
that, best thing to do is read the code to the examples/osb example included in
the <a href="/releases/">source distribution</a> and read the rest of the
<a href="/docs">documentation</a> on this site.</p>

<p>At any point, you can get help for all available Lamson commands with:</p>

<pre class="code">
$ lamson help
</pre>

<p>You can get individual command help with:</p>

<pre class="code">
$ lamson help -for start
</pre>

<p>Finally, if you really want to get started using Lamson to implement your dream email
application, but are completely lost, then you can <a href="/contact.html">contact me</a> for help.</p>


