[tor-commits] [flashproxy/master] Add prototype flashproxy-reg-email.
dcf at torproject.org
dcf at torproject.org
Fri Sep 28 06:11:18 UTC 2012
commit b4558607d3c50d45e129c92677b4e7415293776e
Author: David Fifield <david at bamsoftware.com>
Date: Tue Sep 11 00:19:17 2012 -0700
Add prototype flashproxy-reg-email.
---
flashproxy-reg-email | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/flashproxy-reg-email b/flashproxy-reg-email
new file mode 100755
index 0000000..09cd1ea
--- /dev/null
+++ b/flashproxy-reg-email
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+import re
+import smtplib
+import sys
+
+smtp = smtplib.SMTP("gmail-smtp-in.l.google.com.", 25, "[127.0.0.1]")
+smtp.set_debuglevel(1)
+smtp.starttls()
+
+# Grep the EHLO response for our public IP address.
+smtp.ehlo()
+m = re.search(r'at your service, \[([0-9a-fA-F.:]+)\]', smtp.ehlo_resp)
+if not m:
+ print >> sys.stderr, "Could not determine external IP address."
+ sys.exit(1)
+client_spec = m.group(1)
+
+smtp.sendmail("hoddwee at gmail.com", "hoddwee at gmail.com", """\
+From: hoddwee at gmail.com
+To: hoddwee at gmail.com
+Subject: Flash proxy client registration
+
+client=%s
+""" % client_spec)
+smtp.quit()
+
+print "Registered %s." % client_spec
More information about the tor-commits
mailing list