CST秋季赛做题的收获
- 如何搭建一个简单的邮件服务器收邮件
用到python自带的smtpd库
import smtpd
import asyncore
class CustomSMTPServer(smtpd.SMTPServer):
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 :', data
return
server = CustomSMTPServer(('0.0.0.0', 25), None)
asyncore.loop()
然后绑定好域名就好了