Created
July 17, 2012 17:31
-
-
Save Miuler/3130716 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
| import smtpd | |
| import asyncore | |
| class FakeSMTPServer(smtpd.SMTPServer): | |
| __version__ = 'TEST EMAIL SERVER' | |
| 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 | |
| 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