Created
March 1, 2013 20:58
-
-
Save mattieb/5067736 to your computer and use it in GitHub Desktop.
Spawns a little SMTP server that will redirect all mail relayed through it to you.
This file contains 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 asyncore | |
import smtpd | |
MY_ADDRESS = '[email protected]' | |
class RedirectingProxy(smtpd.PureProxy): | |
def _deliver(self, mailfrom, rcpttos, data): | |
smtpd.PureProxy._deliver(self, mailfrom, [MY_ADDRESS], data) | |
if __name__ == '__main__': | |
proxy = RedirectingProxy(('localhost', 2525), ('localhost', 25)) | |
asyncore.loop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment