[or-cvs] r13064: Make from addresses in emails configurable. (in bridgedb/trunk: . lib/bridgedb)

nickm at seul.org nickm at seul.org
Mon Jan 7 20:58:15 UTC 2008


Author: nickm
Date: 2008-01-07 15:58:13 -0500 (Mon, 07 Jan 2008)
New Revision: 13064

Modified:
   bridgedb/trunk/
   bridgedb/trunk/TODO
   bridgedb/trunk/bridgedb.conf
   bridgedb/trunk/lib/bridgedb/Main.py
   bridgedb/trunk/lib/bridgedb/Server.py
Log:
 r17513 at catbus:  nickm | 2008-01-07 15:58:01 -0500
 Make from addresses in emails configurable.



Property changes on: bridgedb/trunk
___________________________________________________________________
 svk:merge ticket from /bridgedb/trunk [r17513] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: bridgedb/trunk/TODO
===================================================================
--- bridgedb/trunk/TODO	2008-01-07 20:58:11 UTC (rev 13063)
+++ bridgedb/trunk/TODO	2008-01-07 20:58:13 UTC (rev 13064)
@@ -1,12 +1,18 @@
 
 Soon:
 o Send back an email even if there are no bridges
-- Check dkim headers for sanity.
+o Check dkim headers for sanity.
 - Make the 'magic word' for the email configurable, case-tolerant,
   html-tolerant, and punctuation-tolerant
 - make all the rest of the email options configurable.
 - bug: the email handler gets really upset when the email doesn't have
   a message-id header in it.
+- When we hit the end of a period, forget email address history.
+- When sending bridges to an email address in the history, check for
+  liveness.
+. Make bounces go to the right address.
+  o Make address sent in "mail from" command configurable.
+  - Actually configure it.
 
 Not now:
 - check that incoming IP of email is sane.

Modified: bridgedb/trunk/bridgedb.conf
===================================================================
--- bridgedb/trunk/bridgedb.conf	2008-01-07 20:58:11 UTC (rev 13063)
+++ bridgedb/trunk/bridgedb.conf	2008-01-07 20:58:13 UTC (rev 13064)
@@ -64,6 +64,13 @@
 # What proportion of bridges do we allocate to Email distribution?  See
 # HTTPS_SHARE and RESERVED_SHARE.
 EMAIL_SHARE=10
+
+# What email addresses to we use for outgoing email?  EMAIL_FROM_ADDR goes
+# in the From: line in outgoing headers, and EMAIL_SMTP_FROM_ADDR goes in
+# the MAIL FROM header in outgoing SMTP.
+EMAIL_FROM_ADDR = "bridges at torproject.org"
+EMAIL_SMTP_FROM_ADDR = "bridges at torproject.org"
+
 # Canonical versions of domains that we will reply to.
 EMAIL_DOMAINS = [ "gmail.com", "yahoo.com" ]
 # Map from unofficial domain to canonical domain.

Modified: bridgedb/trunk/lib/bridgedb/Main.py
===================================================================
--- bridgedb/trunk/lib/bridgedb/Main.py	2008-01-07 20:58:11 UTC (rev 13063)
+++ bridgedb/trunk/lib/bridgedb/Main.py	2008-01-07 20:58:13 UTC (rev 13064)
@@ -55,6 +55,8 @@
 
     EMAIL_DIST = True,
     EMAIL_SHARE=10,
+    EMAIL_FROM_ADDR = "bridges at torproject.org",
+    EMAIL_SMTP_FROM_ADDR = "bridges at torproject.org",
     EMAIL_DOMAINS = [ "gmail.com", "yahoo.com", "catbus.wangafu.net" ],
     EMAIL_DOMAIN_MAP = { "mail.google.com" : "gmail.com",
                          "googlemail.com" : "gmail.com", },

Modified: bridgedb/trunk/lib/bridgedb/Server.py
===================================================================
--- bridgedb/trunk/lib/bridgedb/Server.py	2008-01-07 20:58:11 UTC (rev 13063)
+++ bridgedb/trunk/lib/bridgedb/Server.py	2008-01-07 20:58:13 UTC (rev 13064)
@@ -231,7 +231,7 @@
     response.seek(0)
     d = Deferred()
     factory = twisted.mail.smtp.SMTPSenderFactory(
-        ctx.fromAddr,
+        ctx.smtpFromAddr,
         sendToUser,
         response,
         d)
@@ -249,8 +249,12 @@
         # Use this server for outgoing mail.
         self.smtpServer = "127.0.0.1"
         self.smtpPort = 25
-        # Use this address as the from line for outgoing mail.
-        self.fromAddr = "bridges at torproject.org"
+        # Use this address in the MAIL FROM line for outgoing mail.
+        self.smtpFromAddr = (cfg.EMAIL_SMTP_FROM_ADDR or
+                             "bridges at torproject.org")
+        # Use this address in the "From:" header for outgoing mail.
+        self.fromAddr = (cfg.EMAIL_FROM_ADDR or
+                         "bridges at torproject.org")
         # An EmailBasedDistributor object
         self.distributor = dist
         # An IntervalSchedule object



More information about the tor-commits mailing list