Skip to content

Instantly share code, notes, and snippets.

@vongrippen
Created October 9, 2012 14:44
Show Gist options
  • Save vongrippen/3859266 to your computer and use it in GitHub Desktop.
Save vongrippen/3859266 to your computer and use it in GitHub Desktop.
Slow SMTP Proxy
from datetime import datetime
import asyncore
from smtpd import SMTPServer
import time
class EmlServer(SMTPServer):
def process_message(self, peer, mailfrom, rcpttos, data):
time.sleep(6)
pass
def run():
foo = EmlServer(('0.0.0.0', 29), ('localhost', 25))
try:
asyncore.loop()
except KeyboardInterrupt:
pass
if __name__ == '__main__':
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment