{"id":1476,"date":"2012-12-17T10:39:07","date_gmt":"2012-12-17T10:39:07","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=1476"},"modified":"2012-12-17T11:10:36","modified_gmt":"2012-12-17T11:10:36","slug":"mailman-install-in-mac-os-x-server-10-8","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=1476","title":{"rendered":"Mailman Install in Mac OS X Server 10.8"},"content":{"rendered":"<p>As part of the OS X Mountain Lion Server upgrade, Apple has removed the Mailman mailing list manager entirely. In order to get this running again you can use the following instructions. Hopefully this will help others.<\/p>\n<div>\n<p>You will notice that as part of the upgrade from Lion Server you you will have Migrated folder on your server under \/Library\/Server\/Migrated. This will contain any of your old lists from Mailman which we will use later.<\/p>\n<h3><\/h3>\n<p>Before you can get started you need to have the right infrastructure in place on Mountain Lion. Make sure you install the latest Xcode (4.4 as of this writing). Once installed you will need to open Xcode and open choose Preferences. Now install the Xcode command line tools. This is needed in order to build Mailman from the source.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Xcode command line tools\" alt=\"Xcode command line tools\" src=\"http:\/\/d337tramnb79qs.cloudfront.net\/wordpress\/wp-content\/uploads\/2012\/07\/Xcode_command_line_tools.png\" width=\"600\" height=\"202\" \/><\/p>\n<h3><\/h3>\n<p>Now we have the infrastructure necessary download the Mailman source from:<\/p>\n<p><a title=\"Mailman Source\" href=\"http:\/\/ftp.gnu.org\/gnu\/mailman\/mailman-2.1.15.tgz\">Mailman Source 2.1.15 (June 2012)<\/a><\/p>\n<p>Now open the terminal and login as root. Run the following commands:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">mkdir \/usr\/local\/mailman<br \/>\ncd \/usr\/local\/mailman<br \/>\nchgrp mailman <br \/>\nchmod a+rx,g+ws<\/div><\/div>\n<p>A note about these commands. By default Mountain Lion will have a _mailman user in the system already and so it will map the mailman user we used above to the _mailman user which is fine.<\/p>\n<p>Now we can build the source. Make sure the source is available on the server and change into that directory from the terminal. By default this will install into the \/usr\/local\/mailman directory we created above.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">cd mailman-&lt;version&gt;<br \/>\n\/configure<br \/>\nmake install<\/div><\/div>\n<p>Next validate the the installation by changing into the mailman directory and checking permissions:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">cd \/usr\/local\/mailman<br \/>\nbin\/check_perms -f<\/div><\/div>\n<p>Since Mountain Lion has removed the support for Mailman we need to create our own mailman settings and make sure the Server App is restarted to pick them up. At the end of this step you will have Mailman accessible again from the Web Server. So the first step is to ensure your web server is turned on using the Server App.<\/p>\n<p>Now we need to create a new file of specific Mailman settings for the built-in Apache server. Cut and paste the following settings into a new file and save it as httpd-mailman.conf.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\"># Config file for linking the mailman mailing list manager to MacOSX Server Web Server.<br \/>\n#<br \/>\n<br \/>\nScriptAlias \/mailman\/ &quot;\/usr\/local\/mailman\/cgi-bin\/&quot;<br \/>\nAlias \/pipermail\/ &quot;\/usr\/local\/mailman\/archives\/public\/&quot;<br \/>\nAlias \/icons\/ &quot;\/usr\/local\/mailman\/icons\/&quot;<br \/>\n&lt;Directory &quot;\/usr\/local\/mailman\/archives\/public\/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0Options FollowSymLinks MultiViews Indexes<br \/>\n\u00a0\u00a0\u00a0\u00a0AllowOverride None<br \/>\n\u00a0\u00a0\u00a0\u00a0Order allow,deny<br \/>\n\u00a0\u00a0\u00a0\u00a0Allow from all<br \/>\n&lt;\/Directory&gt;<\/div><\/div>\n<p>Now copy this file to your server and place it in the desired location. I used the apache2\/extra folder, but you can equally use the apache2\/other location as well, as long as your Include refers to the correct file.<\/p>\n<p>\/private\/etc\/apache2\/extra\/httpd-mailman.conf<\/p>\n<p>Next we need to make sure the Web Server loads this file. This is controlled by the Apache settings at \/Library\/Server\/Web\/Config\/apache2\/httpd_server_app.conf. Edit this file and add the following line near the end of the file just above the comment for SSL\/TLS connections.<\/p>\n<p>Include \/private\/etc\/apache2\/extra\/httpd-mailman.conf<\/p>\n<p>Now restart your Web Server using the Server App. After it has restarted you should be able to access the following URL:<\/p>\n<p>http:\/\/myserver.com\/mailman\/listinfo<\/p>\n<p>You can now proceeed to Step 4.<\/p>\n<h3><\/h3>\n<p>Next we need to comfigure Mailman correctly to connect to our Mountain Lion Mail Server. Edit \/usr\/local\/mailman\/Mailman\/mm_cfg.py<\/p>\n<p>Add the following to the end of the file:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">MTA = 'Postfix'<\/div><\/div>\n<p>Other settings on Mountain Lion Server should be correct already. So next we need to initialize the aliases file for mailman as follows:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">cd \/usr\/local\/mailman<br \/>\nbin\/genaliases<br \/>\nchown mailman:mailman data\/aliases*<br \/>\nchmod g+w data\/aliases*<\/div><\/div>\n<p>Now we need to change out Postfix settings on the Mountain Lion Server to hook into Mailman correctly. Edit \/Library\/Server\/Mail\/Config\/postfix\/main.cf as follows to add the correct alias_maps path to Mailman. If you are upgrading from Lion or earlier you will see an old entry which will point to the now non existant mailman server.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">alias_maps = hash:\/etc\/aliases,hash:\/usr\/local\/mailman\/data\/aliases<\/div><\/div>\n<p>Now you can restart your mail server using the Server App and Mailman should be connected to your server.<\/p>\n<h3><\/h3>\n<p>Set the Mailman site password:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">\/usr\/local\/mailman\/bin\/mmsitepass xxxx<\/div><\/div>\n<p>Create a new mailing list:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">bin\/newlist mailman<br \/>\n# apply the default template<br \/>\nbin\/config_list -i data\/sitelist.cfg mailman<\/div><\/div>\n<p>Mailman depends on a process called the \u201cqrunner\u201d to delivery all email messages it sees. You must start the qrunner by executing the following command from the \/usr\/local\/mailman directory:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">bin\/mailmanctl start<\/div><\/div>\n<p>Now we need to make sure this starts and stops everytime the server does. We can do this by creating a Launch Daemon. We can save this as org.list.mailmanctl.plist and place it in \/System\/Library\/LaunchDaemons\/<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;height:300px;\"><div class=\"text codecolorer\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br \/>\n&lt;!DOCTYPE plist PUBLIC &quot;-\/\/Apple Computer\/\/DTD PLIST 1.0\/\/EN&quot; &quot;&lt;a href=&quot;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&quot;&gt;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&lt;\/a&gt;&quot;&gt;<br \/>\n&lt;plist version=&quot;1.0&quot;&gt;<br \/>\n&lt;dict&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;Debug&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;true\/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;Disabled&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;false\/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;Label&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;string&gt;org.list.mailmanctl&lt;\/string&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;Program&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;string&gt;\/usr\/local\/mailman\/bin\/mailmanctl&lt;\/string&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;ProgramArguments&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;array&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;string&gt;mailmanctl&lt;\/string&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;string&gt;-s&lt;\/string&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;string&gt;start&lt;\/string&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;\/array&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;KeepAlive&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;false\/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;RunAtLoad&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;true\/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;key&gt;AbandonProcessGroup&lt;\/key&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0&lt;true\/&gt;<br \/>\n&lt;\/dict&gt;<br \/>\n&lt;\/plist&gt;<\/div><\/div>\n<p>Now this will run everytime the server starts up.<\/p>\n<h3><\/h3>\n<p>If you have Lists created under Lion Server you will need to migrate these to your new installation of Mailman. You will notice that Mountain Lion created a new folder on on your server called \/Library\/Server\/Migrated. Within that you should have a folder called private\/var\/mailman\/lists.<\/p>\n<p>Now we can extract the users from each of these old lists. We can just cut and paste the following on the command line in each of your mailing list directories where there is a config.pck file. This will printout each member on a new line and you can just cut and paste this as needed after creating your new list name.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">ln -s \/usr\/local\/mailman\/bin\/paths.py<br \/>\npython<br \/>\nimport paths<br \/>\nimport Mailman, pickle<br \/>\nconfigFile = open('config.pck')<br \/>\nconfig = pickle.load(configFile)<br \/>\nconfig['created_at']<br \/>\n&lt;a title=&quot;members&quot; href=&quot;&lt;a href=&quot;http:\/\/www.livetime.com\/members\/&quot;&gt;http:\/\/www.livetime.com\/members\/&lt;\/a&gt;&quot;&gt;members&lt;\/a&gt; = config['members'].keys()<br \/>\nmembers.sort()<br \/>\nprint 'n'.join(members)<\/div><\/div>\n<p>Once you have the users you can just create the new list of the same name using:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">bin\/newlist example<\/div><\/div>\n<p>Now you can test your lists are working by posting a test message to the list. That should be all you need to do. You now have a fully working Mailman List server running on your new Mountain Lion Server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the OS X Mountain Lion Server upgrade, Apple has removed the Mailman mailing list manager entirely. In order to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1476","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1476"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1476\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}