Skip to content

Instantly share code, notes, and snippets.

@jacobcase
Created December 4, 2015 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobcase/e8a1363147d2252095d5 to your computer and use it in GitHub Desktop.
Save jacobcase/e8a1363147d2252095d5 to your computer and use it in GitHub Desktop.
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