summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2006-11-12 03:14:00 +0000
committerbwarsaw2006-11-12 03:14:00 +0000
commit425a8297a9987800f62cf61d47a916d026028864 (patch)
treee49673d9a941a9c7fa80677a5bcdcefe9fea2a39
parent28690731c0e6b13d60629223a7a9dbccc442f8ee (diff)
downloadmailman-425a8297a9987800f62cf61d47a916d026028864.tar.gz
mailman-425a8297a9987800f62cf61d47a916d026028864.tar.zst
mailman-425a8297a9987800f62cf61d47a916d026028864.zip
We need to substitute the fully qualified list name in the public archive url.
Do this and switch PUBLIC_ARCHIVE_URL to use $-substitution strings instead of %-substitution strings (no backward compatibility is provided). Minor style nits.
-rw-r--r--Mailman/Archiver/Archiver.py10
-rw-r--r--Mailman/Cgi/edithtml.py6
-rw-r--r--Mailman/Cgi/wsgi_app.py5
-rw-r--r--Mailman/Defaults.py.in10
-rw-r--r--NEWS.txt31
5 files changed, 35 insertions, 27 deletions
diff --git a/Mailman/Archiver/Archiver.py b/Mailman/Archiver/Archiver.py
index 96d6c46dc..838ee13c6 100644
--- a/Mailman/Archiver/Archiver.py
+++ b/Mailman/Archiver/Archiver.py
@@ -29,6 +29,7 @@ import logging
import traceback
from cStringIO import StringIO
+from string import Template
from Mailman import Mailbox
from Mailman import Utils
@@ -139,10 +140,11 @@ class Archiver:
url = self.GetScriptURL('private') + '/index.html'
else:
web_host = config.domains.get(self.host_name, self.host_name)
- url = config.PUBLIC_ARCHIVE_URL % {
- 'listname': self.internal_name(),
- 'hostname': web_host,
- }
+ url = Template(config.PUBLIC_ARCHIVE_URL).safe_substitute(
+ listname=self.internal_name(),
+ hostname=web_host,
+ fqdn_listname=self.fqdn_listname,
+ )
return url
def __archive_file(self, afn):
diff --git a/Mailman/Cgi/edithtml.py b/Mailman/Cgi/edithtml.py
index 7a16c1c28..6083bfdb9 100644
--- a/Mailman/Cgi/edithtml.py
+++ b/Mailman/Cgi/edithtml.py
@@ -23,15 +23,15 @@ import cgi
import errno
import logging
+from Mailman import Defaults
from Mailman import Errors
-from Mailman import i18n
from Mailman import MailList
from Mailman import Utils
-from Mailman import Defaults
+from Mailman import i18n
from Mailman.Cgi import Auth
-from Mailman.htmlformat import *
from Mailman.HTMLFormatter import HTMLFormatter
from Mailman.configuration import config
+from Mailman.htmlformat import *
_ = i18n._
diff --git a/Mailman/Cgi/wsgi_app.py b/Mailman/Cgi/wsgi_app.py
index 402745e3b..8b74fbd84 100644
--- a/Mailman/Cgi/wsgi_app.py
+++ b/Mailman/Cgi/wsgi_app.py
@@ -19,16 +19,16 @@ import os
import re
import sys
-from urlparse import urlparse
from cStringIO import StringIO
from email import message_from_string
+from urlparse import urlparse
from Mailman.configuration import config
# XXX Should this be configurable in Defaults.py?
STEALTH_MODE = False
MOVED_RESPONSE = '302 Found'
-# Above is for debugging convenience. We should use:
+# Above is for debugging convenience. We should use:
# MOVED_RESPONSE = '301 Moved Permanently'
@@ -50,6 +50,7 @@ dotonly = re.compile(r'^\.+$')
SCRIPT_BASE = urlparse(config.DEFAULT_URL_PATTERN)[2]
+
# WSGI to CGI wrapper. Mostly copied from scripts/driver.
def mailman_app(environ, start_response):
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index c50112162..9149110c6 100644
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -200,11 +200,11 @@ WEB_HIGHLIGHT_COLOR = '#dddddd' # If true, alternating rows
# places, including the List-Archive: header, links to the archive on the
# list's listinfo page, and on the list's admin page.
#
-# This should be a string with "%(listname)s" somewhere in it. Mailman will
-# interpolate the name of the list into this. You can also include a
-# "%(hostname)s" in the string, into which Mailman will interpolate
-# the host name (usually DEFAULT_URL_HOST).
-PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/pipermail/%(listname)s'
+# This variable supports several substitution variables
+# - $hostname -- the host on which the archive resides
+# - $listname -- the short name of the list being accessed
+# - $fqdn_listname -- the long name of the list being accessed
+PUBLIC_ARCHIVE_URL = 'http://$hostname/pipermail/$fqdn_listname'
# Are archives on or off by default?
DEFAULT_ARCHIVE = On
diff --git a/NEWS.txt b/NEWS.txt
index e5b8fcb64..f03223731 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -6,6 +6,24 @@ Here is a history of user visible changes to Mailman.
2.2 alpha 1 (XX-XXX-200X)
+ Configuration
+
+ - Mailman can now be configured via a 'mailman.cfg' file which lives in
+ $VAR_PREFIX/etc. This can be used to separate the configuration from
+ the source directory. Alternative configuration files can be specified
+ via -C/--config for most command line scripts. The format of
+ mailman.cfg is identical to that for mm_cfg.py; IOW, they are both
+ Python files. mm_cfg.py is still supported for backward compatibility,
+ but settings in etc/mailman.cfg take precedence. You do not need to
+ import Defaults.py in etc/mailman.cfg. You should still consult
+ Defaults.py for the list of site configuration variables available to
+ you.
+
+ See the etc/mailman.cfg.sample file.
+
+ - PUBLIC_ARCHIVE_URL now takes $-string substitutions instead of %-string
+ substitutions. See documentation in Defaults.py.in for details.
+
Architecture
- Mailman's web interface is now WSGI compliant. WSGI is a Python
@@ -44,19 +62,6 @@ Here is a history of user visible changes to Mailman.
- If you had customizations based on Site.py, you will need to
re-implement them. Site.py has been removed.
- - Mailman can now be configured via a 'mailman.cfg' file which lives in
- $VAR_PREFIX/etc. This can be used to separate the configuration from
- the source directory. Alternative configuration files can be specified
- via -C/--config for most command line scripts. The format of
- mailman.cfg is identical to that for mm_cfg.py; IOW, they are both
- Python files. mm_cfg.py is still supported for backward compatibility,
- but settings in etc/mailman.cfg take precedence. You do not need to
- import Defaults.py in etc/mailman.cfg. You should still consult
- Defaults.py for the list of site configuration variables available to
- you.
-
- See the etc/mailman.cfg.sample file.
-
- The site list is no more. You can remove your 'mailman' site list
unless you want to retain it for other purposes, but it is no longer
used (or required) by Mailman. You should set NO_REPLY_ADDRESS to an