Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SMTP Forwarding Script
import smtpd
import asyncore
class CustomSMTPServer(smtpd.SMTPServer, object):
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)
super(CustomSMTPServer, self).process_message(peer, mailfrom, rcpttos, data)
server = CustomSMTPServer(('', 8512), None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.