diff options
| author | bwarsaw | 2001-08-20 15:04:21 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-08-20 15:04:21 +0000 |
| commit | c9690a16f93f7b510657feecd91f40d0c0273602 (patch) | |
| tree | 41e8817edb4a427501c12df28518883e83fd67a1 /Mailman/Defaults.py.in | |
| parent | ffed5a227a194bbfb8bb9dad2b2876b63d6c0541 (diff) | |
| download | mailman-c9690a16f93f7b510657feecd91f40d0c0273602.tar.gz mailman-c9690a16f93f7b510657feecd91f40d0c0273602.tar.zst mailman-c9690a16f93f7b510657feecd91f40d0c0273602.zip | |
Some improvements for virtual host support.
VIRTUAL_HOSTS is a dictionary mapping url base hostnames to email base
hostnames. E.g. "mail.python.org" -> "python.org". When a new list
is created, we attempt to ascertain the web host from the web request.
We use that for web_page_url and then we look it up in VIRTUAL_HOSTS
to find host_name. If not found, we use the same host for
web_page_url and host_name.
DEAFULT_EMAIL_HOST is now the preferred way to specify the default
email host_name. It is set by configure to @FQDN@.
DEFAULT_URL_HOST is now the preferred way to specify the default host
for web_page_url. It is set by configure to @URL@.
DEFAULT_URL_PATTERN is how to convert DEFAULT_URL_HOST to
web_page_url. It must contain a single %s expansion.
For backwards compatibility, DEFAULT_HOST_NAME = DEFAULT_EMAIL_HOST
and DEFAULT_URL = DEFAULT_URL_PATTERN % DEFAULT_URL_HOST.
Also, added another commented out MAILMAN_URL mirror.
Diffstat (limited to 'Mailman/Defaults.py.in')
| -rw-r--r-- | Mailman/Defaults.py.in | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 1c07c8731..f835e41cb 100644 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -45,23 +45,55 @@ def days(d): return d * 60 * 60 * 24 # and image names. IMAGE_LOGOS = '/icons/' -# Don't change MAILMAN_URL, unless you want to point it at the list.org -# mirror. +# Don't change MAILMAN_URL, unless you want to point it at one of the mirrors. MAILMAN_URL = 'http://www.gnu.org/software/mailman/index.html' #MAILMAN_URL = 'http://www.list.org/' +#MAILMAN_URL = 'http://mailman.sf.net/' # Site-specific settings -DEFAULT_HOST_NAME = '@FQDN@' -# DEFAULT_URL must end in a slash! -DEFAULT_URL = 'http://@URL@/mailman/' -PUBLIC_ARCHIVE_URL = '/pipermail' +DEFAULT_EMAIL_HOST = '@FQDN@' +DEFAULT_URL_HOST = '@URL@' +DEFAULT_URL_PATTERN = 'http://%s/mailman/' + +# For backwards compatibility. Note: DEFAULT_URL_PATTERN must end in a slash! +DEFAULT_HOST_NAME = DEFAULT_EMAIL_HOST +DEFAULT_URL = DEFAULT_URL_PATTERN % DEFAULT_URL_HOST +PUBLIC_ARCHIVE_URL = '/pipermail' HOME_PAGE = 'index.html' MAILMAN_SITE_LIST = 'mailman' ##### +# Virtual domains +##### + +# Set up your virtual host mappings here. This is primarily used for the +# thru-the-web list creation, so its effects are currently fairly limited. +# Use add_virtualhost() call to add new mappings. The keys are strings as +# determined by Utils.get_domain(), the values are as appropriate for +# DEFAULT_HOST_NAME. +VIRTUAL_HOSTS = {} + +# When set, the listinfo web page overview of lists on the machine will be +# confined to only those lists whose web_page_url configuration option host is +# included within the URL by which the page is visited - only those "on the +# virtual host". If unset, then all lists are included in the overview. The +# admin page overview always includes all the lists. +VIRTUAL_HOST_OVERVIEW = 1 + + +# Helper function; use this in your mm_cfg.py files +def add_virtualhost(urlhost, emailhost): + VIRTUAL_HOSTS[urlhost.lower()] = emailhost.lower() + +# And set the default +add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) + + + +##### # Web UI defaults ##### @@ -376,13 +408,6 @@ USE_ENVELOPE_SENDER = 0 # FIXME: NOT ALWAYS THE RIGHT THING TO DO FOR COUNTRY CODE TLDS SMART_ADDRESS_MATCH = 1 -# When set, the listinfo web page overview of lists on the machine will be -# confined to only those lists whose web_page_url configuration option host is -# included within the URL by which the page is visited - only those "on the -# virtual host". If unset, then all lists are included in the overview. The -# admin page overview always includes all the lists. -VIRTUAL_HOST_OVERVIEW = 1 - # How many members to display at a time on the admin cgi to unsubscribe them # or change their options? DEFAULT_ADMIN_MEMBER_CHUNKSIZE = 30 |
