Yes, I've finally gone after the dreaded mail refactoring. twisted.smtp and twisted.pop3 are no more, and in fact the whole SMTP/POP3 support is about 8 lines of that file. Most of the file is about *mail* as a concept. Not that SMTP and POP3 concepts don't show through -- that would be useless abstraction. E.g., domains understand that there's a concept of challenge/response authentication for POP3, and that SMTP first checks for a user's existance and then asks to save a message for the user. I expect domains will grow support for more and more mail concepts -- but that's cool.
The interesting part of bin/mksmtpserver (wrong name) is now:
domain = mail.MaildirDirdbmDomain(rootdir) s = net.Selector() t = mail.VirtualSMTPServer(smtp_portno, s) t.domains['example.com'] = domain t = mail.VirtualPOP3Server(pop_portno, s) t.domains[''] = domain dump(s, open("mail.spl",'wb'))
The interesting part is to note how the *same* domain is used both as SMTP incoming domain and as a place to pull out POP3 from. This really should do wonders for ease of configuration.