Skip to content

Instantly share code, notes, and snippets.

@myles
Created January 13, 2010 20:33
Show Gist options
  • Save myles/276555 to your computer and use it in GitHub Desktop.
Save myles/276555 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import smtpd, asyncore, logging
class SMTPDebuggingServer(smtpd.SMTPServer):
def process_message(self, peer, mailfrom, rcpttos, data):
# print "Sending mail to %s" % (','.join(rcpttos))
log.info("Sending mail to %s\n\n%s" % (','.join(rcpttos), data))
if __name__ == "__main__":
log.info("Starting SMTP server")
server = SMTPDebuggingServer((0.0.0.0, 25), None)
asyncore.loop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment