2010-11-12 python mail smtp twisted
sudo aptitude install python-twisted
wget http://twistedmatrix.com/documents/current/mail/examples/emailserver.tac
...
a = service.Application("Console SMTP Server")
internet.TCPServer(25, ConsoleSMTPFactory()).setServiceParent(a)
...
sudo twistd -ny emailserver.tac
...
def validateTo(self, user):
# Only messages directed to the "console" user are accepted.
if user.dest.local == "console":
return lambda: ConsoleMessage()
raise smtp.SMTPBadRcpt(user)
...