Config setting to force relative URLs

Bug #558116 reported by kostecke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
Won't Fix
Undecided
Unassigned

Bug Description

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.

<pre>
--- 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('SCRIPT_NAME', '') + \
                    os.environ.get('PATH_INFO', '')
     baseurl = urlparse.urlparse(web_page_url)[2]
- if not absolute and fullpath.endswith(baseurl):
+ if mm_cfg.RELATIVE_URLS or not absolute and
fullpath.endswith(baseurl):
         # Use relative addressing
         fullpath = fullpath[len(baseurl):]
         i = fullpath.find('?')

--- Defaults.py.orig Tue Mar 9 02:44:44 2004
+++ Defaults.py Tue Mar 9 02:15:13 2004
@@ -782,6 +782,9 @@
 # list's config variable default_member_moderation.
 DEFAULT_NEW_MEMBER_OPTIONS = 256

+# Set this to 1 to enable relative URLs.
+RELATIVE_URLS = 0

 #####
 # List defaults. NOTE: Changing these values does NOT
change the
</pre>

Revision history for this message
multitalents (multitalents) wrote :

Logged In: YES
user_id=994460

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?

Revision history for this message
kostecke (kostecke) wrote :

Logged In: YES
user_id=926494

I'm withdrawing this patch until I can fix it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.