<?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>Dotdeb &#187; awstats</title>
	<atom:link href="http://www.dotdeb.org/tag/awstats/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotdeb.org</link>
	<description>The repository for Debian-based LAMP servers</description>
	<lastBuildDate>Mon, 06 Sep 2010 15:52:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Calculate statistics from your Qmail logfiles using Awstats</title>
		<link>http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=calculate-statistics-from-your-qmail-logfiles-using-awstats</link>
		<comments>http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 15:06:35 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=141</guid>
		<description><![CDATA[Awstats is a commonly used program to calculate web sta [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://awstats.sourceforge.net/">Awstats</a> is a commonly used program to calculate web statistics from your webserver logfiles. It can detect useragents, referers, unique visitors&#8230; But one of its another feature is to build usage reports from your mail server&#8217;s logfiles, as seen on <a href="http://awstats.sourceforge.net/awstats.mail.html">this demo</a>.</p>
<p>Here is how to quickly configure Awstats to take profit of your Qmail log files&#8230;</p>
<p> </p>
<p style="text-align: center;"><img class="size-medium wp-image-146 aligncenter" title="mailboxes" src="http://www.dotdeb.org/wp-content/uploads/2008/10/956430_23580482-300x200.jpg" alt="mailboxes" width="300" height="200" /></p>
<p> </p>
<p><span id="more-141"></span>First of all, you need to convert rour <em>/var/log/mail.log</em> file to make it readable to Awstats (supposing you&#8217;re using Qmail and Vpopmail from Dotdeb and Awstats from Debian&#8217;s official repositories).</p>
<p>Hopefully, a tool is provided with the awstats package : <em>/usr/share/doc/awstats/examples/maillogconvert.pl</em></p>
<p>You can take a look at its output by executing the following command :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>awstats<span style="color: #000000; font-weight: bold;">/</span>examples<span style="color: #000000; font-weight: bold;">/</span>maillogconvert.pl vadmin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mail.log </pre></div></div>

<p>(<em>vadmin</em> is here to consider the Vpopmail&#8217;s virtualdomain translation)</p>
<p>Great! We now just have to configure awstats to produce useful reports. Here is a sample configuration file (name it <em>/etc/awstats/awstats.mail.conf</em>, for example)&#8230; Please note the space <strong>after</strong> the pipe :</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">LogFile</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;/usr/share/doc/awstats/examples/maillogconvert.pl vadmin /var/log/mail.log | &quot;</span>
<span style="color: #000099;">LogType</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">M</span>
<span style="color: #000099;">LogFormat</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;%time2 %email %email_r %host %host_r %method %url %code %bytesd&quot;</span>
<span style="color: #000099;">SiteDomain</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;localhost&quot;</span>
<span style="color: #000099;">HostAliases</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;127.0.0.1 @/etc/qmail/rcpthosts&quot;</span>
<span style="color: #000099;">LevelForBrowsersDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Browsers detection.</span>
<span style="color: #000099;">LevelForOSDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables OS detection.</span>
<span style="color: #000099;">LevelForRefererAnalyze</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Origin detection.</span>
<span style="color: #000099;">LevelForRobotsDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Robots detection.</span>
<span style="color: #000099;">LevelForSearchEnginesDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Search engines detection.</span>
<span style="color: #000099;">LevelForKeywordsDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Keyphrases/Keywords detection.</span>
<span style="color: #000099;">LevelForFileTypesDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables File types detection.</span>
<span style="color: #000099;">ShowSummary</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowMonthStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowDaysOfMonthStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowDaysOfWeekStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowHoursStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowDomainsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowHostsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HBL</span>
<span style="color: #000099;">ShowRobotsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowEMailSenders</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HBML</span>
<span style="color: #000099;">ShowEMailReceivers</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HBML</span>
<span style="color: #000099;">ShowSessionsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowPagesStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowFileTypesStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowOSStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowBrowsersStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowOriginStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowKeyphrasesStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowKeywordsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowMiscStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowHTTPErrorsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowSMTPErrorsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span></pre></div></div>

<p>Now, just add this line to /etc/cron.d/awstats to compute your logfiles every 10 minutes:</p>
<pre>0,10,20,30,40,50 * * * * root [ -x /usr/lib/cgi-bin/awstats.pl ] &amp;&amp; /usr/lib/cgi-bin/awstats.pl -config=mail -update &amp;&gt;/dev/null</pre>
<p>(Let&#8217;s enjoy a 10-minutes break or brew a good coffee, waiting for the stats to be calculated&#8230;)</p>
<p>Your mailserver&#8217;s statistics will shortly be available at this URL : <a href="http://yourserver/cgi-bin/awstats.pl?config=mail">http://yourserver/cgi-bin/awstats.pl?config=mail</a>.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/&via=dotdeb&text=Calculate statistics from your Qmail logfiles using Awstats&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/&via=dotdeb&text=Calculate statistics from your Qmail logfiles using Awstats&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
