Created
September 2, 2014 22:09
-
-
Save muffinresearch/ec326ffd658d26e41222 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python | |
"""A noddy fake smtp server.""" | |
import smtpd | |
import asyncore | |
class FakeSMTPServer(smtpd.SMTPServer): | |
"""A Fake smtp server""" | |
def __init__(*args, **kwargs): | |
print "Running fake smtp server on port 25" | |
smtpd.SMTPServer.__init__(*args, **kwargs) | |
def process_message(*args, **kwargs): | |
pass | |
if __name__ == "__main__": | |
smtp_server = FakeSMTPServer(('localhost', 25), None) | |
try: | |
asyncore.loop() | |
except KeyboardInterrupt: | |
smtp_server.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment