[ mailman-Patches-912448 ] Config setting to force relative URLs

SourceForge.net noreply at sourceforge.net
Wed Mar 10 00:38:29 EST 2004

Patches item #912448, was opened at 2004-03-08 18:57
Message generated for change (Comment added) made by multitalents
You can respond by visiting: 

Category: None
Group: Mailman 2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Steve Kostecke (kostecke)
Assigned to: Nobody/Anonymous (nobody)
Summary: Config setting to force relative URLs

Initial Comment:
Mailman 2.1.1 uses absolute URLs for all references to
mailing lists. This behavior may be useful when one
Mailman installation runs lists on multiple virtual
hosts. However, this behavior reduces the flexibility
of Mailman by making it impossible to use Mailman in
configurations where you need to be able to use
different hostnames to refer to the same lists (e.g.
where HTTP and HTTPS use different virtual hosts).

This patch modifies the ScriptURL function in
./Mailman/Utils.py to allow relative URLs to be forced
by setting a mm_cfg configuration variable:
RELATIVE_URLS. This patch also modifies Defaults.py to
provide the default value for RELATIVE_URLS.

--- Utils.py.orig       Tue Mar  9 02:45:20 2004
+++ Utils.py    Tue Mar  9 02:10:51 2004
@@ -238,7 +238,7 @@
         fullpath = os.environ.get(&#039;SCRIPT_NAME&#039;, &#039;&#039;) +                     os.environ.get(&#039;PATH_INFO&#039;, &#039;&#039;)
     baseurl = urlparse.urlparse(web_page_url)[2]
-    if not absolute and fullpath.endswith(baseurl):
+    if mm_cfg.RELATIVE_URLS or not absolute and
         # Use relative addressing
         fullpath = fullpath[len(baseurl):]
         i = fullpath.find(&#039;?&#039;)

--- Defaults.py.orig    Tue Mar  9 02:44:44 2004
+++ Defaults.py Tue Mar  9 02:15:13 2004
@@ -782,6 +782,9 @@
 # list&#039;s config variable default_member_moderation.
+# Set this to 1 to enable relative URLs.

 # List defaults.  NOTE: Changing these values does NOT
change the


Comment By: Multitalents (multitalents)
Date: 2004-03-09 21:38

Logged In: YES 

Your patch seems to be fine for the web interface but it
breaks the URLs in e-mail notifications. Relative URLs
are worthless in e-mails. Any ideas on how to fix this?


You can respond by visiting: 

More information about the Mailman-coders mailing list