[or-cvs] r21133: {projects} Set the From: address to the address the user used in his re (in projects/gettor: . lib/gettor)

kaner at seul.org kaner at seul.org
Tue Dec 8 22:51:31 UTC 2009


Author: kaner
Date: 2009-12-08 17:51:31 -0500 (Tue, 08 Dec 2009)
New Revision: 21133

Modified:
   projects/gettor/GetTor.py
   projects/gettor/lib/gettor/requests.py
Log:
Set the From: address to the address the user used in his request


Modified: projects/gettor/GetTor.py
===================================================================
--- projects/gettor/GetTor.py	2009-12-08 21:12:21 UTC (rev 21132)
+++ projects/gettor/GetTor.py	2009-12-08 22:51:31 UTC (rev 21133)
@@ -23,7 +23,7 @@
 
 log = gettor.gtlog.getLogger()
 
-def processFail(conf, rawMessage, sendTo, e):
+def processFail(conf, rawMessage, sendFr, sendTo, e):
     """This routine gets called when something went wrong with the processing"""
     if e is not None:
         log.error("Here is the exception I saw: %s" % sys.exc_info()[0])
@@ -32,7 +32,7 @@
     log.info("We'll keep a record of this mail.")
     gettor.utils.dumpMessage(conf, rawMessage)
     # Send out notification to user, if possible
-    if not gettor.responses.sendNotification(conf, sendTo):
+    if not gettor.responses.sendNotification(conf, sendFr, sendTo):
         log.error("Also failed to send the user a proper notification. :-/")
     else:
         log.info("Failure notification sent to user %s" % sendTo)
@@ -53,19 +53,20 @@
     try:
         request = gettor.requests.requestMail(conf)
         rawMessage = request.getRawMessage()
-        replyTo, lang, pack, split, sig, cmdAddr = request.parseMail()
+        sendFr, replyTo, lang, pack, split, sig, cmdAddr = request.parseMail()
         log.info("Request from %s package %s, lang %s, split %s, cmdaddr %s" \
                     % (replyTo, pack, lang, split, cmdAddr))
         log.info("Signature is %s" % sig)
+        log.info("Mail was sent to %s" % sendFr)
     except Exception, e:
         log.error("Parsing the request failed.")
-        processFail(conf, rawMessage, replyTo, e)
+        processFail(conf, rawMessage, sendFr, replyTo, e)
         return False
 
     # Ok, information aquired. Initiate reply sequence
     try:
-        reply = gettor.responses.Response(conf, replyTo, lang, pack, split, \
-                                            sig, cmdAddr)
+        reply = gettor.responses.Response(conf, sendFr, replyTo, lang, pack, \
+					  split, sig, cmdAddr)
         if not reply.sendReply():
             log.error("Sending reply failed.")
             processFail(conf, rawMessage, replyTo, None)
@@ -73,7 +74,7 @@
         return True
     except Exception, e:
         log.error("Sending the reply failed.")
-        processFail(conf, rawMessage, replyTo, e)
+        processFail(conf, rawMessage, sendFr, replyTo, e)
         return False
 
 def processOptions(options, conf):

Modified: projects/gettor/lib/gettor/requests.py
===================================================================
--- projects/gettor/lib/gettor/requests.py	2009-12-08 21:12:21 UTC (rev 21132)
+++ projects/gettor/lib/gettor/requests.py	2009-12-08 22:51:31 UTC (rev 21133)
@@ -99,13 +99,14 @@
             # Check if this is a command
             self.matchCommand(line)
 
-	# XXX HACK
-	self.torSpecialPackageExpansion()
+        # XXX HACK
+        self.torSpecialPackageExpansion()
     
         if self.returnPackage is None:
             log.info("User didn't select any packages")
 
-        return (self.replytoAddress, self.replyLocale, self.returnPackage, \
+        return (self.toAddress, self.replytoAddress, self.replyLocale, \
+                self.returnPackage, \
                 self.splitDelivery, self.signature, self.commandaddress)
 
     def findOutLang(self):



More information about the tor-commits mailing list