[Mailman-Developers] Postfix, Mailman, no aliases file, neat setup?
Owen Taylor
otaylor@redhat.com
16 Nov 2000 16:09:38 -0500
--=-=-=
J C Lawrence <claw@kanga.nu> writes:
> I'm looking to setup a test Mailman site under Postfix (need to do
> some performance modelling of Exim against Postfix under Mailman for
> a given membership list). I can get a basic setup working no
> problem -- now I'm looking to duplicate the neater aspects I already
> have under Exim, such as losing the Mailman aliases file, etc.
> Anybody already done this?
Well, you can't lose the aliases file, but you can make it pretty
darn invisible.
From postfix's main.cf:
alias_maps = hash:/etc/aliases,hash:/home/mailman/aliases
And the following patch automatically updates the file.
Regards,
Owen
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
filename=mailman-2.0beta5-postfix.patch
--- mailman-2.0beta5/bin/newlist.postfix Sat Aug 5 18:24:11 2000
+++ mailman-2.0beta5/bin/newlist Sat Aug 5 18:26:08 2000
@@ -56,6 +56,14 @@
%(owner2)s %(listname)s-admin
'''
+ALIASFILETEMPLATE = '''
+## %(listname)s mailing list
+## created: %(date)s %(user)s
+%(list)s "|%(wrapper)s post %(listname)s"
+%(admin)s "|%(wrapper)s mailowner %(listname)s"
+%(request)s "|%(wrapper)s mailcmd %(listname)s"
+%(owner2)s %(listname)s-admin
+'''
def getusername():
@@ -117,7 +125,11 @@
except Errors.MMListAlreadyExistsError:
usage(1, 'List already exists: ' + listname)
- print ALIASTEMPLATE % {
+ aliaspath = os.path.join(mm_cfg.PREFIX, 'aliases')
+ print "Appending aliases to " + aliaspath
+
+ aliasfile = open(aliaspath, "a")
+ aliasfile.write (ALIASFILETEMPLATE % {
'listname': listname,
'list' : "%-24s" % (listname + ":"),
'wrapper' : '%s/wrapper' % mm_cfg.WRAPPER_DIR,
@@ -126,8 +138,12 @@
'owner2' : "%-24s" % ("%s-owner:" % listname),
'date' : time.strftime('%d-%b-%Y', time.localtime(time.time())),
'user' : getusername(),
- }
+ })
+ aliasfile.close()
+ print "Rehashing alias database"
+ os.system ("/usr/sbin/postalias hash:" + aliaspath)
+
if len(argv) < 5:
print ("Hit enter to continue with %s owner notification..."
% listname),
--=-=-=--