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

[minion-cvs] Patches branch: Make From address support optional, fix...



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

Modified Files:
      Tag: mixminion-v0-0-5-patches
	ClientMain.py ServerInfo.py test.py 
Log Message:
Patches branch: Make From address support optional, fix SMTP bug.

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.112
retrieving revision 1.112.2.1
diff -u -d -r1.112 -r1.112.2.1
--- ClientMain.py	31 Aug 2003 19:29:29 -0000	1.112
+++ ClientMain.py	12 Sep 2003 15:35:47 -0000	1.112.2.1
@@ -2303,11 +2303,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.54.2.1
diff -u -d -r1.54 -r1.54.2.1
--- ServerInfo.py	25 Aug 2003 21:05:34 -0000	1.54
+++ ServerInfo.py	12 Sep 2003 15:35:47 -0000	1.54.2.1
@@ -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.152
retrieving revision 1.152.2.1
diff -u -d -r1.152 -r1.152.2.1
--- test.py	5 Sep 2003 00:46:24 -0000	1.152
+++ test.py	12 Sep 2003 15:35:47 -0000	1.152.2.1
@@ -5131,6 +5131,7 @@
                            "FromTag" : '[NotReally]',
                            'MixCommand' : ('ls', ['-z']),
                            "MaximumSize" : 32*1024,
+                           "AllowFromAddress" : 1,
                            }},
                          manager)
         queue = manager.queues['SMTP_MIX2']
@@ -5349,6 +5350,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',