The title ("SMTP and Sinatra") made me expect something written in Ruby. Also:<p><pre><code> def subscribe(self, route=r'subscribe-(?P<name>[^@]*)@.*'):
</code></pre>
No. No. No. No. No. No. <i>No.</i> Default arguments are <i>not</i> for specifying metadata about your functions. That's what decorators are for. And for the love of Guido, why are you accessing per-request information from instance variables? It seems to me that you would much rather be programming this in Ruby.
The quote from the ubuntu docs is bullshit. Setting up a mail server does require many different programs; an SMTP server, a spam filter, a virus scanner, procmail, an IMAP server, and SMTP server, and so on. But if you just want to play with SMTP, all you need is an SMTP server. And if you just want to play with email, all you need is a program that reads a message from STDIN and writes the result to STDOUT, because you can just run that from procmail.<p>Anyway, yes, a multi-user email service is not trivial to run. But email itself is pretty easy to work with, modulo RFC822, anyway :)
So, I couldn't help but notice that you wrote this:<p><pre><code> $ easy_install smtproutes
</code></pre>
I think there's a couple typos in there. For example, you could have spelled it this way:<p><pre><code> $ pip install smtproutes
</code></pre>
Using pip (<a href="http://pypi.python.org/pypi/pip" rel="nofollow">http://pypi.python.org/pypi/pip</a>) makes you a better ecosystem contributor. Also, I noticed you're internally using asyncore, AKA Medusa. This is a Bad Idea, period; you won't scale and you're using what is essentially dead, horrid code. Consider rewording the statement entirely:<p><pre><code> $ pip install Twisted
$ twistd mail ...
</code></pre>
Now you have a <i>real</i> SMTP/POP3/IMAP server at your disposal.<p>But yeah, I'd so much rather that you not use asyncore. It makes us cry. I'd even let you keep easy_install if you compromise and drop asyncore!