Created
August 31, 2018 08:42
-
-
Save tachang/1d1a5f1bde9624725920f7182e3c8e41 to your computer and use it in GitHub Desktop.
SMTP Forwarding Script
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 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(('0.0.0.0', 8512), None) | |
asyncore.loop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment