summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2001-11-30 23:34:22 +0000
committerbwarsaw2001-11-30 23:34:22 +0000
commit2b0e4cbc81a9f58699d21891575e67b11dca5866 (patch)
treec6d437ef817e4af19261baa45b364a956493cafb
parent936a07feab0d279a2755bac00294b46faa06304a (diff)
downloadmailman-2b0e4cbc81a9f58699d21891575e67b11dca5866.tar.gz
mailman-2b0e4cbc81a9f58699d21891575e67b11dca5866.tar.zst
mailman-2b0e4cbc81a9f58699d21891575e67b11dca5866.zip
makealiases(): Generate the new set of alias to script mappings.
-rw-r--r--Mailman/MTA/Utils.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/Mailman/MTA/Utils.py b/Mailman/MTA/Utils.py
index 5010aa704..4aed1d2f7 100644
--- a/Mailman/MTA/Utils.py
+++ b/Mailman/MTA/Utils.py
@@ -36,13 +36,20 @@ def getusername():
def makealiases(listname):
wrapper = os.path.join(mm_cfg.WRAPPER_DIR, 'wrapper')
- return (
- # All the normal delivery addresses
- (listname, '"|%s post %s"' % (wrapper, listname)),
- (listname + '-admin', '"|%s bounces %s"' % (wrapper, listname)),
- (listname + '-bounces', '"|%s bounces %s' % (wrapper, listname)),
- (listname + '-join', '"|%s join %s"' % (wrapper, listname)),
- (listname + '-leave', '"|%s leave %s"' % (wrapper, listname)),
- (listname + '-owner', '"|%s mailowner %s' % (wrapper, listname)),
- (listname + '-request', '"|%s mailcmd %s"' % (wrapper, listname)),
- )
+ # Most of the list alias extensions are quite regular. I.e. if the
+ # message is delivered to listname-foobar, it will be filtered to a
+ # program called foobar. There are two exceptions:
+ #
+ # 1) Messages to listname (no extension) go to the post script.
+ # 2) Messages to listname-admin go to the bounces script. This is for
+ # backwards compatibility and may eventually go away (we really have no
+ # need for the -admin address anymore).
+ #
+ # Seed this with the special cases.
+ aliases = [(listname, '"|%s post %s"' % (wrapper, listname)),
+ (listname+'-admin', '"|%s bounces %s' % (wrapper, listname)),
+ ]
+ for ext in ('bounces', 'join', 'leave', 'owner', 'request'):
+ aliases.append(('%s-%s' % (listname, ext),
+ '"|%s %s %s"' % (wrapper, ext, listname)))
+ return aliases