[spambayes-dev] Feature of allow_remote_connections ?

Remi Ricard papaDoc at videotron.ca
Tue Dec 2 18:56:31 EST 2003


Hi,

I was testing something and found a strange behavior

It is looking like the options allow_remote_connections needs two items
separated by a comma.

This won't work
[html_ui]
xxx.xxx.xxx.xxx  N.B xxx.xxx.xxx.xxx is a real IP address
the error is  
Attempted to set [html_ui] allow_remote_connections with invalid value
xxx.xxx.xxx.xxx (<type 'str'>)
Traceback (most recent call last):
  File "/gmc/logiciels/spambayes/scripts/sb_server.py", line 106, in ?
    from spambayes.UserInterface import UserInterfaceServer
  File "/gmc/logiciels/spambayes/spambayes/UserInterface.py", line 46,
in ?
    """

If I use
[html_ui]
localhost,xxx.xxx.xxx.xxx

then the is no error

This is the function is UserInterface.py

  def onIncomingConnection(self, clientSocket):
        """Checks the security settings."""
        remoteIP = clientSocket.getpeername()[0]
        trustedIPs = options["html_ui", "allow_remote_connections"]

        if trustedIPs == "*" or remoteIP ==
clientSocket.getsockname()[0]:
           return True

        trustedIPs = trustedIPs.replace('.', '\.').replace('*',
'([01]?\d\d?|2[04]\d|25[0-5])')
        for trusted in trustedIPs.split(','):
          if re.search("^" + trusted + "$", remoteIP):
             return True

        return False

If I read the python code correctly you need to have a "," in
the trestedIPs string !

-- 
Remi Ricard <papaDoc at videotron.ca>




More information about the spambayes-dev mailing list