Sophie

Sophie

distrib > Mageia > 6 > x86_64 > by-pkgid > 09408f3c1571cbb746da49a1d2f22702 > files > 3166

python-twisted-17.5.0-1.mga6.x86_64.rpm

from twisted.application import service

application = service.Application("SMTP Server Tutorial")

from twisted.application import internet
from twisted.internet import protocol

smtpServerFactory = protocol.ServerFactory()

from twisted.mail import smtp
smtpServerFactory.protocol = smtp.ESMTP

smtpServerService = internet.TCPServer(2025, smtpServerFactory)
smtpServerService.setServiceParent(application)