<?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>ServerAdminBlog</title>
	<atom:link href="http://www.serveradminblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serveradminblog.com</link>
	<description>Short Circuit...</description>
	<lastBuildDate>Mon, 16 Aug 2010 20:38:58 +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>Postfix quota notification email script</title>
		<link>http://www.serveradminblog.com/2010/08/postfix-quota-notification-email-script/</link>
		<comments>http://www.serveradminblog.com/2010/08/postfix-quota-notification-email-script/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 08:47:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=144</guid>
		<description><![CDATA[If you want to take care about your users quota and your storage space, check this &#8230; 1. Create new file (for example quota_notify inside /usr/local/sbin/ ) 2. Copy next content inside quota_notify #!/usr/bin/perl -w &#160; # Author &#60;jps@tntmax.com&#62; # # This script assumes that virtual_mailbox_base in defined # in postfix's main.cf file. This directory [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to take care about your users quota and your storage space, check this &#8230;</p>
<p>1. Create new file (for example quota_notify inside /usr/local/sbin/ )</p>
<p>2. Copy next content inside quota_notify</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Author &lt;jps@tntmax.com&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This script assumes that virtual_mailbox_base in defined</span>
<span style="color: #666666; font-style: italic;"># in postfix's main.cf file. This directory is assumed to contain</span>
<span style="color: #666666; font-style: italic;"># directories which themselves contain your virtual user's maildirs.</span>
<span style="color: #666666; font-style: italic;"># For example:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># -----------/</span>
<span style="color: #666666; font-style: italic;">#            |</span>
<span style="color: #666666; font-style: italic;">#            |</span>
<span style="color: #666666; font-style: italic;">#    home/vmail/domains/</span>
<span style="color: #666666; font-style: italic;">#        |          |</span>
<span style="color: #666666; font-style: italic;">#        |          |</span>
<span style="color: #666666; font-style: italic;">#  example.com/  foo.com/</span>
<span style="color: #666666; font-style: italic;">#                   |</span>
<span style="color: #666666; font-style: italic;">#                   |</span>
<span style="color: #666666; font-style: italic;">#           -----------------</span>
<span style="color: #666666; font-style: italic;">#           |       |       |</span>
<span style="color: #666666; font-style: italic;">#           |       |       |</span>
<span style="color: #666666; font-style: italic;">#         user1/   user2/  user3/</span>
<span style="color: #666666; font-style: italic;">#                           |</span>
<span style="color: #666666; font-style: italic;">#                           |</span>
<span style="color: #666666; font-style: italic;">#                        maildirsize</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$POSTFIX_CF</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/etc/postfix/main.cf&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$MAILPROG</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/usr/sbin/sendmail -t&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$WARNPERCENT</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@POSTMASTERS</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'postmaster@mydomain.tld'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$CONAME</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'Company ....'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$COADDR</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'postmaster@mydomain.tld'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$SUADDR</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'postmaster@mydomain.tld'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$MAIL_REPORT</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$MAIL_WARNING</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#get virtual mailbox base from postfix config</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>PCF<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&lt; $POSTFIX_CF&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mboxBase</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;PCF&gt;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #009966; font-style: italic;">/virtual_mailbox_base\s*=\s*(.*)\s*/</span><span style="color: #339933;">;</span>
   <span style="color: #0000ff;">$mboxBase</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>PCF<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#assume one level of subdirectories for domain names</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@domains</span><span style="color: #339933;">;</span>
<span style="color: #000066;">opendir</span><span style="color: #009900;">&#40;</span>DIR<span style="color: #339933;">,</span> <span style="color: #0000ff;">$mboxBase</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000066;">readdir</span><span style="color: #009900;">&#40;</span>DIR<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$name</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/^\.\.?$/</span><span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;">#skip '.' and '..'</span>
   <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>d <span style="color: #ff0000;">&quot;$mboxBase/$name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@domains</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">closedir</span><span style="color: #009900;">&#40;</span>DIR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#iterate through domains for username/maildirsize files</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@users</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chdir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$mboxBase</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$domain</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@domains</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">opendir</span><span style="color: #009900;">&#40;</span>DIR<span style="color: #339933;">,</span> <span style="color: #0000ff;">$domain</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000066;">readdir</span><span style="color: #009900;">&#40;</span>DIR<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$name</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/^\.\.?$/</span><span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;">#skip '.' and '..'</span>
           <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>d <span style="color: #ff0000;">&quot;$domain/$name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@users</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #ff0000;">&quot;$name<span style="color: #000099; font-weight: bold;">\@</span>$domain&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$mboxBase/$domain/$name&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">closedir</span><span style="color: #009900;">&#40;</span>DIR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">#get user quotas and percent used</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">%lusers</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$report</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$href</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@users</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$user</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">keys</span> <span style="color: #0000ff;">%$href</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$quotafile</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;$href-&gt;{$user}/maildirsize&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>f <span style="color: #0000ff;">$quotafile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>QF<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&lt; $quotafile&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$firstln</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$quota</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$used</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;QF&gt;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span>
              <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #0000ff;">$firstln</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                 <span style="color: #0000ff;">$firstln</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
                 <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error: corrupt quotafile $quotafile&quot;</span>
                    <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/^(\d+)S/</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #0000ff;">$quota</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">last</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #0000ff;">$quota</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">next</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
         <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error: corrupt quotafile $quotafile&quot;</span>
            <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/\s*(-?\d+)/</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #0000ff;">$used</span> <span style="color: #339933;">+=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>QF<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #0000ff;">$used</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$percent</span> <span style="color: #339933;">=</span> <span style="color: #000066;">int</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$used</span> <span style="color: #339933;">/</span> <span style="color: #0000ff;">$quota</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #0000ff;">$lusers</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$user</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$percent</span> <span style="color: #b1b100;">unless</span> <span style="color: #b1b100;">not</span> <span style="color: #0000ff;">$percent</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">#send a report to the postmasters</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$MAIL_REPORT</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>MAIL<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;| $MAILPROG&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">select</span><span style="color: #009900;">&#40;</span>MAIL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;To: $_<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">@POSTMASTERS</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;From: $COADDR<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Subject: Daily Quota Report.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;DAILY QUOTA REPORT:<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;----------------------------------------------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;| % USAGE |            ACCOUNT NAME          |<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;----------------------------------------------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$luser</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066;">sort</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$lusers</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$b</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">&lt;=&gt;</span> <span style="color: #0000ff;">$lusers</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$a</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000066;">keys</span> <span style="color: #0000ff;">%lusers</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;|   %3d   | %32s |<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$lusers</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$luser</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$luser</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;---------------------------------------------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>--<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$CONAME<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>MAIL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#email a warning to people over quota</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$MAIL_WARNING</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$luser</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">keys</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">%lusers</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$lusers</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$luser</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">&gt;=</span> <span style="color: #0000ff;">$WARNPERCENT</span><span style="color: #339933;">;</span>       <span style="color: #666666; font-style: italic;"># skip those under quota</span>
           <span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>MAIL<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;| $MAILPROG&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">select</span><span style="color: #009900;">&#40;</span>MAIL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;To: $luser<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span><span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;BCC: $_<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">@POSTMASTERS</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;From: $SUADDR<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Subject: WARNING: Your mailbox is $lusers{$luser}% full.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Reply-to: $SUADDR<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Your mailbox: $luser is $lusers{$luser}% full.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Please consider deleting e-mail and emptying your trash folder to clear some space.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Contact &lt;$SUADDR&gt; for further assistance.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Thank You.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;--<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$CONAME<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
           <span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>MAIL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>3. Edit next lines inside and set up your postmaster email address, percentage, etc</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$POSTFIX_CF</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/etc/postfix/main.cf&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$MAILPROG</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/usr/sbin/sendmail -t&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$WARNPERCENT</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@POSTMASTERS</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'postmaster@mydomain.tld'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$CONAME</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'Company ....'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$COADDR</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'postmaster@mydomain.tld'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$SUADDR</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'postmaster@mydomain.tld'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$MAIL_REPORT</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$MAIL_WARNING</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre></div></div>

<p>4. set chmod 755 on quota_notify (# chmod 755 /usr/local/sbin/quota_notify)</p>
<p>5. add next line to crontab so it will be executed at 0:00 every day.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">0 0 * * * /usr/local/sbin/quota_notify &amp;&gt; /dev/null</pre></div></div>

<p>Keep in mind that this script has only reporting purpose and it will not reject any email when user mailbox is over quota. For this you will need Postfix with quota patch.</p>
<p>This post was inspired by this <a href="http://www.howtoforge.com/forums/showthread.php?t=10883" target="_blank">LINK</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/08/postfix-quota-notification-email-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch processing millions of images</title>
		<link>http://www.serveradminblog.com/2010/07/batch-processing-millions-of-images/</link>
		<comments>http://www.serveradminblog.com/2010/07/batch-processing-millions-of-images/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 07:47:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=140</guid>
		<description><![CDATA[I just want to share one link about processing millions of images. Here it is LINK]]></description>
			<content:encoded><![CDATA[<p>I just want to share one link about processing millions of images. Here it is <a href="http://codeascraft.etsy.com/2010/07/09/batch-processing-millions-of-images/">LINK</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/07/batch-processing-millions-of-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using PHP as a shell scripting language</title>
		<link>http://www.serveradminblog.com/2010/07/using-php-as-a-shell-scripting-language/</link>
		<comments>http://www.serveradminblog.com/2010/07/using-php-as-a-shell-scripting-language/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 12:28:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=133</guid>
		<description><![CDATA[As most of us already know, PHP is one of the most popular scripting language for developing dynamic web pages. But you probably don&#8217;t know that PHP can be used as a shell scripting language. It isn&#8217;t robust as Bash or Perl but it has some advantages. The only difference between a PHP shell script [...]]]></description>
			<content:encoded><![CDATA[<p>As most of us already know, PHP is one of the most popular scripting language for developing dynamic web pages. But you probably don&#8217;t know that PHP can be used as a shell scripting language. It isn&#8217;t robust as Bash or Perl but it has some advantages. </p>
<p>The only difference between a PHP shell script and a regular PHP file which serves web page is the first line:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/php -q</span></pre></div></div>

<p>The &#8216;-q&#8217; switch is here to suppress the HTTP headers. After the first line, you just add standard PHP tags:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Here is the example so you can see what I&#8217;m talking about:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">#!/usr/bin/php -q
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
    <span style="color: #b1b100;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hi there folks !<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Save these lines as test.php and execute with:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># php test.php</pre></div></div>

<p>Good idea is to add the next lines at the beginning:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;argv&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_METHOD'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>  <span style="color: #339933;">||</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;br&gt;&lt;strong&gt;Shell access only&lt;/strong&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>In this case, this script can be accessible via browser but those lines will kill the script in case if it is issued via browser.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/07/using-php-as-a-shell-scripting-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check what ports are open</title>
		<link>http://www.serveradminblog.com/2010/07/check-what-ports-are-open/</link>
		<comments>http://www.serveradminblog.com/2010/07/check-what-ports-are-open/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 09:37:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=127</guid>
		<description><![CDATA[To see what ports are open in your Linux box, you can use nmap port scanner or you can use netstat. nmap can be used with following command: # nmap -sS -O 127.0.0.1 The answer will be something like: Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2010-07-08 11:31 CEST Interesting ports on localhost.localdomain (127.0.0.1): Not [...]]]></description>
			<content:encoded><![CDATA[<p>To see what ports are open in your Linux box, you can use nmap port scanner or you can use netstat. </p>
<p>nmap can be used with following command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># nmap -sS -O 127.0.0.1</pre></div></div>

<p>The answer will be something like:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2010-07-08 11:31 CEST
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1663 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
80/tcp   open  http
110/tcp  open  pop3
111/tcp  open  rpcbind
143/tcp  open  imap
993/tcp  open  imaps
995/tcp  open  pop3s
3306/tcp open  mysql
8009/tcp open  ajp13
8080/tcp open  http-proxy
8443/tcp open  https-alt
No exact OS matches for host (If you know what OS is running on it, see http://www.insecure.org/cgi-bin/nmap-submit.cgi).
......
&nbsp;
Uptime 15.472 days (since Wed Jun 23 00:12:46 2010)
&nbsp;
Nmap finished: 1 IP address (1 host up) scanned in 9.558 seconds</pre></div></div>

<p>and nmap can be used to scan remote hosts (keep in mind that many admins will notice this as hack attempt). Simple replace 127.0.0.1 with host IP address. </p>
<p>Another way to check open ports is via netstat. Netstat can show hidden ports and programs associated with ports. Simple execute next command as root:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># netstat -nap</pre></div></div>

<p>The output list can be very long (depending from your network activity).</p>
<p>Note: Use this tips carefully. I&#8217;m not responsible for any potential damage&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/07/check-what-ports-are-open/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Panda USB and AutoRun Vaccine</title>
		<link>http://www.serveradminblog.com/2010/06/panda-usb-and-autorun-vaccine/</link>
		<comments>http://www.serveradminblog.com/2010/06/panda-usb-and-autorun-vaccine/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 21:43:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AntiVirus]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=109</guid>
		<description><![CDATA[The MS Windows OS-es uses the AUTORUN.INF file from removable drives (USB, CD, DVD,&#8230;) in order to know which actions to perform when a new external storage device is inserted into the PC. This is good for movies, install CDs and other friendly &#8220;things&#8221; but unfortunately the malware uses the same way to attack your [...]]]></description>
			<content:encoded><![CDATA[<p>The MS Windows OS-es uses the AUTORUN.INF file from removable drives (USB, CD, DVD,&#8230;) in order to know which actions to perform when a new external storage device is inserted into the PC. This is good for movies, install CDs and other friendly &#8220;things&#8221; but unfortunately the malware uses the same way to attack your computer&#8230; </p>
<p><span id="more-109"></span></p>
<p>The AUTORUN.INF file is a configuration file that is normally located in the root directory of removable media. The malware achieves this by copying a malicious executable in the drive and modifying the AUTORUN.INF file. Windows will open this malicious file silently as soon as the drive is mounted and you probably wouldn&#8217;t notice this until you see something strange with your computer. Then it is already to late <img src='http://www.serveradminblog.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  </p>
<p>Panda USB Vaccine is a free solution designed to protect your computer against this threats. You can disable AutoRun feature on computer and USB drives. This is a very useful tool as there is no easiest way to disable the AutoRun feature. </p>
<p><img src="http://i5.photobucket.com/albums/y157/mangia/usbvaccine.jpg" alt="USB" /></p>
<p>When ever you insert USB removable drive, you will be asked to vaccinate it. </p>
<p><strong>Part 2</strong></p>
<p>The lines above are made for regular Windows users and here is the hard way to &#8220;vaccinate&#8221; your removable drives without Panda software.</p>
<p>If you don&#8217;t have autorun.inf file on your removable drive, create a blank autorun.inf with your favorite text editor (Notepad or Notepad2 for example). The main idea is to have autorun.inf on your drive, but it should be &#8220;damaged&#8221; so we won&#8217;t be able to delete it (unless you format your drive), edit, rename, etc. I forget to say, that you should leave this file empty (blank).</p>
<p>Its best to make sure the USB key is blank or data backed up before going to next step. Download HEX editor for Windows (for example HxD) and open your USB device in read and write mode (Extras &#8211; Open Disk &#8211; choose USB drive and remove check box from &#8220;Open as Readonly&#8221;). Search the disk for the string “autorun” in non-unicode form.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">41 55 54 4F 52 55 4E 20 49 4E 46 20
A  U  T  O  R  U  N     I  N  F</pre></div></div>

<p>All we need to change is the last byte. The current value of the byte is 0×20 has the archive bit set. Change this byte to 0×40, which sets the device bit (which is never normally found on a disk) and save changes. </p>
<p><img src="http://i5.photobucket.com/albums/y157/mangia/autorunlock-1.jpg" alt="HxD" /></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">41 55 54 4F 52 55 4E 20 49 4E 46 40
A  U  T  O  R  U  N     I  N  F  @</pre></div></div>

<p>To test this operation, try to delete autorun.inf file. You should see the warning pop-up with an error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/06/panda-usb-and-autorun-vaccine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fsck in CentOS 5.x howto</title>
		<link>http://www.serveradminblog.com/2010/06/fsck-in-centos-5-x-howto/</link>
		<comments>http://www.serveradminblog.com/2010/06/fsck-in-centos-5-x-howto/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 14:06:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=116</guid>
		<description><![CDATA[fsck is used to check and optionally repair one or more Linux file systems. File system can be a device name (e.g. /dev/sda2), a mount point (e.g. /, /usr,&#8230; ), or an ext2 label or UUID specifier. By default, the fsck will try to handle filesystems on different physical disk drives in parallel to reduce [...]]]></description>
			<content:encoded><![CDATA[<p>fsck is used to check and optionally repair one or more Linux file systems. File system can be a device name (e.g. /dev/sda2), a mount point (e.g. /, /usr,&#8230; ), or an ext2 label or UUID specifier. By default, the fsck will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesystems.</p>
<p><span id="more-116"></span></p>
<p>I hope you won&#8217;t need this instructions but in case you have some problems &#8230;</p>
<p>First, keep in mind that running fsck on a mounted file system can result in data corruption so use this commands at your own risk. I&#8217;m not responsible for any damage you may cause. </p>
<p>To avoid this, you can:</p>
<ul>
<li>Change the running state of the system to single user mode and unmount the file system</li>
<p> (Note: Skip this option if you need to check / part.)</p>
<li>Boot the computer into Rescue Mode using the installation CD</li>
</ul>
<p><strong>1) Single user mode</strong></p>
<p>Change the run level to 1 and unmont the file system with (I suppose the /home was affected with problems)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># init 1
# umount /home</pre></div></div>

<p>Then run fsck with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># fsck /dev/sda2</pre></div></div>

<p><strong>2) Rescue mode with install CD</strong></p>
<p>Insert the Installation CD into the drive and reboot your system with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># reboot</pre></div></div>

<p>Wait a while and after booting from the Installation CD type in command prompt:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># linux rescue nomount</pre></div></div>

<p>Note: nomount directive will skip mounting so you can safely run fsck on your filesystem</p>
<p>Then enter</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># fsck -yvf /dev/sda2</pre></div></div>

<p>where /dev/sda2 is problematic partition.<br />
Note: -yvf means<br />
-y attempt to fix any detected filesystem corruption automatically (answer all questions with &#8220;yes&#8221;)<br />
-f force a check even if reported in a clean state<br />
-v verbose output, including all file system-specific commands that are executed (you will see all errors and recovery process)</p>
<p><strong>LVM Partitions</strong><br />
Situation with LVM partitions is a little different. To run fsck on lvm partitions first you need to find the pv’s, vg’s, lv’s and then to activate them.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># lvm pvscan
# lvm vgscan
# lvm lvchange -ay VolGroup00
# lvm lvscan
&nbsp;
# fsck -yfv /dev/VolGroup00/LogVol00</pre></div></div>

<p>fsck can be scheduled on boot with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># shutdown -Fr now</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/06/fsck-in-centos-5-x-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Workbench</title>
		<link>http://www.serveradminblog.com/2010/06/mysql-workbench/</link>
		<comments>http://www.serveradminblog.com/2010/06/mysql-workbench/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 08:54:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=113</guid>
		<description><![CDATA[MySQL Workbench is a cross-platform, visual database design tool developed by MySQL. It is the highly anticipated successor application of the DBDesigner4 project. MySQL Workbench will be available as a native GUI tool on Window, Linux and OS X. MySQL Workbench 5.2 RC provides: 1. Data Modeling 2. Query (upgrade from MySQL Query Browser) 3. [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL Workbench is a cross-platform, visual database design tool developed by MySQL. It is the highly anticipated successor application of the DBDesigner4 project. MySQL Workbench will be available as a native GUI tool on Window, Linux and OS X. </p>
<p>MySQL Workbench 5.2 RC provides:<br />
   1. Data Modeling<br />
   2. Query (upgrade from MySQL Query Browser)<br />
   3. Admin (upgrade from MySQL Administrator)</p>
<p>Please get your copy from <a href="http://dev.mysql.com/downloads/workbench/" target="_blank">this page</a></p>
<p><img class="aligncenter" title="MySQL WB" src="http://i5.photobucket.com/albums/y157/mangia/ostalo/wb_diagam_fk_highlight1.png" alt="" width="319" height="250" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/06/mysql-workbench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MotoDev Studio for Android</title>
		<link>http://www.serveradminblog.com/2010/05/motodev-studio-for-android/</link>
		<comments>http://www.serveradminblog.com/2010/05/motodev-studio-for-android/#comments</comments>
		<pubDate>Sun, 16 May 2010 23:27:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=104</guid>
		<description><![CDATA[MotoDev Studio for Android is Motorola&#8217;s integrated development environment based on Eclipse which forms complete development package. One installer ensures an integrated development environment with Eclipse 3.5 and Android Development Tools (ADT) plus automatic download and configuration of the latest Android SDK. If you already have Eclipse and you want to do develop Android apps, [...]]]></description>
			<content:encoded><![CDATA[<p>MotoDev Studio for Android is Motorola&#8217;s integrated development environment based on Eclipse which forms complete development package. One installer ensures an integrated development environment with Eclipse 3.5 and Android Development Tools (ADT) plus automatic download and configuration of the latest Android SDK. </p>
<p><span id="more-104"></span></p>
<p>If you already have Eclipse and you want to do develop Android apps, you can manually install ADT as described <a href="http://developer.android.com/sdk/installing.html" target="_blank">here</a>.</p>
<p>Useful links:<br />
<a href="http://developer.motorola.com/" target="_blank">MotoDev Studio</a><br />
<a href="http://eclipse.org/" target="_blank">Eclipse</a><br />
<a href="http://developer.android.com/sdk/installing.html" target="_blank">Installing the SDK</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/05/motodev-studio-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The worst software I ever used was&#8230;</title>
		<link>http://www.serveradminblog.com/2010/05/the-worst-software-i-ever-used-was/</link>
		<comments>http://www.serveradminblog.com/2010/05/the-worst-software-i-ever-used-was/#comments</comments>
		<pubDate>Thu, 13 May 2010 08:10:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=97</guid>
		<description><![CDATA[What is the worst, the most poorly designed, buggiest, prone-to-breakdown, driver-devouring, update-eluding, the worst piece of crap application  you&#8217;ve ever see? It is hard to say, but lets be honest&#8230; Samsung PC Studio is the first candidate for this title&#8230; Three years ago, I bought Samsung D900 mobile phone and I must admit that this [...]]]></description>
			<content:encoded><![CDATA[<p>What is the worst, the most poorly designed, buggiest,  prone-to-breakdown, driver-devouring, update-eluding,  the worst piece of crap application  you&#8217;ve ever see? It is hard to say, but lets be honest&#8230; Samsung PC Studio is the first candidate for this title&#8230;</p>
<p><span id="more-97"></span></p>
<p>Three years ago, I bought Samsung D900 mobile phone and I must admit that this phone is very good. I was worried about their slider mechanism. After hundreds slides it still works perfectly and I didn&#8217;t had any problems with this phone. I still use the original battery,  display works perfectly&#8230;. Ops&#8230; I forget that camera doesn&#8217;t work any more&#8230; I don&#8217;t know why&#8230; The picture is to dark and I can&#8217;t see anything. </p>
<p>But&#8230; If you want to manage your phonebook, messages or files directly from your computer,  you&#8217;ll need Samsung PC Studio&#8230;. The app is so stupid and buggy that I can&#8217;t understand. I tried to use it on more than 5 different computers. Unfort. only once I made it. After first PC Studio update I could say bye-bye to my phone-PC relationship. Only option I had, was to transfer music and images to SD card and then to phone. Sometimes the error was that I can see folders but I can&#8217;t delete them, or I can&#8217;t upload anything, or the computer simple don&#8217;t see phone, or everything works fine but my phone book is unavailable, unreadable, bla bla&#8230; </p>
<p>Luckily, bluetooth on the phone works fine so I finally made a phone book backup. </p>
<p>Few days ago, I bought the brand new Samsung i5700 Spica with Android&#8230; Fantastic piece of the hardware but to install USB drivers, I should first install &#8220;NPS&#8221; or in other words New PC Studio&#8230;. Oh my dear&#8230; This app has completely different approach. Design is so stupid that I&#8217;m not sure whats the main purpose. Is this game? Cartoon? Spyware? Some icons flying around, desktop inside desktop, sound which irritates you (yes, some of us don&#8217;t like stupid sounds in the middle of the night). Sure, if you&#8217;re 11 years old, this can look interesting but&#8230; </p>
<p>Of course, the install procedure on Win7 64b wasn&#8217;t successful and USB drivers are not installed properly (even when I run them in XP or Vista compatibility mode)&#8230; </p>
<p>I know that some of you don&#8217;t think like my opinion, but the Samsung developers can be candidate for the worst in the world. Their software designers seems like they came from the past (or future, I&#8217;m not sure). All people around me, have the same opinion. All of them had some kind of problems with Samsung PC studio. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/05/the-worst-software-i-ever-used-was/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Releasing a message from a quarantine with amavisd-relase</title>
		<link>http://www.serveradminblog.com/2010/05/releasing-a-message-from-a-quarantine-with-amavisd-relase/</link>
		<comments>http://www.serveradminblog.com/2010/05/releasing-a-message-from-a-quarantine-with-amavisd-relase/#comments</comments>
		<pubDate>Mon, 10 May 2010 09:45:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Amavisd-new]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=92</guid>
		<description><![CDATA[amavisd-new is a high-performance and reliable interface between mailer (MTA) and one or more content checkers: virus scanners, and/or Mail::SpamAssassin Perl module. It is written in Perl, ensuring high reliability, portability and maintainability. It talks to MTA via (E)SMTP or LMTP protocols, or by using helper programs. No timing gaps exist in the design, which [...]]]></description>
			<content:encoded><![CDATA[<p>amavisd-new is a high-performance and reliable interface between mailer (MTA) and one or more content checkers: virus scanners, and/or Mail::SpamAssassin Perl module. It is written in Perl, ensuring high reliability, portability and maintainability. It talks to MTA via (E)SMTP or LMTP protocols, or by using helper programs. No timing gaps exist in the design, which could cause a mail loss. </p>
<p>In other words, amavisd-new will help you to fight against spam. In this post, I won&#8217;t write about installation (coming soon in you theaters)</p>
<p>This post is just a small trick which will help you to release specific message from quarantine (false positive or you simple want to read spam messages)</p>
<p>Fist you need to find message inside the messages log file (usually /var/log/messages)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">May 10 10:06:56 ns1 amavis[12774]: (12774-13) Blocked SPAM, [207.46.22.35] [207.46.22.35] &lt;cnfrmpro@microsoft.com&gt; -&gt; &lt;mymail@domain.tld&gt;, quarantine: spam-1lvc624m6MVB.gz, Message-ID: &lt;BY2MSFTVSMTP03Dfn8e0003d305@by2msftvsmtp03.phx.gbl&gt;, mail_id: 1lvc624m6MVB, Hits: 7.743, size: 3013, 4325 ms</pre></div></div>

<p>As you can see above, it is <em>spam-1lvc624m6MVB.gz</em></p>
<p>Now you can release specific message with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@s1 ~]# amavisd-release spam-1lvc624m6MVB.gz</pre></div></div>

<p>And you will see something like</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">250 2.0.0 Ok, id=rel-1lvc624m6MVB, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 403206AF07CE</pre></div></div>

<p>Now you just need to check your inbox and you should see the message. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/05/releasing-a-message-from-a-quarantine-with-amavisd-relase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
