<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.ryara.net &#187; postfix</title>
	<atom:link href="http://blog.ryara.net/tag/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ryara.net</link>
	<description></description>
	<lastBuildDate>Thu, 01 Jul 2010 10:43:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mailman with lighttpd and Postfix on Gentoo</title>
		<link>http://blog.ryara.net/2009/03/27/mailman-with-lighttpd-and-postfix-on-gentoo/</link>
		<comments>http://blog.ryara.net/2009/03/27/mailman-with-lighttpd-and-postfix-on-gentoo/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 00:38:41 +0000</pubDate>
		<dc:creator>tobbez</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[mailman]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://blog.ryara.net/?p=67</guid>
		<description><![CDATA[This post details how to setup mailman using lighttpd and postfix on gentoo. Before starting I assume that you have: * Lighttpd setup and working * Postfix setup to handle mail from one domain * MX records setup for the &#8230; <a href="http://blog.ryara.net/2009/03/27/mailman-with-lighttpd-and-postfix-on-gentoo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post details how to setup mailman using lighttpd and postfix on gentoo.</p>
<p>Before starting I assume that you have:<br />
* Lighttpd setup and working<br />
* Postfix setup to handle mail from one domain<br />
* MX records setup for the subdomain you want to use for lists</p>
<p>First, we need to install mailman, but before we do that we need to make sure it uses the right UID and GID (lighttpd) instead of apache, which is the default. To do this append </p>
<p><code>
<pre>MAILMAN_CGIGID="lighttpd"
MAILMAN_CGIUID="lighttpd"
</pre>
<p></code><br />
to <strong>/etc/make.conf</strong> and then proceed to install mailman:</p>
<p><code>
<pre># emerge mailman</pre>
<p></code></p>
<p>Now it&#8217;s time to configure lighttpd. This we do by adding the following to <strong>/etc/lighttpd/lighttpd.conf</strong>:</p>
<p><code>
<pre>alias.url += (
          "/services/mailman/mailman-icons" => "/usr/lib64/mailman/icons/",
          "/services/mailman/pipermail" => "/var/lib/mailman/archives/public/",
          "/services/mailman" => "/usr/lib64/mailman/cgi-bin/",
)

$HTTP["url"] =~ "^/services/mailman" {
        cgi.assign = (
                "/admin" => "",
                "/admindb" => "",
                "/confirm" => "",
                "/create" => "",
                "/edithtml" => "",
                "/listinfo" => "",
                "/options" => "",
                "/private" => "",
                "/rmlist" => "",
                "/roster" => "",
                "/subscribe" => "")
        server.indexfiles = ("listinfo", "index.html")
}
$HTTP["url"] =~ "^/services/mailman/pipermail/" {
             dir-listing.activate = "enable"
             dir-listing.hide-dotfiles = "enable"
             server.follow-symlink = "enable"
}
</pre>
<p></code><br />
I choose not to serve mailman from a vhost, if you want to do that you&#8217;ll need to change the above accordingly. Otherwise you&#8217;ll just have to change the url matches and aliases to reflect from where you want to host mailman. You will also need to make sure that the alias and cgi modules are enabled (located at the top of <strong>lighttpd.conf</strong>).</p>
<p>The next thing to configure is mailman itself. Append the following to <strong>/etc/mailman/mm_cfg.py</strong>:</p>
<p><code>
<pre>MTA = 'Postfix'
DEFAULT_EMAIL_HOST = 'lists.example.tld'
DEFAULT_URL_HOST = 'example.tld'
DEFAULT_URL_PATTERN = 'http://%s/services/mailman/'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
IMAGE_LOGOS = '/services/mailman/mailman-icons/' 

POSTFIX_STYLE_VIRTUAL_DOMAINS = [DEFAULT_EMAIL_HOST]

PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/services/mailman/pipermail/%(listname)s'
</pre>
<p></code><br />
You should set <code>DEFAULT_EMAIL_HOST</code> to the subdomain you want your lists to use, <code>DEFAULT_URL_HOST</code> to the host from which you will serve the mailman web pages, and change <code>DEFAULT_URL_PATTERN</code>, <code>IMAGE_LOGOS</code>, <code>PUBLIC_ARCHIVE_URL</code> so that they are consistent with your settings in <strong>lighttpd.conf</strong>. The call to <code>add_virtualhost</code> is need when you change either of the <code>_HOST</code> variables like this.</p>
<p>Continuing, there is a few things we need to do as the mailman user. First install the cron jobs:</p>
<p><code>
<pre># su - mailman
mailman $ cd cron
mailman $ crontab crontab.in
mailman $ cd ..
</pre>
<p></code><br />
Then set the site password:</p>
<p><code>
<pre>mailman $ bin/mmsitepass
</pre>
<p></code><br />
The site password works instead of any other password in the mailman installation, and is used to adminstrate it.</p>
<p>Next we create the site-wide mailing list, which is needed for proper operation of mailman:</p>
<p><code>
<pre>mailman $ bin/newlist mailman
</pre>
<p></code><br />
And logout from the mailman account and continue&#8230;</p>
<p>&#8230;with configuring postfix. This is as simple as adding the following two lines to <strong>/etc/postfix/main.cf</strong>:</p>
<p><code>
<pre>virtual_alias_domains = lists.example.tld
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman
</pre>
<p></code></p>
<p>Once again replacing lists.example.tld with the subdomain you want your lists to use.</p>
<p>Now we only need to reload postfix, start mailman and add it to the default runlevel:</p>
<p><code>
<pre># /etc/init.d/postfix reload
# /etc/init.d/mailman start
# rc-update add mailman default
</pre>
<p></code><br />
Congratulations, you should now have a working mailman install!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryara.net/2009/03/27/mailman-with-lighttpd-and-postfix-on-gentoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
