<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Intercepting Email with PHP</title>
	<atom:link href="http://tinsology.net/2009/01/intercepting-email-with-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://tinsology.net/2009/01/intercepting-email-with-php/</link>
	<description>Read Me</description>
	<lastBuildDate>Thu, 11 Mar 2010 07:39:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tinsley</title>
		<link>http://tinsology.net/2009/01/intercepting-email-with-php/comment-page-1/#comment-2273</link>
		<dc:creator>Tinsley</dc:creator>
		<pubDate>Sun, 06 Dec 2009 22:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://tinsology.net/?p=95#comment-2273</guid>
		<description>You can&#039;t intercept ONLY the subject; however you can intercept the entire email and parse the subject. Attachments are encoded in the message. PHP has some built in functions that may help you extract info from raw email: http://www.php.net/manual/en/ref.mailparse.php</description>
		<content:encoded><![CDATA[<p>You can&#8217;t intercept ONLY the subject; however you can intercept the entire email and parse the subject. Attachments are encoded in the message. PHP has some built in functions that may help you extract info from raw email: <a href="http://www.php.net/manual/en/ref.mailparse.php" rel="nofollow">http://www.php.net/manual/en/ref.mailparse.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maypudd</title>
		<link>http://tinsology.net/2009/01/intercepting-email-with-php/comment-page-1/#comment-2272</link>
		<dc:creator>Maypudd</dc:creator>
		<pubDate>Sun, 06 Dec 2009 21:26:28 +0000</pubDate>
		<guid isPermaLink="false">http://tinsology.net/?p=95#comment-2272</guid>
		<description>Is it possible to have only the subject and content of the email caught by the php script? Also, how are attachments handled?</description>
		<content:encoded><![CDATA[<p>Is it possible to have only the subject and content of the email caught by the php script? Also, how are attachments handled?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Do Not Reply &#124; Tinsology</title>
		<link>http://tinsology.net/2009/01/intercepting-email-with-php/comment-page-1/#comment-2270</link>
		<dc:creator>Do Not Reply &#124; Tinsology</dc:creator>
		<pubDate>Sun, 06 Dec 2009 03:06:20 +0000</pubDate>
		<guid isPermaLink="false">http://tinsology.net/?p=95#comment-2270</guid>
		<description>[...] is no reason why any person working in support should have to monitor an email account; there are better ways. A properly implemented support system would make the source of the message, whether it be an [...]</description>
		<content:encoded><![CDATA[<p>[...] is no reason why any person working in support should have to monitor an email account; there are better ways. A properly implemented support system would make the source of the message, whether it be an [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tinsley</title>
		<link>http://tinsology.net/2009/01/intercepting-email-with-php/comment-page-1/#comment-1526</link>
		<dc:creator>Tinsley</dc:creator>
		<pubDate>Mon, 15 Jun 2009 01:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://tinsology.net/?p=95#comment-1526</guid>
		<description>Regarding file_get_contents vs fopen/fgets
If you only intend to read the contents of a file, file_get_contents is preferable, however they should be functionally identical.

Regarding your other question, addresses that an email is Bcc&#039;ed to are intentionally left out of the headers. The only way to determine the desired recipient in this case is to look at the email address the message was sent to, and not the content of the message. In order to do this you will need to modify each of your forwarders to call your script with the email address as a parameter, like so:

email@address.com,”&#124;/path/to/script.php email@address.com”

You can then use the $argv array to read the parameter. One problem with this method is it requires that each email address be piped individually, so if you are having all of your email piped you will need to do this some other way. Someone a bit more familiar with shell scripting than myself might be able to help you with this.</description>
		<content:encoded><![CDATA[<p>Regarding file_get_contents vs fopen/fgets<br />
If you only intend to read the contents of a file, file_get_contents is preferable, however they should be functionally identical.</p>
<p>Regarding your other question, addresses that an email is Bcc&#8217;ed to are intentionally left out of the headers. The only way to determine the desired recipient in this case is to look at the email address the message was sent to, and not the content of the message. In order to do this you will need to modify each of your forwarders to call your script with the email address as a parameter, like so:</p>
<p><a href="mailto:email@address.com">email@address.com</a>,”|/path/to/script.php <a href="mailto:email@address.com">email@address.com</a>”</p>
<p>You can then use the $argv array to read the parameter. One problem with this method is it requires that each email address be piped individually, so if you are having all of your email piped you will need to do this some other way. Someone a bit more familiar with shell scripting than myself might be able to help you with this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nate</title>
		<link>http://tinsology.net/2009/01/intercepting-email-with-php/comment-page-1/#comment-1507</link>
		<dc:creator>nate</dc:creator>
		<pubDate>Sat, 13 Jun 2009 18:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://tinsology.net/?p=95#comment-1507</guid>
		<description>wow i wish i had seen this before i started a project some time ago. one comment, i&#039;ve been using file_get_contents() to open the email so i don&#039;t have to specify how long the maximum line has to be. is there any disadvantage to using file_get_contents(&quot;php://stdin&quot;) over $file = fopen(&#039;php://stdin&#039;, &#039;r&#039;); while(!feof($file)){$data .= fgets($file, 4096);} ?

also, since this seems to be a field of expertise for you i was wondering if you know of any way to identify who the email is intended for other than reading the raw email file? my problem is that when someone bcc&#039;s the email and it gets passed to a default email script i do not know of a way to identify the recipient through php since the bcc is not included in the header. thanks!</description>
		<content:encoded><![CDATA[<p>wow i wish i had seen this before i started a project some time ago. one comment, i&#8217;ve been using file_get_contents() to open the email so i don&#8217;t have to specify how long the maximum line has to be. is there any disadvantage to using file_get_contents(&#8220;php://stdin&#8221;) over $file = fopen(&#8216;php://stdin&#8217;, &#8216;r&#8217;); while(!feof($file)){$data .= fgets($file, 4096);} ?</p>
<p>also, since this seems to be a field of expertise for you i was wondering if you know of any way to identify who the email is intended for other than reading the raw email file? my problem is that when someone bcc&#8217;s the email and it gets passed to a default email script i do not know of a way to identify the recipient through php since the bcc is not included in the header. thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
