Created
December 4, 2015 20:26
-
-
Save jacobcase/e8a1363147d2252095d5 to your computer and use it in GitHub Desktop.
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 MailServer(smtpd.SMTPServer): | |
def process_message(self, peer, mailfrom, rcpttos, data): | |
print("----------message recieved-----------") | |
print("peer: {}".format(peer)) | |
print("mailfrom: {}".format(mailfrom)) | |
print("rcpttos: {}".format(rcpttos)) | |
print("length of data: {}".format(len(data))) | |
server = MailServer(("localhost", 2525), None) | |
try: | |
asyncore.loop() | |
except KeyboardInterrupt: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment