<?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>fen&#039;s site &#187; postfix</title>
	<atom:link href="http://www.f3n.org/tag/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.f3n.org</link>
	<description>Systems Admin, Gaming, Graphics.</description>
	<lastBuildDate>Mon, 16 May 2011 08:15:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Email spam prevention techniques: sender specific forwarders</title>
		<link>http://www.f3n.org/2008/08/email-spam-prevention-techniques-sender-specific-forwarders/</link>
		<comments>http://www.f3n.org/2008/08/email-spam-prevention-techniques-sender-specific-forwarders/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 14:58:52 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://www.f3n.org/?p=12</guid>
		<description><![CDATA[For some time now, when i would be signing up for a web service, download, weblog subscription or some other online gadget where an email address is required for sending information, i would create a temporary mail forwarder specifically for that sender.]]></description>
			<content:encoded><![CDATA[<p>For some time now, when i would be signing up for a web service, download, weblog subscription or some other online gadget where an email address is required for sending information, i would create a temporary mail forwarder specifically for that sender.</p>
<p>I decided that logging into my server to create the forewarder in my database was a bit much work for something i was doing increasingly commonly, so i did what any self respecting hacker would do, i rolled my own script that can insert, remove and track forwarders, it&#8217;s reasonably secure for your average php hackjob.<br />
<span id="more-12"></span><br />
index-header.php contains an <a href="http://code.google.com/p/php-email-address-validation/source/browse/trunk/EmailAddressValidator.php">email validator class</a> from google code (<a href="http://code.google.com/p/php-email-address-validation/">project page</a>), its clean and its fairly fast.<br />
<div id="attachment_40" class="wp-caption alignnone" style="width: 310px"><a href="http://www.f3n.org/wp-content/uploads/2008/08/ssef-shot.png"><img src="http://www.f3n.org/wp-content/uploads/2008/08/ssef-shot-300x225.png" alt="Adding forwarder" title="sender specific email forwarders" width="300" height="225" class="size-medium wp-image-40" /></a><p class="wp-caption-text">Adding forwarder</p></div></p>
<p><!-- Creative Commons License --><br />
<a href="http://creativecommons.org/licenses/GPL/2.0/"><br />
<img alt="CC-GNU GPL" border="0" src="http://creativecommons.org/images/public/cc-GPL-a.png" /></a><br />
This software is licensed under the <a href="http://creativecommons.org/licenses/GPL/2.0/">CC-GNU GPL</a> version 2.0 or later.<br />
<!-- /Creative Commons License --></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/* Copyright 2008 Aaron Tate
&nbsp;
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
&nbsp;
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
&nbsp;
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
*/</span>
<span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'index-header.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$validator</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> EmailAddressValidator<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$validator</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">check_email_address</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">session_regenerate_id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$fe_conf_imapauth_servername</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fe_conf_imapauth_serverport</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;143&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fe_conf_imapauth_validate_cert</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/novalidate-cert&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">//  can be 'novalidate-cert', 'validate-cert or '' (in which case it defaults to cert validation) -at</span>
<span style="color: #000088;">$fe_conf_pdo_engine</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;mysql&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//see http://au.php.net/manual/en/pdo.getavailabledrivers.php</span>
<span style="color: #000088;">$fe_conf_pdo_host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fe_conf_pdo_db</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbname&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fe_conf_pdo_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbuser&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fe_conf_pdo_pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbpass&quot;</span><span style="color: #339933;">;</span>
try<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$fe_db_connection</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PDO<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fe_conf_pdo_engine</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':host='</span><span style="color: #339933;">.</span><span style="color: #000088;">$fe_conf_pdo_host</span><span style="color: #339933;">.</span><span style="color: #0000ff;">';dbname='</span><span style="color: #339933;">.</span><span style="color: #000088;">$fe_conf_pdo_db</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fe_conf_pdo_user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fe_conf_pdo_pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>catch <span style="color: #009900;">&#40;</span>PDOException <span style="color: #000088;">$fe_db_exception</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Error Connecting to database ('</span><span style="color: #339933;">.</span><span style="color: #000088;">$fe_db_exception</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">die</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
&lt;head lang=&quot;en-au&quot;&gt;
&lt;title&gt;&lt;/title&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;application/xhtml+xml; charset=UTF-8&quot;/&gt;
&lt;meta http-equiv=&quot;pragma&quot; content=&quot;no-cache&quot;/&gt;
&lt;meta http-equiv=&quot;cache-control&quot; content=&quot;no-cache&quot;/&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* body styles */
body {
        font-family: arial, helvetica, sans-serif;
        font-size: 9pt;
}
h1,h2 { font-style: normal; font-weight: normal;}
h1{ font-size: 14pt;}
h2 {font-size: 11pt; font-style: italic;}
/* Forms Style */
input {
        border: 1px solid #fff;
        background-color: #69f;
        color: white;
}
textarea{
    border: 1px solid #fff;
    background-color: #69f;
    color: white;
}
.formrow{
        color: white;
        font-weight:bold;
        background: #36f;}
#loginform{
        position: absolute;
        left: 50%;
        width: 500px;
        margin-left:-250px;
}
.inputtable input
{
        width: 300px;
        color: white;
}
.inputtable label
{
        padding: 20px;
&nbsp;
}
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function loadfocus()
{
&nbsp;
        document.getElementById(&quot;fe_email&quot;).focus();
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload=&quot;loadfocus()&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$validator</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">check_email_address</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_pass'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
                &lt;form method=&quot;POST&quot; action=&quot;index.php&quot;&gt;
                                &lt;table id=&quot;loginform&quot; class=&quot;inputtable&quot;&gt;&lt;tr class=&quot;formrow&quot;&gt;&lt;td&gt;
                                &lt;label for=&quot;fe_email&quot;/&gt;Email Address: &lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input tabindex=10 name=&quot;fe_email&quot; id=&quot;fe-email&quot;/&gt;
                                &lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;formrow&quot;&gt;&lt;td&gt;
                                &lt;label for=&quot;fe_pass&quot;/&gt;Password: &lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;password&quot; tabindex=11 name=&quot;fe_pass&quot; id=&quot;fe-pass&quot;/&gt;
                                &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;
                                &lt;input type=&quot;submit&quot; value=&quot;Login&quot;/&gt;
                                &lt;/td&gt;&lt;/td&gt;&lt;/table&gt;
                        &lt;/form&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">else</span>
                <span style="color: #009900;">&#123;</span>       <span style="color: #666666; font-style: italic;">//Attempt to authenticate with IMAP server, set session and reload page.</span>
                        <span style="color: #000088;">$authtest</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imap_open</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'{'</span><span style="color: #339933;">.</span><span style="color: #000088;">$fe_conf_imapauth_servername</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">.</span><span style="color: #000088;">$fe_conf_imapauth_serverport</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/imap'</span><span style="color: #339933;">.</span><span style="color: #000088;">$fe_conf_imapauth_validate_cert</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'}INBOX'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>  <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_pass'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>OP_READONLY<span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error connecting to imap server: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">imap_last_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #990000;">imap_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$authtest</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;Redirect&lt;/a&gt;&lt;script type=&quot;text/javascript&quot;&gt;location.href = \''</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'\';&lt;/script&gt;'</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
                &lt;h1&gt;Email forwarders for <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$validator</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">check_email_address</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_source'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_comment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//insert forwarder sans comment</span>
                        <span style="color: #000088;">$fe_db_connection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'INSERT into forwardings(source,destination) VALUES(\''</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_source'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\',\''</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\');'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">echo</span>  <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_source'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' Added.&lt;/p&gt;'</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #b1b100;">else</span>
                        <span style="color: #009900;">&#123;</span>  <span style="color: #666666; font-style: italic;">//insert commented forwarder</span>
                        <span style="color: #000088;">$fe_db_connection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'INSERT into forwardings(source,destination,comment) VALUES(\''</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_source'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\',\''</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\',\''</span><span style="color: #339933;">.</span> <span style="color: #990000;">mysql_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_comment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\');'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">echo</span>  <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe_source'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' Added w/ comment.&lt;/p&gt;'</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
&nbsp;
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$validator</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">check_email_address</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'delete'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//remove forwader providing its destination matches the users email address.</span>
                <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$fe_db_connection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DELETE FROM forwardings WHERE source = \''</span><span style="color: #339933;">.</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'delete'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\' AND destination = \''</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\' LIMIT 1;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;'</span> <span style="color: #339933;">.</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'delete'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' deleted.&lt;/p&gt;'</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'logout'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;Redirect&lt;/a&gt;&lt;script type=&quot;text/javascript&quot;&gt;location.href = \''</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'\';&lt;/script&gt;'</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
                &lt;h2&gt;Add/Edit Forwarder&lt;/h2&gt;
                &lt;form method=&quot;POST&quot; action=&quot;index.php&quot;&gt;
                &lt;table class=&quot;inputtable&quot;&gt;&lt;tr class=&quot;formrow&quot;&gt;
                &lt;td&gt;&lt;label for=&quot;fe_source&quot;&gt;Source Email Address&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot; tabindex=10 name=&quot;fe_source&quot; id=&quot;fe_source&quot; size=30 /&gt;&lt;/td&gt;
                &lt;/tr&gt;&lt;tr class=&quot;formrow&quot;&gt;
                &lt;td&gt;&lt;label for=&quot;fe_comment&quot;&gt;Comment&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;textarea tabindex=10 name=&quot;fe_comment&quot; id=&quot;fe_comment&quot; cols=40 rows=5&gt;&lt;/textarea&gt;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr class=&quot;formrow&quot;&gt;&lt;td colspan=2 align=&quot;right&quot;&gt;&lt;input type=&quot;Submit&quot; value=&quot;Add&quot;/&gt;&lt;td&gt;&lt;/tr&gt;
                &lt;/table&gt;
                &lt;/form&gt;
                &lt;h2&gt;Current Forwarders&lt;/h2&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span>
                <span style="color: #666666; font-style: italic;">// List current forwarders</span>
                <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;dl&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fe_db_connection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT * from forwardings WHERE destination = \''</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fe-sessdata'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\' ORDER by source ASC'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;dt&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'source'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'destination'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;a href=&quot;?delete='</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'source'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;(delete)&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;'</span><span style="color: #339933;">.</span><span style="color: #990000;">nl2br</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/dd&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/dl&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$fe_db_connection</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;index.php?logout=1&quot;&gt;Logout&lt;/a&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f3n.org/2008/08/email-spam-prevention-techniques-sender-specific-forwarders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

