{"id":207,"date":"2014-02-09T21:00:54","date_gmt":"2014-02-09T20:00:54","guid":{"rendered":"http:\/\/www.anginf.de\/?p=207"},"modified":"2014-07-10T17:14:16","modified_gmt":"2014-07-10T15:14:16","slug":"mailman-with-suexec-here-in-a-froxlor-environment","status":"publish","type":"post","link":"https:\/\/www.anginf.de\/?p=207","title":{"rendered":"mailman with suexec (here in a froxlor environment)"},"content":{"rendered":"<p>The Software <a href=\"http:\/\/www.list.org\/\" title=\"GNU Mailman Website\" target=\"_blank\">GNU mailman<\/a> is a great mailinglist-tool, which can be installed on a small server, ensuring independence from big companies like google &#038; co.<\/p>\n<p>In my setup, I&#8217;m using apache2 together with suexec and postfix. Unfortunately, mailman doesn&#8217;t work easy with suexec. I&#8217;m also using froxlor, which makes it easy to setup new domains, emails etc. for customers or family. Mailman isn&#8217;t integrated in froxlor (there is an outdated <a href=\"http:\/\/redmine.froxlor.org\/issues\/546\" title=\"Mailman module in froxlor\" target=\"_blank\">custom module<\/a>, though), so I had to setup something on my own.<\/p>\n<p>Please remember to update the following placeholders in the scripts below:<\/p>\n<ul>\n<li>your.ip.add.ress<\/li>\n<li>list.yourdomain.tld<\/li>\n<li>admin@account<\/li>\n<\/ul>\n<p>Here&#8217;s what I have done:<\/p>\n<pre lang=\"bash\">\r\n# Download and extract mailman\r\nmkdir -p ~\/work\/mailman\r\ncd ~\/work\/mailman\r\nwget http:\/\/ftp.gnu.org\/gnu\/mailman\/mailman-2.1.17.tgz\r\ntar xvfz mailman-2.1.17.tgz\r\n# Add user and group\r\nsudo addgroup mailman\r\nsudo adduser mailman --ingroup mailman\r\n# Secure stuff: no directory, no Login\r\nsudo sed -i 's\/mailman:x:\\([0-9]*\\):\\([0-9]*\\):Mailman,,,:\\\/home\\\/mailman:\\\/bin\\\/bash\/mailman:x:\\1:\\2:Mailman,,,:\\\/nonexistent:\\\/bin\\\/false\/' \/etc\/passwd\r\n# We need to identify which is our docroot, we're creating the install dir there.\r\n# This is most certainly \"\/var\/www\"\r\ndocrootpart=$(sudo \/usr\/lib\/apache2\/suexec -V 2>&1 | grep AP_DOC_ROOT | sed 's\/.*\"\\(.*\\)\"\/\\1\/')\r\nmyprefix=${docrootpart}\/mailman\r\nsudo mkdir -p $myprefix\r\ncd $myprefix\r\nsudo chgrp mailman .\r\nsudo chmod a+rx,g+ws .\r\ncd ~\/work\/mailman\/mailman-2.1.17\r\n# configure, make and install\r\n.\/configure --prefix=$myprefix --with-username=mailman --with-groupname=mailman --with-cgi-gid=mailman --with-mail-gid=mailman\r\nmake\r\nsudo make install\r\ncd $myprefix\r\nsudo bash -c 'bin\/check_perms -f'\r\n# Using information from http:\/\/wiki.list.org\/pages\/viewpage.action?pageId=4030646\r\nsudo chown -R mailman:mailman $myprefix\/cgi-bin*\r\nsudo chmod g-w $myprefix\/cgi-bin\r\nsudo chmod g-s $myprefix\/cgi-bin\/*\r\n<\/pre>\n<p>After this, you now must create the mailman.conf-file at <code>\/etc\/apache2\/conf.d\/mailman.conf<\/code>:<\/p>\n<p>Remember to check your docroot, you might have to change the \/var\/www below at all occurences. If you&#8217;re using SSL, change the 80 to 443 and add all the <code>SSLEngine On<\/code> etc. lines from your local apache configuration, which pretty much includes everything starting with SSL.<\/p>\n<pre lang=\"apache\">\r\n<VirtualHost your.ip.add.ress:80>\r\n        ServerName      list.yourdomain.tld\r\n        ServerAlias     list.yourdomain.tld\r\n        SuexecUserGroup mailman mailman\r\n        DocumentRoot    \"\/var\/www\/mailman\"\r\n        Alias \/pipermail\/ \/var\/www\/mailman\/archives\/public\/\r\n        Alias \/icons\/ \/var\/www\/mailman\/icons\/\r\n        ScriptAlias \/admin \/var\/www\/mailman\/cgi-bin\/admin\r\n        ScriptAlias \/admindb \/var\/www\/mailman\/cgi-bin\/admindb\r\n        ScriptAlias \/confirm \/var\/www\/mailman\/cgi-bin\/confirm\r\n        ScriptAlias \/create \/var\/www\/mailman\/cgi-bin\/create\r\n        ScriptAlias \/edithtml \/var\/www\/mailman\/cgi-bin\/edithtml\r\n        ScriptAlias \/listinfo \/var\/www\/mailman\/cgi-bin\/listinfo\r\n        ScriptAlias \/options \/var\/www\/mailman\/cgi-bin\/options\r\n        ScriptAlias \/private \/var\/www\/mailman\/cgi-bin\/private\r\n        ScriptAlias \/rmlist \/var\/www\/mailman\/cgi-bin\/rmlist\r\n        ScriptAlias \/roster \/var\/www\/mailman\/cgi-bin\/roster\r\n        ScriptAlias \/subscribe \/var\/www\/mailman\/cgi-bin\/subscribe\r\n        ScriptAlias \/mailman\/ \/var\/www\/mailman\/cgi-bin\/\r\n        ScriptAlias \/ \/var\/www\/mailman\/cgi-bin\/listinfo\r\n<Directory \"\/var\/www\/mailman\/archives\/public\/\">\r\n        AddDefaultCharset off\r\n<\/Directory>\r\n<\/VirtualHost>\r\n<\/pre>\n<p>Now restart the apache webserver:<\/p>\n<pre lang=\"bash\">\r\nsudo service apache2 restart\r\n<\/pre>\n<p>Mailman is now available under http:\/\/list.yourdomain.tld\/mailman\/create (shouldn&#8217;t throw any errors anymore). Do <strong>NOT<\/strong> create a mailing list just yet. If you&#8217;re still getting errors like 500 (Internal Server Error), check your log files, especially your suexec.log, probably located at <code>\/var\/log\/apache2\/suexec.log<\/code><\/p>\n<pre lang=\"bash\">\r\n# Change postfix configuration\r\n# http:\/\/www.list.org\/mailman-install\/node12.html\r\nsudo bash -c 'echo \"recipient_delimiter = +\" >>\/etc\/postfix\/main.cf'\r\nsudo bash -c 'echo \"unknown_local_recipient_reject_code = 550\" >>\/etc\/postfix\/main.cf'\r\n# Change mailman configuration\r\n# http:\/\/www.list.org\/mailman-install\/postfix-integration.html\r\ncd $myprefix\/Mailman\r\nsudo bash -c 'echo \"MTA = '\\''Postfix'\\''\" >>mm_cfg.py'\r\ncd $myprefix\r\n# Generate aliases\r\nsudo bin\/genaliases\r\nsudo chown mailman:mailman data\/aliases*\r\nsudo chmod g+w data\/aliases*\r\nsudo sed -i 's\/alias_maps\\ =\\ \\$alias_database\/alias_maps\\ =\\ \\$alias_database,hash:\\\/var\\\/www\\\/mailman\\\/data\\\/aliases\/' \/etc\/postfix\/main.cf\r\n<\/pre>\n<p>Mailman is now configured, let&#8217;s create our first mailling list, this must be the &#8222;mailman&#8220;-list, this is only an internal mailing list.<\/p>\n<pre lang=\"bash\">\r\n## Configure mailman internal\r\n# maillinglist \"mailman\"\r\ncd $myprefix\r\nsudo bin\/newlist mailman\r\n# Configure siteliste (use default)\r\nsudo bin\/config_list -i data\/sitelist.cfg mailman\r\n# Enable cron - make sure to change the MAILTO-Information to your email!\r\n# http:\/\/www.list.org\/mailman-install\/node41.html\r\ncd $myprefix\/cron\r\nsudo bash -c 'echo \"MAILTO=admin@account\" >crontab.ok'\r\nsudo bash -c 'cat crontab.in >>crontab.ok'\r\nsudo crontab -u mailman crontab.ok\r\n# Add virtual host (here: list.yourdomain.tld)\r\ncd $myprefix\/Mailman\r\nsudo bash -c 'echo \"add_virtualhost('\\''list.yourdomain.tld'\\'')\" >>mm_cfg.py'\r\n# Now as we're super-secure, we're adding the https-Information\r\n# Make sure that this is supported by your webserver and fully configured, otherwise skip the next two lines!\r\nsudo bash -c 'echo \"DEFAULT_URL_PATTERN = '\\''https:\/\/%s\/mailman\/'\\''\" >>mm_cfg.py'\r\nsudo bash -c 'echo \"PUBLIC_ARCHIVE_URL = '\\''https:\/\/%(hostname)s\/pipermail\/%(listname)s'\\''\" >>mm_cfg.py'\r\n# Default-Host\r\nsudo bash -c 'echo \"DEFAULT_EMAIL_HOST = '\\''list.yourdomain.tld'\\''\" >>mm_cfg.py'\r\nsudo bash -c 'echo \"DEFAULT_URL_HOST = '\\''list.yourdomain.tld'\\''\" >>mm_cfg.py'\r\n# for ubuntu\/debian, we're adding the startup-script and enable mailman to run after reboot\r\n# http:\/\/www.list.org\/mailman-install\/node42.html\r\nsudo cp $myprefix\/scripts\/mailman \/etc\/init.d\/mailman\r\nsudo update-rc.d mailman defaults\r\nsudo \/etc\/init.d\/mailman start\r\n# Set asswords\r\nsudo $myprefix\/bin\/mmsitepass\r\n<\/pre>\n<p>You&#8217;re all set, mailman is fully operational and running. Here&#8217;s the example on how to add a list &#8222;yourlist&#8220; in mailman. This will create the list and uses to configuration options: Replies always go to the list, and the information written in the mailinglist is NOT open for the internet to see, making this a private list.<\/p>\n<ol>\n<li>Go to https:\/\/list.yourdomain.tld\/mailman\/create<\/li>\n<li>After creating the list, go to the admin-page of the list:<\/li>\n<li>https:\/\/list.yourdomain.tld\/mailman\/admin\/yourlist<\/li>\n<li>Login with the mailed password<\/li>\n<li>reply_goes_to_list &#8211;> this list<\/li>\n<li>archive_private &#8211;> private<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The Software GNU mailman is a great mailinglist-tool, which can be installed on a small server, ensuring independence from big companies like google &#038; co. In my setup, I&#8217;m using apache2 together with suexec and postfix. Unfortunately, mailman doesn&#8217;t work easy with suexec. I&#8217;m also using froxlor, which makes it easy to setup new domains, &hellip; <a href=\"https:\/\/www.anginf.de\/?p=207\" class=\"more-link\"><span class=\"screen-reader-text\">mailman with suexec (here in a froxlor environment)<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207"}],"version-history":[{"count":15,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/www.anginf.de\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anginf.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}