[Mailman-Developers] Mailman 3: Problem with binding REST server to custom address

Barry Warsaw barry at list.org
Mon Feb 3 21:38:34 CET 2014


On Feb 02, 2014, at 04:17 PM, Tim Marx wrote:

>I got Mailman running without errors but I can't change the IP address the
>REST server binds to. I would like to bind the REST server for development to
>the address 0.0.0.0 to access it from outside of the VirtualBox with Port
>Mapping.

0.0.0.0 is a reserved IPv4 address:

http://en.wikipedia.org/wiki/Reserved_IP_addresses#Reserved_IPv4_addresses

so I don't think it's generally useful as an address to bind Mailman's REST
API to, unless VB is doing something special I'm not aware of.  (I'm not a VB
expert.)

>I tried with a custom settings file 'mailman.cfg' in my Mailman working
>directory in which I set the property hostname to 0.0.0.0. Now when I call
>'mailman info' it shows the custom defined hostname in line starting with
>'REST root url' but I can't access the API from outside the virtual machine
>and the command 'netstat -lntpu' displays that the REST server process was
>bound to the address 127.0.0.1 and therefore is of course only accessible
>from localhost.
>
>To eliminate any configuration mistakes of my virtual machine or python I
>wrote a simple python script that starts a server with the wsgi library and I
>had no problems to bind this server to 0.0.0.0.  I appreciate any ideas and
>tips!

Mailman doesn't do anything special here.  Whatever IP address/hostname you
set in mailman.cfg is passed straight through to the wsgiref server:

http://tinyurl.com/knkcdz2

http://docs.python.org/2/library/wsgiref.html#module-wsgiref.simple_server

Scanning the Python 2.7 stdlib, I can't see that wsgiref does anything special
to the address you give it.  It passes it down through several levels, but
ultimately ends up calling socket.bind() on it AFAICT.

What happens if you give it the public host name of your VB instance,
e.g. myhost.mydomain?

Cheers,
-Barry


More information about the Mailman-Developers mailing list