当有人与这个拨号服务器连接时,我谨发表我自己的信息。
import smtpd
import asyncore
class FakeSMTPServer(smtpd.SMTPServer):
__version__ = TEST EMAIL SERVER
def process_message(self, peer, mailfrom, rcpttos, data):
print Receiving message from: , peer
print Message addressed from: , mailfrom
print Message addressed to : , rcpttos
print Message length : , len(data)
return
if __name__ == "__main__":
smtp_server = FakeSMTPServer(( localhost , 25), None)
try:
asyncore.loop()
except KeyboardInterrupt:
smtp_server.close()
然而,我仍在作出回应:
220 Win7-PC Python SMTP proxy version 0.2
我怎么会凌驾于欢迎词,看看“TEST EMAIL SERVER”?