<?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 &#187; Postfix</title>
	<atom:link href="http://www.serveradminblog.com/category/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serveradminblog.com</link>
	<description>Short Circuit...</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:56:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mail relay testing service</title>
		<link>http://www.serveradminblog.com/2011/09/mail-relay-testing-service/</link>
		<comments>http://www.serveradminblog.com/2011/09/mail-relay-testing-service/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 10:10:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=356</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/09/mail-relay-testing-service/' addthis:title='Mail relay testing service '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>In case you want to check your mail servers for relaying, check the next link: LINK.]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2011/09/mail-relay-testing-service/' addthis:title='Mail relay testing service '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>In case you want to check your mail servers for relaying, check the next link: <a href="http://www.abuse.net/relay.html">LINK</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2011/09/mail-relay-testing-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/08/postfix-quota-notification-email-script/' addthis:title='Postfix quota notification email script '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>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[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/08/postfix-quota-notification-email-script/' addthis:title='Postfix quota notification email script '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><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>1</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[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/05/releasing-a-message-from-a-quarantine-with-amavisd-relase/' addthis:title='Releasing a message from a quarantine with amavisd-relase '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>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[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/05/releasing-a-message-from-a-quarantine-with-amavisd-relase/' addthis:title='Releasing a message from a quarantine with amavisd-relase '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><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>
		<item>
		<title>Config mta &#8211; howto</title>
		<link>http://www.serveradminblog.com/2010/04/config-mta-howto/</link>
		<comments>http://www.serveradminblog.com/2010/04/config-mta-howto/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 07:09:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=79</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/04/config-mta-howto/' addthis:title='Config mta &#8211; howto '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Centos has a neat application for switching between alternative software packages, called alternatives. Few days ago I noticed that one server doesn&#8217;t send logwatch email. I wanted to see what was the reason and here are the few tips you can check before you dig inside logwatch settings. First, check /etc/aliases and root email inside [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/04/config-mta-howto/' addthis:title='Config mta &#8211; howto '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Centos has a neat application for switching between alternative software packages, called <em>alternatives</em>.</p>
<p>Few days ago I noticed that one server doesn&#8217;t send logwatch email. I wanted to see what was the reason and here are the few tips you can check before you dig inside logwatch settings. </p>
<p>First, check /etc/aliases and root email inside</p>

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

<p>at the end, check next lines:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Person who should get root's mail
root:           blabla@domain.tld</pre></div></div>

<p>After you save aliases, enter command</p>

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

<p>This command rebuilds the random access data base for the mail aliases file /etc/aliases. It must be run each time this file is changed in order for the change to take effect. This would be enough to receive all email directed to root, but in case you still don&#8217;t get root emails, check mta with:</p>

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

<p>This will show you something like</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@s1 ~]# alternatives --display mta
mta - status is manual.
 link currently points to /usr/sbin/sendmail.sendmail
/usr/sbin/sendmail.sendmail - priority 90
 slave mta-pam: /etc/pam.d/smtp.sendmail
 slave mta-mailq: /usr/bin/mailq.sendmail
 slave mta-newaliases: /usr/bin/newaliases.sendmail
 slave mta-rmail: /usr/bin/rmail.sendmail
 slave mta-sendmail: /usr/lib/sendmail.sendmail
 slave mta-mailqman: /usr/share/man/man1/mailq.sendmail.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.sendmail.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.sendmail.5.gz
 slave mta-sendmailman: /usr/share/man/man8/sendmail.sendmail.8.gz
/usr/sbin/sendmail.postfix - priority 30
 slave mta-pam: /etc/pam.d/smtp.postfix
 slave mta-mailq: /usr/bin/mailq.postfix
 slave mta-newaliases: /usr/bin/newaliases.postfix
 slave mta-rmail: /usr/bin/rmail.postfix
 slave mta-sendmail: /usr/lib/sendmail.postfix
 slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
 slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /usr/sbin/sendmail.sendmail.</pre></div></div>

<p>We use postfix so we should change this with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@s1 ~]# alternatives --config mta
&nbsp;
There are 2 programs which provide 'mta'.
&nbsp;
  Selection    Command
-----------------------------------------------
*+ 1           /usr/sbin/sendmail.sendmail
   2           /usr/sbin/sendmail.postfix
&nbsp;
Enter to keep the current selection[+], or type selection number:</pre></div></div>

<p>Enter 2 and press <em>Enter</em>. Then check your mta with</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@s1 ~]# alternatives --display mta
mta - status is manual.
 link currently points to /usr/sbin/sendmail.postfix</pre></div></div>

<p>That&#8217;s it&#8230; Now if your logwatch is configured properly you should receive root emails&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/04/config-mta-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to whitelist hosts or IP addresses in Postfix</title>
		<link>http://www.serveradminblog.com/2010/03/how-to-whitelist-hosts-or-ip-addresses-in-postfix/</link>
		<comments>http://www.serveradminblog.com/2010/03/how-to-whitelist-hosts-or-ip-addresses-in-postfix/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 10:52:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.serveradminblog.com/?p=28</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/03/how-to-whitelist-hosts-or-ip-addresses-in-postfix/' addthis:title='How to whitelist hosts or IP addresses in Postfix '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>If you are administrating a mail server and use blacklists to block spam, sometimes you may have a problem with certain mail servers. This happens because a specific mail server was blacklisted. You can see that one server was blacklisted if you trace your maillog: reject: RCPT from unknown[196.206.244.208]: 554 5.7.1 Service unavailable; Client host [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.serveradminblog.com/2010/03/how-to-whitelist-hosts-or-ip-addresses-in-postfix/' addthis:title='How to whitelist hosts or IP addresses in Postfix '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>If you are administrating a mail server and use blacklists to block spam, sometimes you may have a problem with certain mail servers. This happens because a specific mail server was blacklisted. You can see that one server was blacklisted if you trace your maillog:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">reject: RCPT from unknown[196.206.244.208]: 554 5.7.1 Service unavailable; Client host [196.206.244.208] blocked using bl.spamcop.net; Blocked - see http://www.spamcop.net/bl.shtml?196.206.244.208; from=&lt;laya@mymail.com&gt; to=&lt;laya@mymail.com&gt; proto=SMTP helo=&lt;aimp.org&gt;</pre></div></div>

<p>In this example, the mail server 196.206.244.208 is blacklisted and therefore blocked (also in this case,  message was spam and we won&#8217;t whitelist 196.206.244.208).</p>
<p>To whitelist servers, we need one file (for example /etc/postfix/rbl_whitelist) where we will list all IP addresses or host names marked for whitelist.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># nano /etc/postfix/rbl_whitelist</pre></div></div>

<p>Every line should contain only one IP address or one hostname in next format</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">196.196.196.196 OK
mail.mymail.com OK</pre></div></div>

<p>Save file and then run:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># postmap /etc/postfix/rbl_whitelist</pre></div></div>

<p>After you created whitelist in postfix format, open /etc/postfix/main.cf and search for the smtpd_recipient_restrictions parameter. Add<br />
<strong>check_client_access hash:/etc/postfix/rbl_whitelist</strong><br />
after reject_unauth_destination, but before the first blacklist. </p>
<p><strong>Remember BEFORE the first blacklist or this won&#8217;t work. </strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">smtpd_recipient_restrictions = reject_invalid_hostname,
                               reject_unauth_pipelining,
                               permit_mynetworks,
                               permit_sasl_authenticated,
                               reject_unauth_destination,
                               check_client_access hash:/etc/postfix/rbl_whitelist,
                               reject_rbl_client dsn.rfc-ignorant.org,
                               reject_rbl_client dul.dnsbl.sorbs.net,
                               reject_rbl_client sbl-xbl.spamhaus.org,
                               reject_rbl_client bl.spamcop.net,
                               permit</pre></div></div>

<p><em>The lines shown above is only example. Please check all those blacklist because some of them are not active any more&#8230;.</em></p>
<p>And finally reload postfix with</p>

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

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/init.d/postfix restart</pre></div></div>

<p><strong>Edit</strong><br />
<strong>Remember that smtpd_recipient_restrictions section mentioned above is just for reference. Please double check this blacklists before you use them. (Some of them doesn&#8217;t work any more). Especially if you find this post 3 years after I wrote it&#8230;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveradminblog.com/2010/03/how-to-whitelist-hosts-or-ip-addresses-in-postfix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

