<?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>Screenage &#187; Development</title>
	<atom:link href="http://www.screenage.de/blog/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.screenage.de/blog</link>
	<description></description>
	<lastBuildDate>Sun, 13 Nov 2011 10:33:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>using postfix for secure tests with live data</title>
		<link>http://www.screenage.de/blog/2008/03/03/using-postfix-for-secure-tests-with-live-data/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-postfix-for-secure-tests-with-live-data</link>
		<comments>http://www.screenage.de/blog/2008/03/03/using-postfix-for-secure-tests-with-live-data/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 15:38:33 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/2008/03/03/using-postfix-for-secure-tests-with-live-data/</guid>
		<description><![CDATA[During web development and quality assurance you sometimes want to test an application with live data (e.g. a web shop test instance with live customer sql data). As your application implements mail functionality you have to make sure that no &#8230; <a href="http://www.screenage.de/blog/2008/03/03/using-postfix-for-secure-tests-with-live-data/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>During web development and quality assurance you sometimes want to test an application with live data (e.g. a web shop test instance with live customer sql data). As your application implements mail functionality you have to make sure that no mail on the test server is sent to a real user but you probably want to be able to send mails to developers and receive all other outgoing test mails in a catch-all account. An easy Postfix tweak for this is using a pcre regular expression virtual map.</p>
<p>So our goal is: All outgoing mails to a specific domain should be delivered normally (e.g. your company domain) while all other outgoing mails should be delivered to one specific catch-all mailbox.</p>
<p>Actually this task can be resolved by adding not more than three lines of configuration code in two files.</p>
<p>1. in /etc/postfix/main.cf add</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">virtual_alias_maps <span style="color: #339933;">=</span> pcre<span style="color: #339933;">:/</span>etc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">/</span>virtual<span style="color: #339933;">.</span>pcre</pre></div></div>

<p>2. the new /etc/postfix/virtual.pcre should look like</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.+</span><span style="color: #009900;">&#41;</span><span style="color: #0000ff;">@yourowndomain</span>\<span style="color: #339933;">.</span>tld<span style="color: #0000ff;">$/</span> <span style="color: #0000ff;">$</span><span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">@yourowndomain</span><span style="color: #339933;">.</span>tld
<span style="color: #009966; font-style: italic;">/(.+)@(.+)/</span> catchoutgoing<span style="color: #0000ff;">@yourowndomain</span><span style="color: #339933;">.</span>tld</pre></div></div>

<p>After having restarted postfix you are already done.</p>
<p>Please note, a ${0} instead of ${1}@yourowndomain.tld did not work for me, so this a tiny workaround which does not look beautiful but really does it&#8217;s job.</p>
<p>p.s.: A really nice (but somehow old looking) tool for developing and testing regular expressions is &#8220;<a href="http://billposer.org/Software/redet.html">redet</a>&#8220;, a &#8220;regular expression development and execution tool&#8221; which knows nearly every important regex syntax depending on the tools you have installed. You&#8217;ll find redet in your Debian/Ubuntu repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2008/03/03/using-postfix-for-secure-tests-with-live-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

