[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Merge changes from 0-0-5-patches branch.



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv22126/lib/mixminion

Modified Files:
	ClientMain.py ServerInfo.py test.py 
Log Message:
Merge changes from 0-0-5-patches branch.

Original commit message:
Modules:
      Fix a bug where socket errors from smtplib would crash the
      server.  (If your smtp server was down, it would take mixminion
      with it.)
 
ClientMain, ServerInfo, test, Modules:
      Make "From" address support optional.
 
      [Rationale: Previously, I'd argued for having only a single
      supported "From" policy, as a measure to prevent linkability
      based on client option preferences.  Adam Back correctly pointed
      out that this is silly.  Consider that _any_ use or non-use of
      From addresses makes messages linkable *in itself*.  In other
      words, Eve can already tell which messages set their from
      addresses; she gains nothing by learning that those messages
      have chosen an exit node with From support to do so.]
 
      Some admins have been hesitant to support "From," even in the
      limited form described in the spec.  I still hope that it will
      eventually prove itself to be relatively harmless, but given the
      low number of Type I/II exits with *any* from support, it does
      make sense to give both options a try (at least) for now.



Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- ClientMain.py	6 Sep 2003 21:49:48 -0000	1.113
+++ ClientMain.py	12 Sep 2003 15:52:46 -0000	1.114
@@ -2170,11 +2170,21 @@
     path1, path2 = parser.getForwardPath()
     address = parser.address
 
-    #XXXX006 remove this ad hoc check.
+    #XXXX006 remove these ad hoc checks
     if not parser.usingSURBList and len(headerStr) > 2:
         sware = path2[-1]['Server'].get('Software', "")
         if sware.startswith("Mixminion 0.0.4") or sware.startswith("Mixminion 0.0.5alpha1"):
             LOG.warn("Exit server %s is running old software that may not support headers correctly.", path2[-1].getNickname())
+    elif not parser.usingSURBList and h_from:
+        sware = path2[-1]['Server'].get('Software', "")
+        if sware != 'Mixminion 0.0.5':
+            bad = 0
+            if address.getRouting()[0] == SMTP_TYPE and not path2[-1]['Delivery/SMTP'].get("Allow-From"):
+                bad = 1
+            elif address.getRouting()[0] == MBOX_TYPE and not path2[-1]['Delivery/MBOX'].get("Allow-From"):
+                bad = 1
+            if bad:
+                LOG.warn("Exit server %s does not support user-supplied From addresses", path2[-1].getNickname())
 
     # Get our surb, if any.
     if parser.usingSURBList and inFile in ('-', None):

Index: ServerInfo.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ServerInfo.py,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- ServerInfo.py	25 Aug 2003 21:05:34 -0000	1.54
+++ ServerInfo.py	12 Sep 2003 15:52:46 -0000	1.55
@@ -87,11 +87,14 @@
                      "Version": ("REQUIRE", None, None),
                      # XXXX006 change to 'REQUIRE'
                      "Maximum-Size": ("ALLOW", C._parseInt, "32"),
+                     # XXXX006 change to 'REQUIRE'
+                     "Allow-From": ("ALLOW", C._parseBoolean, "yes"),
                      },
         "Delivery/SMTP" : {
                      "Version": ("REQUIRE", None, None),
                      # XXXX006 change to 'REQUIRE'
                      "Maximum-Size": ("ALLOW", C._parseInt, "32"),
+                     "Allow-From": ("ALLOW", C._parseBoolean, "yes"),
                      },
         "Delivery/Fragmented" : {
                      "Version": ("REQUIRE", None, None),

Index: test.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/test.py,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- test.py	6 Sep 2003 21:49:48 -0000	1.153
+++ test.py	12 Sep 2003 15:52:46 -0000	1.154
@@ -5132,6 +5132,7 @@
                            "FromTag" : '[NotReally]',
                            'MixCommand' : ('ls', ['-z']),
                            "MaximumSize" : 32*1024,
+                           "AllowFromAddress" : 1,
                            }},
                          manager)
         queue = manager.queues['SMTP_MIX2']
@@ -5350,6 +5351,7 @@
                            "Retry": [0,0,0,3],
                            "SMTPServer" : "foo.bar.baz",
                            "MaximumSize" : 32*1024,
+                           "AllowFromAddress": 1,
                            }}, manager)
         # Check that the address file was read correctly.
         self.assertEquals({'mix-minion': 'mixminion@thishost',