<?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>postfix Архиви - rosen4o.net</title>
	<atom:link href="https://rosen4o.net/tag/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>https://rosen4o.net/tag/postfix/</link>
	<description></description>
	<lastBuildDate>Tue, 20 May 2014 08:54:13 +0000</lastBuildDate>
	<language>bg-BG</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>catch spam from apache</title>
		<link>https://rosen4o.net/2014/05/20/catch-spam-from-apache/</link>
					<comments>https://rosen4o.net/2014/05/20/catch-spam-from-apache/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Tue, 20 May 2014 08:53:53 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[spam]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1006</guid>

					<description><![CDATA[<p>Sometimes is very hard to debug from which virtual host spam is This can be check very easy with this trick create a new file  vim /usr/local/bin/phpsendmail place inside it #!/usr/bin/php &#60;?php $sendmail = &#8216;/usr/sbin/sendmail&#8217;; $logfile = &#8216;/var/log/mail.form&#8217;; /* Get<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2014/05/20/catch-spam-from-apache/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2014/05/20/catch-spam-from-apache/">catch spam from apache</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes is very hard to debug from which virtual host spam is<br />
This can be check very easy with this trick</p>
<p>create a new file</p>
<p style="padding-left: 30px;"> <strong>vim /usr/local/bin/phpsendmail</strong></p>
<p>place inside it</p>
<p style="padding-left: 30px;"><strong>#!/usr/bin/php</strong><br />
<strong> &lt;?php</strong></p>
<p style="padding-left: 30px;"><strong>$sendmail = &#8216;/usr/sbin/sendmail&#8217;;</strong><br />
<strong> $logfile = &#8216;/var/log/mail.form&#8217;;</strong></p>
<p style="padding-left: 30px;"><strong>/* Get email content */</strong><br />
<strong> $logline = &#8220;;</strong><br />
<strong> $mail = &#8220;;</strong><br />
<strong> $fp = fopen(&#8216;php://stdin&#8217;, &#8216;r&#8217;);</strong></p>
<p style="padding-left: 30px;"><strong>while ($line = fgets($fp))</strong><br />
<strong> {</strong><br />
<strong> if(preg_match(&#8216;/^to:/i&#8217;, $line) || preg_match(&#8216;/^from:/i&#8217;, $line))</strong><br />
<strong> {</strong><br />
<strong> $logline .= trim($line).&#8217; &#8216;;</strong><br />
<strong> }</strong><br />
<strong> $mail .= $line;</strong><br />
<strong> }</strong></p>
<p style="padding-left: 30px;"><strong>/* Build sendmail command */</strong><br />
<strong> $cmd = &#8216;echo &#8216; . escapeshellarg($mail) . &#8216; | &#8216;.$sendmail.&#8217; -t -i&#8217;;</strong><br />
<strong> for ($i = 1; $i &lt; $_SERVER[&#8216;argc&#8217;]; $i++)</strong><br />
<strong> {</strong><br />
<strong> $cmd .= escapeshellarg($_SERVER[&#8216;argv&#8217;][$i]).&#8217; &#8216;;</strong><br />
<strong> }</strong></p>
<p style="padding-left: 30px;"><strong>/* Log line */</strong><br />
<strong> $path = isset($_ENV[&#8216;PWD&#8217;]) ? $_ENV[&#8216;PWD&#8217;] : $_SERVER[&#8216;PWD&#8217;];</strong><br />
<strong> file_put_contents($logfile, date(&#8216;Y-m-d H:i:s&#8217;) . &#8216; &#8216; . $logline .&#8217;  ==&gt; &#8216; .$path.&#8220;\n&#8220;, FILE_APPEND);</strong></p>
<p style="padding-left: 30px;"><strong>/* Call sendmail */</strong><br />
<strong> return shell_exec($cmd);</strong><br />
<strong> ?&gt;</strong></p>
<p>Then you need to make it executable</p>
<p style="padding-left: 30px;"><strong>chmod +x /usr/local/bin/phpsendmail</strong></p>
<p style="padding-left: 30px;"><strong>touch /var/log/mail.form</strong></p>
<p style="padding-left: 30px;"><strong>chmod a+w /var/log/mail.form</strong></p>
<p>In your php.ini file you need to add</p>
<p style="padding-left: 30px;"><strong>sendmail_path = /usr/local/bin/phpsendmail</strong></p>
<p>Restart apache</p>
<p>This will cause all emails which are send from apache to be logged in the file /var/log/mail.form</p>
<p>Материалът <a href="https://rosen4o.net/2014/05/20/catch-spam-from-apache/">catch spam from apache</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2014/05/20/catch-spam-from-apache/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>dkim on debian with postfix</title>
		<link>https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/</link>
					<comments>https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Thu, 10 Apr 2014 14:57:19 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dkim]]></category>
		<category><![CDATA[postfix]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1000</guid>

					<description><![CDATA[<p>This is a guide to installing OpenDKIM for multiple domains on a Postfix-installtion on Debian. I tried some other guides but kept running into problems, so this is how I did it. Among others, Google Gmail and Yahoo mail check<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/">dkim on debian with postfix</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a guide to installing OpenDKIM for multiple domains on a Postfix-installtion on Debian. I tried some other guides but kept running into problems, so this is how I did it.</p>
<p>Among others, Google Gmail and Yahoo mail check your email for a DKIM signature.<br />
Install and Configure OpenDKIM</p>
<p>1. Install OpenDKIM</p>
<blockquote><p><strong>apt-get install opendkim</strong></p></blockquote>
<p>Comment: This will install the latest available stable Debian packaged version of OpenDKIM which is currently 2.0.1. This version is already a couple of years old (2010).<br />
If you know how/want to compile sources yourself, then the latest version is 2.4.3 (and 2.5.0 is right around the corner)</p>
<p>2. Edit the OpenDKIM config file</p>
<blockquote><p><strong>vim /etc/opendkim.conf</strong></p></blockquote>
<p>Add these rows:</p>
<blockquote><p><strong>KeyTable /etc/opendkim/KeyTable</strong><br />
<strong> SigningTable /etc/opendkim/SigningTable</strong><br />
<strong> ExternalIgnoreList /etc/opendkim/TrustedHosts</strong><br />
<strong> InternalHosts /etc/opendkim/TrustedHosts</strong></p></blockquote>
<p>Note: If you run multiple instances of Postfix you need to add this to the opendkim.conf for each instance (or the ones you want to use opendkim)</p>
<p>3. Edit /etc/opendkim/TrustedHosts</p>
<blockquote><p><strong>mkdir -p <strong>/etc/opendkim/</strong></strong><br />
<strong>vim /etc/opendkim/TrustedHosts</strong></p></blockquote>
<p>Add domains, hostnames and/or ip’s that should be handled by OpenDKIM. Don’t forget localhost.</p>
<blockquote><p><strong>127.0.0.1</strong><br />
<strong> localhost</strong></p></blockquote>
<p>4. Edit /etc/default/opendkim</p>
<blockquote><p><strong>vim /etc/default/opendkim</strong></p></blockquote>
<p>Uncomment this row:</p>
<blockquote><p><strong>SOCKET=&#8220;inet:12345@localhost&#8220; # listen on loopback on port 12345</strong></p></blockquote>
<p>Generate keys<br />
Repeat these steps to generate keys for each domain you will send email from. Replace mydomain.com with your domain name in examples below.</p>
<p>1. Generate key</p>
<blockquote><p><strong>mkdir -p /etc/opendkim/keys/mydomain.com</strong><br />
<strong> cd /etc/opendkim/keys/mydomain.com</strong><br />
<strong> opendkim-genkey -r -d mydomain.com</strong><br />
<strong> chown opendkim:opendkim default.private</strong></p></blockquote>
<p>2. Add domain to KeyTable /etc/opendkim/KeyTable</p>
<blockquote><p><strong>vim /etc/opendkim/KeyTable</strong></p></blockquote>
<p>Add line</p>
<blockquote><p><strong>default._domainkey.mydomain.com mydomain.com:default:/etc/opendkim/keys/mydomain.com/default.private</strong></p></blockquote>
<p>3. Add domain to SigningTable /etc/opendkim/SigningTable</p>
<blockquote><p><strong>vim /etc/opendkim/SigningTable</strong></p></blockquote>
<p>Add line:</p>
<blockquote><p><strong>mydomain.com default._domainkey.mydomain.com</strong></p></blockquote>
<p>Note that in OpenDKIM 2.0.1 domain names are case sensitive (supposed to be fixed from 2.3.1 but I have not tested).<br />
This means that in the above example an email from info@mydomain.com will be signed, but an email from info@MyDomain.com will not be signed. The workaround is to add one extra entry for MyDomain.com to SigningTable.</p>
<p>4. Add to DKIM public key to DNS</p>
<p>Add an entry for the public key to the DNS server you are using for your domain. You find the public key here:</p>
<blockquote><p><strong>cat /etc/opendkim/keys/mydomain.com/default.txt</strong></p></blockquote>
<p>And insert it in your zone file<br />
Start OpenDKIM</p>
<blockquote><p><strong>/etc/init.d/opendkim start</strong></p></blockquote>
<p>In the future, if you make any changes to configuration remember to restart: /etc/init.d/opendkim restart<br />
Configure and Restart Postifx</p>
<p>1. Configure Postfix</p>
<blockquote><p><strong>vim /etc/postfix/main.cf</strong></p></blockquote>
<p>Add or edit these lines:</p>
<blockquote><p><strong>milter_default_action = accept</strong><br />
<strong> milter_protocol = 6</strong><br />
<strong> smtpd_milters = inet:localhost:12345</strong><br />
<strong> non_smtpd_milters = inet:localhost:12345</strong></p></blockquote>
<p>2. Restart Postfix</p>
<blockquote><p><strong>/etc/init.d/postfix reload</strong></p></blockquote>
<p>Log files are in the /var/log directory</p>
<blockquote><p><strong>cat /var/log/mail.log</strong><br />
<strong></strong><strong>cat /var/log/mail.warn</strong><br />
<strong> cat /var/log/mail.err</strong></p></blockquote>
<p>Log more info</p>
<blockquote><p><strong>vim /etc/opendkim.conf</strong></p></blockquote>
<p>Add this line:</p>
<blockquote><p><strong>LogWhy yes</strong></p></blockquote>
<p>&nbsp;</p>
<p>Credits</p>
<p>Guides that have helped me along the way: <a href="http://www.debiantutorials.com/setup-domainkeys-identified-mail-dkim-in-postfix/">Debian Tutorials</a> and <a href="http://syslog.tv/2010/01/11/dkim-on-debian-with-postfix/">Syslog</a></p>
<p>Материалът <a href="https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/">dkim on debian with postfix</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>postfix queue lifetime</title>
		<link>https://rosen4o.net/2012/02/23/postfix-queue-lifetime/</link>
					<comments>https://rosen4o.net/2012/02/23/postfix-queue-lifetime/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Thu, 23 Feb 2012 08:31:46 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[lifetime]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[queue]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=845</guid>

					<description><![CDATA[<p>postconf -e maximal_queue_lifetime=[time] Time can be in seconds (s), minutes (m), hours (h), days (d), and weeks (w).</p>
<p>Материалът <a href="https://rosen4o.net/2012/02/23/postfix-queue-lifetime/">postfix queue lifetime</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<blockquote>
<pre>postconf -e maximal_queue_lifetime=[time]</pre>
</blockquote>
<p>Time can be in seconds (s), minutes (m), hours (h), days (d), and weeks (w).</p>
<p>Материалът <a href="https://rosen4o.net/2012/02/23/postfix-queue-lifetime/">postfix queue lifetime</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2012/02/23/postfix-queue-lifetime/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>изчистване на пощенската опашката на postfix</title>
		<link>https://rosen4o.net/2010/02/26/%d0%b8%d0%b7%d1%87%d0%b8%d1%81%d1%82%d0%b2%d0%b0%d0%bd%d0%b5-%d0%bd%d0%b0-%d0%bf%d0%be%d1%89%d0%b5%d0%bd%d1%81%d0%ba%d0%b0%d1%82%d0%b0-%d0%be%d0%bf%d0%b0%d1%88%d0%ba%d0%b0%d1%82%d0%b0-%d0%bd%d0%b0-pos/</link>
					<comments>https://rosen4o.net/2010/02/26/%d0%b8%d0%b7%d1%87%d0%b8%d1%81%d1%82%d0%b2%d0%b0%d0%bd%d0%b5-%d0%bd%d0%b0-%d0%bf%d0%be%d1%89%d0%b5%d0%bd%d1%81%d0%ba%d0%b0%d1%82%d0%b0-%d0%be%d0%bf%d0%b0%d1%88%d0%ba%d0%b0%d1%82%d0%b0-%d0%bd%d0%b0-pos/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Fri, 26 Feb 2010 13:27:41 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[queue]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=694</guid>

					<description><![CDATA[<p>Изчистване на писамата от  специфичен адрес: mailq &#124; tail +2 &#124; grep -v &#8216;^ *(&#8216; &#124; awk  &#8216;BEGIN { RS = &#8222;&#8220; } { if ($8 == &#8222;email@address.com&#8220; &#38;&#38; $9 == &#8222;&#8220;) print $1 } &#8216; &#124; tr -d &#8216;*!&#8217;<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2010/02/26/%d0%b8%d0%b7%d1%87%d0%b8%d1%81%d1%82%d0%b2%d0%b0%d0%bd%d0%b5-%d0%bd%d0%b0-%d0%bf%d0%be%d1%89%d0%b5%d0%bd%d1%81%d0%ba%d0%b0%d1%82%d0%b0-%d0%be%d0%bf%d0%b0%d1%88%d0%ba%d0%b0%d1%82%d0%b0-%d0%bd%d0%b0-pos/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2010/02/26/%d0%b8%d0%b7%d1%87%d0%b8%d1%81%d1%82%d0%b2%d0%b0%d0%bd%d0%b5-%d0%bd%d0%b0-%d0%bf%d0%be%d1%89%d0%b5%d0%bd%d1%81%d0%ba%d0%b0%d1%82%d0%b0-%d0%be%d0%bf%d0%b0%d1%88%d0%ba%d0%b0%d1%82%d0%b0-%d0%bd%d0%b0-pos/">изчистване на пощенската опашката на postfix</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Изчистване на писамата от  специфичен адрес:</p>
<blockquote><p>mailq | tail +2 | grep -v &#8216;^ *(&#8216; | awk  &#8216;BEGIN { RS = &#8222;&#8220; } { if ($8 == &#8222;email@address.com&#8220; &amp;&amp; $9 == &#8222;&#8220;) print $1 } &#8216; | tr -d &#8216;*!&#8217; | postsuper -d &#8211;</p></blockquote>
<p>И разбира се изчистване на цялата:</p>
<blockquote><p>sudo postsuper -d ALL</p></blockquote>
<p>Материалът <a href="https://rosen4o.net/2010/02/26/%d0%b8%d0%b7%d1%87%d0%b8%d1%81%d1%82%d0%b2%d0%b0%d0%bd%d0%b5-%d0%bd%d0%b0-%d0%bf%d0%be%d1%89%d0%b5%d0%bd%d1%81%d0%ba%d0%b0%d1%82%d0%b0-%d0%be%d0%bf%d0%b0%d1%88%d0%ba%d0%b0%d1%82%d0%b0-%d0%bd%d0%b0-pos/">изчистване на пощенската опашката на postfix</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2010/02/26/%d0%b8%d0%b7%d1%87%d0%b8%d1%81%d1%82%d0%b2%d0%b0%d0%bd%d0%b5-%d0%bd%d0%b0-%d0%bf%d0%be%d1%89%d0%b5%d0%bd%d1%81%d0%ba%d0%b0%d1%82%d0%b0-%d0%be%d0%bf%d0%b0%d1%88%d0%ba%d0%b0%d1%82%d0%b0-%d0%bd%d0%b0-pos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
