[Twisted-Python] Mail has been refactored...again ;-)

Moshe Zadka moshez at zadka.site.co.il
Sat May 5 04:12:32 EDT 2001

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.

"I'll be ex-DPL soon anyway so I'm        |LUKE: Is Perl better than Python?
looking for someplace else to grab power."|YODA: No...no... no. Quicker,
   -- Wichert Akkerman (on debian-private)|      easier, more seductive.
For public key, finger moshez at debian.org  |http://www.{python,debian,gnu}.org

More information about the Twisted-Python mailing list