<?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>Case &#187; postfix</title>
	<atom:link href="http://case.net.ru/tag/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://case.net.ru</link>
	<description>Just another technical weblog</description>
	<lastBuildDate>Sat, 19 Jun 2010 14:06:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Отчистка почтовой очереди Exim и Postfix</title>
		<link>http://case.net.ru/2009/10/31/%d0%be%d1%82%d1%87%d0%b8%d1%81%d1%82%d0%ba%d0%b0-%d0%bf%d0%be%d1%87%d1%82%d0%be%d0%b2%d0%be%d0%b9-%d0%be%d1%87%d0%b5%d1%80%d0%b5%d0%b4%d0%b8-exim-%d0%b8-postfix/</link>
		<comments>http://case.net.ru/2009/10/31/%d0%be%d1%82%d1%87%d0%b8%d1%81%d1%82%d0%ba%d0%b0-%d0%bf%d0%be%d1%87%d1%82%d0%be%d0%b2%d0%be%d0%b9-%d0%be%d1%87%d0%b5%d1%80%d0%b5%d0%b4%d0%b8-exim-%d0%b8-postfix/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 16:08:57 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=715</guid>
		<description><![CDATA[Exim Просмотр очереди: exim -bp Удаление сообщения: exim -Mrm &#123;message-id&#125; Удаление всех сообщений: exim -bp &#124; awk '/^ *[0-9]+[mhd]/{print &#34;exim -Mrm &#34; $3}' &#124; bash Postfix Просмотр очереди: postqueue -p Удаление сообщения: postsuper -d - &#123;message-id&#125; Удаление всех сообщений: postsuper -d ALL]]></description>
			<content:encoded><![CDATA[<p><b>Exim</b></p>
<p>Просмотр очереди:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">exim <span style="color: #660033;">-bp</span></pre></div></div>

</p>
<p>Удаление сообщения:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">exim <span style="color: #660033;">-Mrm</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>message-id<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

</p>
<p>Удаление всех сообщений:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">exim <span style="color: #660033;">-bp</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/^ *[0-9]+[mhd]/{print &quot;exim -Mrm &quot; $3}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bash</span></pre></div></div>

</p>
<p><b>Postfix</b></p>
<p>Просмотр очереди:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">postqueue <span style="color: #660033;">-p</span></pre></div></div>

</p>
<p>Удаление сообщения:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">postsuper <span style="color: #660033;">-d</span> - <span style="color: #7a0874; font-weight: bold;">&#123;</span>message-id<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

</p>
<p>Удаление всех сообщений:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">postsuper <span style="color: #660033;">-d</span> ALL</pre></div></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/10/31/%d0%be%d1%82%d1%87%d0%b8%d1%81%d1%82%d0%ba%d0%b0-%d0%bf%d0%be%d1%87%d1%82%d0%be%d0%b2%d0%be%d0%b9-%d0%be%d1%87%d0%b5%d1%80%d0%b5%d0%b4%d0%b8-exim-%d0%b8-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Настраиваем SPF для Postfix и Bind</title>
		<link>http://case.net.ru/2009/04/19/spf/</link>
		<comments>http://case.net.ru/2009/04/19/spf/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 08:36:04 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[policyd]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spf]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=439</guid>
		<description><![CDATA[Задача: при приеме почты проверять SPF запись домена отправителя прописать SPF запись для своего домена Устанавливаем добавку для postfix&#8217;a: 1 2 $ cd /usr/ports/mail/postfix-policyd-spf $ make install clean Добавляем в /usr/local/etc/postfix/master.cf: 1 2 policy unix - n n - - spawn user=nobody argv=/usr/local/sbin/postfix-policyd-spf Добавляем в /usr/local/etc/postfix/main.cf: 1 2 3 4 smtpd_recipient_restrictions = ... reject_unknown_sender_domain reject_unauth_destination [...]]]></description>
			<content:encoded><![CDATA[<p>Задача:</p>
<ul>
<li>при приеме почты проверять SPF запись домена отправителя</li>
<li>прописать SPF запись для своего домена</li>
</ul>
<p>Устанавливаем добавку для postfix&#8217;a:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>postfix-policyd-spf
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></td></tr></table></div>

<p>Добавляем в /usr/local/etc/postfix/master.cf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">policy  unix  -       n       n       -       -       spawn
  <span style="color: #007800;">user</span>=nobody <span style="color: #007800;">argv</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>postfix-policyd-spf</pre></td></tr></table></div>

<p>Добавляем в /usr/local/etc/postfix/main.cf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">smtpd_recipient_restrictions = ...
                               reject_unknown_sender_domain
                               reject_unauth_destination
                               check_policy_service unix:private<span style="color: #000000; font-weight: bold;">/</span>policy</pre></td></tr></table></div>

<p>После этого в заголовках входящих писем будет заголовок Received-SPF:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Received-SPF: softfail <span style="color: #7a0874; font-weight: bold;">&#40;</span>case.net.ru: transitioning domain of globalevent.ru does not designate 77.113.141.27 <span style="color: #c20cb9; font-weight: bold;">as</span> permitted sender<span style="color: #7a0874; font-weight: bold;">&#41;</span> client-ip=77.113.141.27; envelope-from=thawsm<span style="color: #000000; font-weight: bold;">@</span>globalevent.ru; <span style="color: #007800;">helo</span>=apn-<span style="color: #000000;">77</span>-<span style="color: #000000;">113</span>-<span style="color: #000000;">141</span>-27.gprs.plus.pl;</pre></td></tr></table></div>

<p>Возникла проблема, при включенной проверке spf &#8211; spamooborona падает. Как решить пока не знаю. Вот лог:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Apr <span style="color: #000000;">19</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">18</span> <span style="color: #000000; font-weight: bold;">case</span> postfix<span style="color: #000000; font-weight: bold;">/</span>pipe<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">92687</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: 5293F1E3025: <span style="color: #007800;">to</span>=<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight: bold;">case</span><span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #000000; font-weight: bold;">&gt;</span>, <span style="color: #007800;">relay</span>=so-filter, <span style="color: #007800;">delay</span>=<span style="color: #000000;">0.19</span>, <span style="color: #007800;">delays</span>=<span style="color: #000000;">0.16</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.01</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.02</span>, <span style="color: #007800;">dsn</span>=5.3.0, <span style="color: #007800;">status</span>=bounced <span style="color: #7a0874; font-weight: bold;">&#40;</span>Command died with signal <span style="color: #000000;">11</span>: <span style="color: #ff0000;">&quot;/usr/local/sbin/sp-postfix&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>В Bind, добавляем для своего домена spf запись:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">case.net.ru. IN TXT <span style="color: #ff0000;">&quot;v=spf1 +a +mx -all&quot;</span></pre></td></tr></table></div>

<p>Теперь, если на сервере получателя письма настроен SPF, то письма будут приходить со следующим заголовком:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Received-SPF: pass <span style="color: #7a0874; font-weight: bold;">&#40;</span>test.myiptest.com: domain of case.net.ru designates 213.79.110.123 <span style="color: #c20cb9; font-weight: bold;">as</span> permitted sender<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>Ссылки:</p>
<p>http://www.openspf.org/</p>
<p>http://www.myiptest.com/staticpages/index.php/DomainKeys-DKIM-SPF-Validator-test</p>
]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/04/19/spf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Установка и настройка ClamSMTP для Postfix</title>
		<link>http://case.net.ru/2009/04/15/clamsmtp/</link>
		<comments>http://case.net.ru/2009/04/15/clamsmtp/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 15:47:35 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[clamsmtp]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=430</guid>
		<description><![CDATA[Установка: 1 2 3 4 5 6 7 $ cd /usr/ports/security/clamsmtp $ make showconfig ===&#62; The following configuration options are available for clamsmtp-1.10_1: LOCAL_CLAMAV=on &#34;RUN_DEPEND on security/clamav&#34; LOCAL_CLAMAV_DEVEL=off &#34;RUN_DEPEND on security/clamav-devel&#34; ===&#62; Use 'make config' to modify these settings $ make install clean Прописываем в rc.conf: 1 clamsmtpd_enable=&#34;YES&#34; Копируем конфиг: 1 2 $ cd /usr/local/etc/ [...]]]></description>
			<content:encoded><![CDATA[<p>Установка:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>security<span style="color: #000000; font-weight: bold;">/</span>clamsmtp
$ <span style="color: #c20cb9; font-weight: bold;">make</span> showconfig
===<span style="color: #000000; font-weight: bold;">&gt;</span> The following configuration options are available <span style="color: #000000; font-weight: bold;">for</span> clamsmtp-<span style="color: #000000;">1.10</span>_1:
     <span style="color: #007800;">LOCAL_CLAMAV</span>=on <span style="color: #ff0000;">&quot;RUN_DEPEND on security/clamav&quot;</span>
     <span style="color: #007800;">LOCAL_CLAMAV_DEVEL</span>=off <span style="color: #ff0000;">&quot;RUN_DEPEND on security/clamav-devel&quot;</span>
===<span style="color: #000000; font-weight: bold;">&gt;</span> Use <span style="color: #ff0000;">'make config'</span> to modify these settings
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></td></tr></table></div>

<p>Прописываем в rc.conf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">clamsmtpd_enable</span>=<span style="color: #ff0000;">&quot;YES&quot;</span></pre></td></tr></table></div>

<p>Копируем конфиг:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> clamsmtpd.conf-sample clamsmtpd.conf</pre></td></tr></table></div>

<p>Настраиваем:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">OutAddress: 127.0.0.1:<span style="color: #000000;">1026</span>
Listen: 127.0.0.1:<span style="color: #000000;">1025</span>
ClamAddress: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>clamav<span style="color: #000000; font-weight: bold;">/</span>clamd.sock
User: clamav</pre></td></tr></table></div>

<p>Запускаем:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>clamsmtpd start</pre></td></tr></table></div>

<p>Настраиваем master.cf в Postfix&#8217;e (в моем случае подключена еще и спамоборона):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">smtp      inet  n       -       n       -       -       smtpd
    <span style="color: #660033;">-o</span> <span style="color: #007800;">content_filter</span>=so-filter
127.0.0.1:<span style="color: #000000;">1026</span>  inet  n       -       n       -       -       smtpd
    <span style="color: #660033;">-o</span> content-filter=
so-filter     unix  -       n       n       -       -       pipe
    <span style="color: #007800;">flags</span>=q. <span style="color: #007800;">user</span>=souser <span style="color: #007800;">argv</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>sp-postfix
    <span style="color: #660033;">-a</span> <span style="color: #800000;">${client_address}</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${sender}</span> <span style="color: #660033;">--</span> <span style="color: #800000;">${recipient}</span></pre></td></tr></table></div>

<p>Путь письма при этом выглядит так:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">mail -<span style="color: #000000; font-weight: bold;">&gt;</span> smtpd <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">25</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> -<span style="color: #000000; font-weight: bold;">&gt;</span> sofilter -<span style="color: #000000; font-weight: bold;">&gt;</span> clamav <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1025</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> -<span style="color: #000000; font-weight: bold;">&gt;</span> smtpd <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1026</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> -<span style="color: #000000; font-weight: bold;">&gt;</span> mail</pre></td></tr></table></div>

<p>Перезапускаем Postfix:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ postfix reload</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/04/15/clamsmtp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postgrey</title>
		<link>http://case.net.ru/2009/03/10/postgrey/</link>
		<comments>http://case.net.ru/2009/03/10/postgrey/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 12:06:38 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[postgrey]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=376</guid>
		<description><![CDATA[Postgrey is a program which implements greylisting and is designed to work with the Postfix MTA. WWW: http://postgrey.schweikert.ch/ Принцип действия серых списков основан на тактике рассылки спама. Как правило, спам рассылается в очень короткое время. Работа серого списка заключается в намеренной задержке писем на некоторое время. При этом адрес и время пересылки заносится в базу [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Postgrey is a program which implements greylisting and is<br />
designed to work with the Postfix MTA.</p>
<p>WWW:  http://postgrey.schweikert.ch/</p></blockquote>
<blockquote><p>Принцип действия серых списков основан на тактике рассылки спама. Как правило, спам рассылается в очень короткое время.<br />
Работа серого списка заключается в намеренной задержке писем на некоторое время. При этом адрес и время пересылки заносится в базу данных серого списка. Если удалённый компьютер является настоящим МТА, то он согласно RFC2821, должен сохранить письмо в очереди и повторять пересылку в течение пяти дней. Спам-боты, как правило, писем в очереди не сохраняют, поэтому спустя непродолжительное время, прекращают попытки переслать письмо. Экспериментальным путём установлено, что в среднем время рассылки спама составляет чуть больше часа.<br />
При повторной пересылке письма с этого же адреса, если с момента первой попытки прошло необходимое количество времени, Ваш МТА примет его. При этом IP-адрес отправляющего МТА, электронные адреса отправителя и получателя будут внесены в белый список на достаточно длительное время, после чего письма будут приниматься без задержек.</p></blockquote>
<p>Установка:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>postgrey<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></td></tr></table></div>

<p>Добавляем в rc.conf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">postgrey_enable</span>=<span style="color: #ff0000;">&quot;YES&quot;</span></pre></td></tr></table></div>

<p>Прописываем правила проверки сообщения для postfix&#8217;a в main.cf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, check_policy_service inet:127.0.0.1:<span style="color: #000000;">10023</span></pre></td></tr></table></div>

<p>Добавляем в файл /usr/local/etc/postfix/postgrey_whitelist_recipients доверенные домены и почтовые ящики для которых не производится проверка postgrey&#8217;ем.</p>
<p>Запускаем postgrey:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>postgrey start</pre></td></tr></table></div>

<p>Перезагружаем postfix:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$  postfix reload</pre></td></tr></table></div>

<p>Отчет о проделанной работе:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>maillog <span style="color: #000000; font-weight: bold;">|</span> postgreyreport <span style="color: #660033;">--dbdir</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span>postgrey --nosingle_line --check_sender=mx,a --separate_by_subnet=<span style="color: #ff0000;">&quot;:======<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span></pre></td></tr></table></div>

<p>Ссылки: http://argo-uln.blogspot.com/2007/11/blog-post.html</p>
]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/03/10/postgrey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Сортировка почты с помощью Dovecot Sieve</title>
		<link>http://case.net.ru/2009/03/05/dovecot-sieve/</link>
		<comments>http://case.net.ru/2009/03/05/dovecot-sieve/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 11:57:55 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[sieve]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=356</guid>
		<description><![CDATA[Что имеется: postfix + mysql + dovecot как imap сервер + roundcube Задача: сделать так, что бы письма с пометкой SPAM ложились в каталог Junk, а не Inbox. Собираем Dovecot с поддержкой LDA: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 &#91;root@case.net.ru&#93;$ cd /usr/ports/mail/dovecot &#91;root@case.net.ru&#93;$ [...]]]></description>
			<content:encoded><![CDATA[<p>Что имеется: postfix + mysql + dovecot как imap сервер + roundcube<br />
Задача: сделать так, что бы письма с пометкой SPAM ложились в каталог Junk, а не Inbox.</p>
<p>Собираем Dovecot с поддержкой LDA:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>dovecot
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> showconfig
===<span style="color: #000000; font-weight: bold;">&gt;</span> The following configuration options are available <span style="color: #000000; font-weight: bold;">for</span> dovecot-1.1.11:
     <span style="color: #007800;">KQUEUE</span>=on <span style="color: #ff0000;">&quot;kqueue(2) support&quot;</span>
     <span style="color: #007800;">SSL</span>=off <span style="color: #ff0000;">&quot;SSL support&quot;</span>
     <span style="color: #007800;">IPV6</span>=off <span style="color: #ff0000;">&quot;IPv6 support&quot;</span>
     <span style="color: #007800;">POP3</span>=off <span style="color: #ff0000;">&quot;POP3 support&quot;</span>
     <span style="color: #007800;">LDA</span>=on <span style="color: #ff0000;">&quot;LDA support&quot;</span>
     <span style="color: #007800;">MANAGESIEVE</span>=off <span style="color: #ff0000;">&quot;ManageSieve support&quot;</span>
     <span style="color: #007800;">GSSAPI</span>=off <span style="color: #ff0000;">&quot;GSSAPI support&quot;</span>
     <span style="color: #007800;">VPOPMAIL</span>=off <span style="color: #ff0000;">&quot;VPopMail support&quot;</span>
     <span style="color: #007800;">BDB</span>=off <span style="color: #ff0000;">&quot;BerkleyDB support&quot;</span>
     <span style="color: #007800;">LDAP</span>=off <span style="color: #ff0000;">&quot;OpenLDAP support&quot;</span>
     <span style="color: #007800;">PGSQL</span>=off <span style="color: #ff0000;">&quot;PostgreSQL support&quot;</span>
     <span style="color: #007800;">MYSQL</span>=on <span style="color: #ff0000;">&quot;MySQL support&quot;</span>
     <span style="color: #007800;">SQLITE</span>=off <span style="color: #ff0000;">&quot;SQLite support&quot;</span>
===<span style="color: #000000; font-weight: bold;">&gt;</span> Use <span style="color: #ff0000;">'make config'</span> to modify these settings
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></td></tr></table></div>

<p>Устанавливаем dovecot-sieve:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>dovecot-sieve<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>case.net.ru<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></td></tr></table></div>

<p>Настраиваем postfix:<br />
Добавляем в master.cf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">dovecot   unix  -       n       n       -       -       pipe
  <span style="color: #007800;">flags</span>=DRhu <span style="color: #007800;">user</span>=vmail:vmail <span style="color: #007800;">argv</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>deliver <span style="color: #660033;">-f</span> <span style="color: #800000;">${sender}</span> <span style="color: #660033;">-d</span> <span style="color: #800000;">${recipient}</span></pre></td></tr></table></div>

<p>Меняем в main.cf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">virtual_transport = dovecot</pre></td></tr></table></div>

<p>Меняем в dovecot.conf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">protocol lda <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  postmaster_address = <span style="color: #000000; font-weight: bold;">case</span><span style="color: #000000; font-weight: bold;">@</span>case.net.ru
  <span style="color: #c20cb9; font-weight: bold;">hostname</span> = case.net.ru
  mail_plugins = cmusieve
  mail_plugin_dir = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>lda
  sendmail_path = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span>
  sieve_global_path = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>vmail<span style="color: #000000; font-weight: bold;">/</span>dovecot-sieve.conf
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
auth default <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  socket listen <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    master <span style="color: #7a0874; font-weight: bold;">&#123;</span>
      path = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>auth-master
      mode = 0600
      user = vmail
      group = vmail
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>Настраиваем sieve в файле /usr/home/vmail/dovecot-sieve.conf:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">require <span style="color: #ff0000;">&quot;fileinto&quot;</span>;
<span style="color: #000000; font-weight: bold;">if</span> header :contains <span style="color: #ff0000;">&quot;Subject&quot;</span> <span style="color: #ff0000;">&quot;SPAM&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  fileinto <span style="color: #ff0000;">&quot;Junk&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/03/05/dovecot-sieve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Спамооборона от Яндекса</title>
		<link>http://case.net.ru/2009/01/18/spamooborona/</link>
		<comments>http://case.net.ru/2009/01/18/spamooborona/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 19:04:41 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fetchmail]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spamooborona]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=98</guid>
		<description><![CDATA[Имеется FreeBSD 6.4 и Postfix 2.5. Скачиваем собственно сам пакет спамообороны: spamooborona1024_postfix-2.2.tbz Устанавливаем: pkg_add -v spamooborona1024_postfix-2.2.tbz. Для запуска /usr/local/sbin/sp-postfix требуется библиотека libgcc_s.so.1. Устанавливаем gcc42: # cd /usr/ports/lang/gcc42 # make install clean Перезапускаем postfix (postfix reload) и радуемся жизни. Tips для fetchmail: По умолчанию Спамооборона отказазывается проверять письма принимаемые через fetchmail, пишет: Outgoing mail skipped, origin=127.0.0.1 [...]]]></description>
			<content:encoded><![CDATA[<p>Имеется FreeBSD 6.4 и Postfix 2.5.<br />
<br />
Скачиваем собственно сам пакет спамообороны:<br />
<a href="http://download.yandex.ru/so/amd64/FreeBSD6/spamooborona1024_postfix-2.2.tbz">spamooborona1024_postfix-2.2.tbz</a><br />
<br />
Устанавливаем:</p>
<blockquote><p><code>pkg_add -v spamooborona1024_postfix-2.2.tbz.</code></p></blockquote>
<p>
Для запуска /usr/local/sbin/sp-postfix требуется библиотека libgcc_s.so.1.<br />
Устанавливаем gcc42:</p>
<blockquote><p><code># cd /usr/ports/lang/gcc42<br />
# make install clean</code></p></blockquote>
<p>
Перезапускаем postfix (postfix reload) и радуемся жизни.<br />
<br />
Tips для fetchmail:<br />
По умолчанию Спамооборона отказазывается проверять письма принимаемые через fetchmail, пишет:</p>
<blockquote><p><code>Outgoing mail skipped, origin=127.0.0.1</code></p></blockquote>
<p>Что бы работало делаем так, что бы fetchmail доставлял письма на внешний интерфейс:</p>
<blockquote><p><code>fetchmail --smtphost mx.case.net.ru</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/01/18/spamooborona/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Личный почтовый ящик</title>
		<link>http://case.net.ru/2008/09/28/mailbox/</link>
		<comments>http://case.net.ru/2008/09/28/mailbox/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 16:44:00 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[roundcube]]></category>

		<guid isPermaLink="false">http://case.net.ru/2008/09/28/%d0%bb%d0%b8%d1%87%d0%bd%d1%8b%d0%b9-%d0%bf%d0%be%d1%87%d1%82%d0%be%d0%b2%d1%8b%d0%b9-%d1%8f%d1%89%d0%b8%d0%ba/</guid>
		<description><![CDATA[postfix (smtpd) + dovecot (imapd) + roundcube webmail (web interface for imapd) + spamassassin dovecot.conf (только изменения) protocols = imap listen = 127.0.0.1 disable_plaintext_auth = no ssl_disable = yes mail_location = maildir:/usr/home/vmail/%u auth default { mechanisms = plain passdb sql { args = /usr/local/etc/dovecot-sql.conf } userdb static { args = uid=2011 gid=2011 home=/usr/home/vmail/%u } user [...]]]></description>
			<content:encoded><![CDATA[<p>postfix (smtpd) + dovecot (imapd) + roundcube webmail (web interface for imapd) + spamassassin<br />
<br />
dovecot.conf (только изменения)</p>
<blockquote><p><code>protocols = imap<br />
listen = 127.0.0.1<br />
disable_plaintext_auth = no<br />
ssl_disable = yes<br />
mail_location = maildir:/usr/home/vmail/%u<br />
auth default {<br />
  mechanisms = plain<br />
  passdb sql {<br />
    args = /usr/local/etc/dovecot-sql.conf<br />
  }<br />
  userdb static {<br />
    args = uid=2011 gid=2011 home=/usr/home/vmail/%u<br />
  }<br />
  user = vmail<br />
}</code></p></blockquote>
<p>spamassassin: /usr/local/etc/mail/spamassassin/local.cf</p>
<blockquote><p><code>rewrite_header Subject *****SPAM*****<br />
report_safe 0<br />
required_score 10.0<br />
use_bayes 1<br />
bayes_auto_learn 1</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2008/09/28/mailbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
