[spambayes-dev] Feature of allow_remote_connections ?

Tony Meyer tameyer at ihug.co.nz
Wed Dec 3 21:37:57 EST 2003

> 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'>)

I tried this:

And it worked fine here.  "allow_remote_connections:," didn't, but that's because of the space after the comma, I
think ("allow_remote_connections:," works).

That said, the 'correct' way for that option to be set up would really be to
expect a tuple and have the regex only allow *one* of the possibilities to
match.  The options code would then take care of single/multiple values.
It's a pretty simple fix, I think, but I'm a bit wary of checking it in
since I don't use this, and didn't write it.  Any volunteers?  (I'll produce
the code).

> This is the function is UserInterface.py
>         for trusted in trustedIPs.split(','):
> If I read the python code correctly you need to have a "," in
> the trestedIPs string !

Doing split(',') should return a single item (the whole string) if there
aren't any commas at all, so this should work.  That said, if the options
code was taking care of the multiple values as it should be, then the split
wouldn't be necessary at all (and they could be separated by spaces, or
whatever, like the other options).

This doesn't explain why you had troubles, though.  Maybe the regex failed
for some other reason?  It's certainly very complicated looking (I presume
it checks the IP is valid).  For our purposes "((?:\d{1,3}\.){3}\d{1,3})"
would probably do.  If you're comfortable mucking about with regexs you
could take the IP_LIST one out of OptionsClass.py and see why it failed the
IP you gave it (I like using Kodos for this sort of thing).


=Tony Meyer

More information about the spambayes-dev mailing list