Created
August 13, 2013 14:51
-
-
Save funzoneq/6221957 to your computer and use it in GitHub Desktop.
tor2web for e-mail, in combination with http://styx.org/ww/2011/12/torfix.txt
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 | |
from smtpd import SMTPServer | |
import smtplib | |
import email | |
class EmlToTorServer(SMTPServer): | |
no = 0 | |
def process_message(self, peer, mailfrom, rcpttos, data): | |
torrcpttos = [] | |
for r in rcpttos: | |
torrcpttos = r.replace("tor2web.org", "onion") | |
msg = email.message_from_string(data) | |
msg['To'] = torrcpttos | |
s = smtplib.SMTP('localhost', 2525) | |
s.sendmail(me, mailfrom, msg.as_string()) | |
s.quit() | |
def run(): | |
foo = EmlToTorServer(('localhost', 25), None) | |
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