<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Parse Plesk Maillog, Count Emails Per Domain</title>
	<atom:link href="http://www.usercore.com/parse-plesk-maillog-count-emails-per-domain/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.usercore.com/parse-plesk-maillog-count-emails-per-domain/</link>
	<description>Matt MacDougall - attempting to grok users, management, marketing, linux, subversion, coldfusion, os x and web geekery</description>
	<lastBuildDate>Thu, 04 Mar 2010 04:04:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt</title>
		<link>http://www.usercore.com/parse-plesk-maillog-count-emails-per-domain/comment-page-1/#comment-228</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 22 Jan 2009 15:48:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.usercore.com/?p=71#comment-228</guid>
		<description>Thanks for the bug fix Juan.  I&#039;ve posted a version of this script that copies and decompresses the log file into a working copy and then deletes it when it&#039;s done.

You&#039;re right, my first version is pretty bad for larger plesk installations.  And I think it gets exponentially worse as the log file size increases.

-Matt</description>
		<content:encoded><![CDATA[<p>Thanks for the bug fix Juan.  I&#8217;ve posted a version of this script that copies and decompresses the log file into a working copy and then deletes it when it&#8217;s done.</p>
<p>You&#8217;re right, my first version is pretty bad for larger plesk installations.  And I think it gets exponentially worse as the log file size increases.</p>
<p>-Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan C Lopez</title>
		<link>http://www.usercore.com/parse-plesk-maillog-count-emails-per-domain/comment-page-1/#comment-227</link>
		<dc:creator>Juan C Lopez</dc:creator>
		<pubDate>Thu, 22 Jan 2009 01:41:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.usercore.com/?p=71#comment-227</guid>
		<description>Me again I just seen the error in the script 
you typed:

do
echo $DOMAIN `zgrep -c -E &quot;(to&#124;from)=.+@$domain&quot; /usr/local/psa/var/log/maillog.processed.1.gz`
done

and sould be:
do
echo $DOMAIN `zgrep -c -E &quot;(to&#124;from)=.+@$DOMAIN&quot; /usr/local/psa/var/log/maillog.processed.1.gz`
done


The second domain was lower cased, any way this is still, slow for the reasons i told you before! bye!</description>
		<content:encoded><![CDATA[<p>Me again I just seen the error in the script<br />
you typed:</p>
<p>do<br />
echo $DOMAIN `zgrep -c -E &#8220;(to|from)=.+@$domain&#8221; /usr/local/psa/var/log/maillog.processed.1.gz`<br />
done</p>
<p>and sould be:<br />
do<br />
echo $DOMAIN `zgrep -c -E &#8220;(to|from)=.+@$DOMAIN&#8221; /usr/local/psa/var/log/maillog.processed.1.gz`<br />
done</p>
<p>The second domain was lower cased, any way this is still, slow for the reasons i told you before! bye!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan C Lopez</title>
		<link>http://www.usercore.com/parse-plesk-maillog-count-emails-per-domain/comment-page-1/#comment-226</link>
		<dc:creator>Juan C Lopez</dc:creator>
		<pubDate>Wed, 21 Jan 2009 23:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.usercore.com/?p=71#comment-226</guid>
		<description>Hello I try your script and is very interesting the aproach (how ever I got the same number of emails for all domain why), but I see it very REDOUNDANT, why? First you are opening directly a GZiped file, this consumes a Processor time, and memory, as you said it can be done unziping it before), but the problem is that you are doing this process, every time, for each domain in the server, so for a real case (like me), the numbers are:

122 Total Sites
8-10mb maillog.gz files
Time for each site 10-15 secs
Total time: 21-25 mins


Im not a SHELL programer so I cant write the script (I did&#039;n even know that you can access MySQL from SHELL :)  LOL), but the script sould do something like this:

1) Store a list of the domains (some how, an array Maybe)
2) Open the Maillog.gz file
3) run grep for all the to= and from=
4) if a domain from the domains list count it (maybe an other literal array in php like $domain[&#039;domain.com&#039;]++ )
then at the end print results.</description>
		<content:encoded><![CDATA[<p>Hello I try your script and is very interesting the aproach (how ever I got the same number of emails for all domain why), but I see it very REDOUNDANT, why? First you are opening directly a GZiped file, this consumes a Processor time, and memory, as you said it can be done unziping it before), but the problem is that you are doing this process, every time, for each domain in the server, so for a real case (like me), the numbers are:</p>
<p>122 Total Sites<br />
8-10mb maillog.gz files<br />
Time for each site 10-15 secs<br />
Total time: 21-25 mins</p>
<p>Im not a SHELL programer so I cant write the script (I did&#8217;n even know that you can access MySQL from SHELL <img src='http://www.usercore.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   LOL), but the script sould do something like this:</p>
<p>1) Store a list of the domains (some how, an array Maybe)<br />
2) Open the Maillog.gz file<br />
3) run grep for all the to= and from=<br />
4) if a domain from the domains list count it (maybe an other literal array in php like $domain['domain.com']++ )<br />
then at the end print results.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
