This is the next post about Twisted, this time about Twisted.mail. After my Twisted project is done I'm going to contribute all my findings in some examples, docstrings and maybe even a howto. This post mainly serves as my notebook for things to remember about SMTP in Twisted.
This is a twistd app taken from the Twisted examples section, and modified to support authentication. Below you'll find all my notes.
If you want anything beyond a toy, you'll need to use ESMTP instead of SMTP
You need to have a portal with a realm and a checker set up to use the AUTH command
challengers are what provide the protocol for logging in, note that they are located in twisted.imap4
A portal takes one checker instance per authentication method, so you can have one for handling strange tokens, and one for regular username/password authentication, but not two for the same type.
Take a look at the source for InMemoryUsernamePasswordDatabaseDontUse, it is really simple to write your own checker.