Created
December 8, 2017 23:58
-
-
Save ljesparis/1b27dde01902614b70de6d5c0642ff60 to your computer and use it in GitHub Desktop.
medium smtp server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 :', len(data) | |
return | |
server = CustomSMTPServer(('127.0.0.1', 1025), None) | |
asyncore.loop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment