diff options
| author | bwarsaw | 2002-01-12 04:50:56 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-01-12 04:50:56 +0000 |
| commit | 8ecef2c99e94398c8c7172c5dba2426403cab555 (patch) | |
| tree | 620628de5de680a022a3dc579e68af511c1166f6 | |
| parent | de77e8158509a0dfa14dcef0ad0601af79f0e04b (diff) | |
| download | mailman-8ecef2c99e94398c8c7172c5dba2426403cab555.tar.gz mailman-8ecef2c99e94398c8c7172c5dba2426403cab555.tar.zst mailman-8ecef2c99e94398c8c7172c5dba2426403cab555.zip | |
| -rw-r--r-- | Mailman/Defaults.py.in | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index dd227ab76..956c070d9 100644 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -91,8 +91,17 @@ VIRTUAL_HOSTS = {} VIRTUAL_HOST_OVERVIEW = 1 -# Helper function; use this in your mm_cfg.py files -def add_virtualhost(urlhost, emailhost): +# Helper function; use this in your mm_cfg.py files. If optional emailhost is +# omitted it defaults to urlhost with the first name stripped off, e.g. +# +# add_virtualhost('www.dom.ain') +# VIRTUAL_HOST['www.dom.ain'] +# ==> 'dom.ain' +# +def add_virtualhost(urlhost, emailhost=None): + DOT = '.' + if emailhost is None: + emailhost = DOT.join(urlhost.split(DOT)[1:]) VIRTUAL_HOSTS[urlhost.lower()] = emailhost.lower() # And set the default |
