<?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>treibsand.com &#187; Postfix</title>
	<atom:link href="http://www.treibsand.com/tag/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.treibsand.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Dec 2011 12:46:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Postfix SQLite Readme wieder online</title>
		<link>http://www.treibsand.com/2008/04/30/postfix-sqlite-readme-wieder-online/</link>
		<comments>http://www.treibsand.com/2008/04/30/postfix-sqlite-readme-wieder-online/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 15:23:39 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/?p=121</guid>
		<description><![CDATA[Mit der ersten Veröffentlichung des Postfix SQLite Patches habe ich ein HowTo ins Netz gestellt, da ich aber zeitlich nicht mehr dazu gekommen bin die Seite zu pflegen, habe ich sie wieder offline genommen. Endlich hatte ich wieder Zeit, das HowTo und die Manpage auf den neuesten Stand zu bringen. Jetzt ist alles wieder unter [...]]]></description>
			<content:encoded><![CDATA[<p>Mit der ersten Veröffentlichung des Postfix SQLite Patches habe ich ein HowTo ins Netz gestellt, da ich aber zeitlich nicht mehr dazu gekommen bin die Seite zu pflegen, habe ich sie wieder offline genommen. </p>
<p><span id="more-121"></span><br />
Endlich hatte ich wieder Zeit, das HowTo und die Manpage auf den neuesten Stand zu bringen. Jetzt ist alles wieder unter <a href="http://www.treibsand.com/postfix-sqlite/">http://www.treibsand.com/postfix-sqlite/</a> online.</p>
<p>Have fun <img src='http://www.treibsand.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2008/04/30/postfix-sqlite-readme-wieder-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix SQLite lookup table</title>
		<link>http://www.treibsand.com/2006/10/18/postfix_sqlite/</link>
		<comments>http://www.treibsand.com/2006/10/18/postfix_sqlite/#comments</comments>
		<pubDate>Wed, 18 Oct 2006 11:54:10 +0000</pubDate>
		<dc:creator>Toast</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://test.treibsand.com/2006/10/18/postfix-sqlite-lookup-table-2/</guid>
		<description><![CDATA[Oft braucht man für Postfix Konfigurationen für virtuelle Accounts. Die übliche Methode hierfür ist z.B. die Konfiguration mit MySQL zu machen. In vielen Fällen rentiert es sich aber nicht gleich einen MySQL Server aufzusetzen. Vor kurzem brauchte ich ein Backend für Postfix, welches wenig Speicher verbraucht und ich per Webinterface einfach verwalten kann. Per Webinterface [...]]]></description>
			<content:encoded><![CDATA[<p>Oft braucht man für Postfix Konfigurationen für virtuelle Accounts. Die übliche Methode hierfür ist z.B. die Konfiguration mit MySQL zu machen. In vielen Fällen rentiert es sich aber nicht gleich einen MySQL Server aufzusetzen.</p>
<p><span id="more-35"></span><br />
Vor kurzem brauchte ich ein Backend für Postfix, welches wenig Speicher verbraucht und ich per Webinterface einfach verwalten kann. Per Webinterface ein lookup table in Form eine Datei zu editieren und danach ein postmap aufzurufen, macht nicht wirklich spass. Aus diesem Grund kam für mich eigentlich nur SQLite in Frage.</p>
<p>Allerdings kann Postfix aktuell keine lookup tables in SQLite Datenbank, deswegen habe ich diese selber eingebaut. Der Patch für Postfix 2.3.3 ist unter http://www.treibsand.com/static/files/postfix-2.3.3_sqlite.patch verfügbar.</p>
<p>Sobald Postfix mit SQLite gebaut ist, sollte man eine Datenbank anlegen, die z.B. wie folgt aufgebaut ist:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> mail_domains <span style="color: #66cc66;">&#40;</span>id <span style="color: #993333; font-weight: bold;">INT</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">DOMAIN</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">250</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;  
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> mail_users <span style="color: #66cc66;">&#40;</span>id <span style="color: #993333; font-weight: bold;">INT</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span><span style="color: #66cc66;">,</span> email <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">128</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> maildir <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">250</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">DOMAIN</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;  
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> mail_virtual<span style="color: #66cc66;">&#40;</span> id <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span><span style="color: #66cc66;">,</span> email <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> destination text<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">DOMAIN</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>In der Datei main.cf kann wie folgt auf die lookup table zugegriffen werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">virtual_mailbox_maps = sqlite:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>sqlite-mailbox.cf
virtual_mailbox_domains = sqlite:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>sqlite-domains.cf
virtual_alias_maps = sqlite:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>sqlite-alias.cf</pre></div></div>

<p>Jede Config Datei für SQLite muss 2 Anweisungen enthalten:</p>
<ul>
<li>dbpath &#8211; Pfad zur SQLite Datenbank</li>
<li>query &#8211; SQL Query</li>
</ul>
<p>Eine Config Datei kann z.B. wie folgt aussehen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>aliases.db
query = SELECT forw_addr FROM mxaliases WHERE <span style="color: #007800;">alias</span>=<span style="color: #ff0000;">'%s'</span> AND <span style="color: #007800;">status</span>=<span style="color: #ff0000;">'active'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.treibsand.com/2006/10/18/postfix_sqlite/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

