[Mailman-Users] Reverse-Proxy Integration

Richard Barrett r.barrett at openinfo.co.uk
Fri Jul 30 12:09:37 CEST 2004

On 30 Jul 2004, at 09:27, Caylan Van Larson wrote:

> Hello,
> I'm running Debian stable using a backported version of Mailman 
> (2.1.4) on our mail server which runs postfix (2.1.4).
> Since our web server is a separate machine, my plan was to *not* add 
> another web server to the mix.  To meet half-way, I installed apache 
> on the email server, firewalled it so only the (main) web server could 
> access it, and setup a reverse proxy like so (apache)...
>     ProxyPass /mailman http://mailhost.example.com/cgi-bin/mailman
>     ProxyPassReverse /mailman 
> http://mailhost.example.com/cgi-bin/mailman
>     ProxyPass /images/mailman 
> http://mailhost.example.com/images/mailman
>     ProxyPassReverse /images/mailman 
> http://mailhost.example.com/images/mailman
> The basic foundation is working fine, but I have some questions on the 
> following mm_cfg.py options:
> --SNIP
> DEFAULT_URL_PATTERN = 'http://%s/mailman'
> PRIVATE_ARCHIVE_URL = '/mailman/private'
> IMAGE_LOGOS         = '/images/mailman/'
> #-------------------------------------------------------------
> # Default domain for email addresses of newly created MLs
> DEFAULT_EMAIL_HOST = 'aero.und.edu'
> #-------------------------------------------------------------
> # Default host for web interface of newly created MLs
> DEFAULT_URL_HOST   = 'www.aero.und.edu'
> #-------------------------------------------------------------
> # Required when setting any of its arguments.
> add_virtualhost( 'mailhost.aero.und.edu' )
> --SNAP
> The problem I'm running into is mailman is not outputting the web 
> pages with www.aero.und.edu (which is our main web server).  If I 
> change DEFAULT_URL_PATTERN to 'http://www.aero.und.edu' it errors out 
> with:
> 	admin(29528):   File "/var/lib/mailman/Mailman/Utils.py", line 233, 
> in ScriptURL
> 	admin(29528):     web_page_url = mm_cfg.DEFAULT_URL_PATTERN % 
> get_domain()
> 	admin(29528): TypeError: not all arguments converted
> ...I'm assuming that is a parse error.
> What's the correct way to set all links to my web server so it can get 
> served correctly?
> Thanks :D
> Caylan

Given it appears that you really only want people to go to your primary 
web server and have only have that server make requests for Mailman 
related URLs to the web server running on the Mailman host I would:

0. revert the DEFAULT_URL_PATTERN to the default i.e. remove your 
redefinition of it.

1. configure the ServerName directive in the httpd.conf of the web 
server running on the Mailman host to be that of the primary server.

2. remove the add_virtualhost( 'mailhost.aero.und.edu' ) in mm_cfg.py

3. use bin/fix_url to ensure all your existing lists have their 
web_page_url attribute set to the primary web server (see the comments 

My reasoning is that if a non-HTTP/1.1 client sends a request through 
your primary server without a Host: header specifying the primary 
server's FQDN then the Mailman Utils.get_domain() function may default 
to reporting the domain as that of the ServerName of the backend 
server. This may cause problems with, for instance, what gets onto the 
/mailman/listinfo page if the Mailman web server's ServerName is not 
the same as the primary server.

You could also consider enforcing the rule that only the primary web 
server is allowed to make requests to the Mailman web server with some 
rewrite like this to redirect any other client machines to the primary 

     RewriteEngine On
     RewriteCond %{REMOTE_HOST} !^www.aero.und.edu$
     RewriteRule .* http://www.aero.und.edu$1 [R=permanent,L]

Richard Barrett                               http://www.openinfo.co.uk

More information about the Mailman-Users mailing list