<?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>Acumen Development &#187; integration</title>
	<atom:link href="http://www.acumendevelopment.net/tag/integration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acumendevelopment.net</link>
	<description>Software to inspire.</description>
	<lastBuildDate>Wed, 02 Jun 2010 16:39:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
		<item>
		<title>Direct Email Reception</title>
		<link>http://www.acumendevelopment.net/direct-email-reception/</link>
		<comments>http://www.acumendevelopment.net/direct-email-reception/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 13:37:26 +0000</pubDate>
		<dc:creator>Leo Brown</dc:creator>
				<category><![CDATA[Business Processes]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.acumendevelopment.net/?p=77</guid>
		<description><![CDATA[A quick guide to automatically processing inbound emails on a UNIX server.]]></description>
			<content:encoded><![CDATA[<p>There are numerous applications for integration of inbound email &#8211; the most obvious being ticketing systems, and robot systems (auto/interactive responders).</p>
<p>This is really easily achievable on UNIX systems using the .forward (dot forward) file and your scripting language of choice. If you wanted to pipe all of root&#8217;s mail into a script, you would create a .forward file in that user&#8217;s home directory, consisting of a single line, starting with a pipe, followed by the full process path.</p>
<pre class="brush: php;">
|/root/process.php
</pre>
<p>Then you need to provide a destination processor for your email. In this case we have used a UNIX-style file processor at the start by using the hashbang syntax:</p>
<pre class="brush: php;">
#!/usr/local/bin/php
&lt;?php

// read from stdin
$fp = fopen('php://stdin', 'r');
while(!feof($fp)) {
$lines[]=fgets($fp, 4096);
}

[... email processing code...]
?&gt;
</pre>
<p>You can then use an optional MIME decoder such as <a href="http://pear.php.net/package/Mail_mimeDecode">Pear mimeDecode</a> to break up the email into the relevant sections &#8211; for instance, the from/to fields and plain and/or HTML body text.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acumendevelopment.net/direct-email-reception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using memcached

Served from: www.acumendevelopment.net @ 2010-09-10 02:23:08 -->