<?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>durdle.com &#187; Microsoft</title>
	<atom:link href="http://durdle.com/archives/category/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://durdle.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Sep 2011 13:33:15 +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>Exchange 2010 SP1 breaks pre-SP1 Transport Agents</title>
		<link>http://durdle.com/archives/2010/12/21/exchange-2010-sp1-breaks-pre-sp1-transport-agents/</link>
		<comments>http://durdle.com/archives/2010/12/21/exchange-2010-sp1-breaks-pre-sp1-transport-agents/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 11:42:45 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[exchange server 2010]]></category>
		<category><![CDATA[exchange server 2010 sp1]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[transport agent]]></category>

		<guid isPermaLink="false">http://durdle.com/?p=850</guid>
		<description><![CDATA[I&#8217;d encountered a few anomalies with the Exchange 2010 server over the last few weeks, so took the opportunity yesterday to upgrade it to SP1 and the latest Update Rollup. This revealed an annoying feature of &#8211; or bug in &#8211; Microsoft&#8217;s code that loads Transport Agents causing my RegExCatchAll Agent to crash. I also...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d encountered a few anomalies with the Exchange 2010 server over the last few weeks, so took the opportunity yesterday to upgrade it to SP1 and the latest Update Rollup.  This revealed an annoying feature of &#8211; or bug in &#8211; Microsoft&#8217;s code that loads Transport Agents causing my <a href="http://durdle.com/regexcatchall/">RegExCatchAll</a> Agent to crash.  I also learned something I didn&#8217;t know about Powershell.<br />
<span id="more-850"></span><br />
The bug I found is that if you try to install a Transport Agent that is built with Exchange 2010 pre SP1 binaries on an Exchange 2010 SP1 server you will get an error:</p>
<pre>The TransportAgentFactory type "RegExCatchAll.CatchAllFactory" doesn't exist.
The TransportAgentFactory type must be the Microsoft .NET class type of the transport agent factory.
Parameter name: TransportAgentFactory
    + CategoryInfo          : InvalidArgument: (:) [Install-TransportAgent], ArgumentException
    + FullyQualifiedErrorId : 6F5E297B,Microsoft.Exchange.Management.AgentTasks.InstallTransportAgent
</pre>
<p>This error occurs because when you install the assembly Exchange Server checks for the Types associated with the Transport Agent Assembly.  This means it looks for the versions of Microsoft.Exchange.Data.Common.dll and Microsoft.Exchange.Data.Transport.dll it was compiled with.  Since they were pre SP1 DLLs it won&#8217;t find them on the SP1 system.  This is also true if (as in my case) you had already successfully installed the Transport Agent on a non SP1 system and subsequently upgraded Exchange to SP1.  Once Exchange starts as SP1 for the first time, your Transport Agent will fail to start and crash the Exchange Transport Service. </p>
<p>The fix, for now, is to recompile the Transport Agent using the SP1 copies of the two DLLs which you&#8217;ll find on the Exchange Server in:</p>
<pre>C:\Program Files\Microsoft\Exchange Server\V14\Public</pre>
<p>Once you have a fixed DLL, you&#8217;ll need to <a href="http://durdle.com/regexcatchall/uninstall/">replace the running copy</a> on your Exchange Server.  This took me several attempts &#8211; and for about 20 minutes I thought there was an error with my code as I continued to get the error message above.  It turned out that because I had tried to <a href="http://durdle.com/regexcatchall/installation/">install</a> the broken DLL once in my Powershell session, and hadn&#8217;t exited and restarted Powershell, it was in some sense &#8220;caching&#8221; the failure.  In the end I issued an IISRESET from within Powershell, then tried to install the DLL again.  </p>
<p>This time it worked perfectly and now my Transport Agent is running happily under Exchange Server 2010 SP1.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2010/12/21/exchange-2010-sp1-breaks-pre-sp1-transport-agents/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Run YOURLS on IIS 7</title>
		<link>http://durdle.com/archives/2010/08/23/run-yourls-on-iis-7/</link>
		<comments>http://durdle.com/archives/2010/08/23/run-yourls-on-iis-7/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 11:23:55 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[urlrewrite]]></category>
		<category><![CDATA[yourls]]></category>

		<guid isPermaLink="false">http://durdle.com/?p=845</guid>
		<description><![CDATA[If you&#8217;re running YOURLS on an IIS 7 box you&#8217;ll need the correct settings in your web.config to perform the URL Rewriting. An example web.config with the correct settings is below. Note the security section which disables some paranoid protection IIS has switched on by default. If your server doesn&#8217;t allow double escaping of request...]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running <a href="http://yourls.org/">YOURLS</a> on an IIS 7 box you&#8217;ll need the correct settings in your web.config to perform the URL Rewriting.  An example web.config with the correct settings is below.  <span id="more-845"></span></p>
<p>Note the security section which disables some paranoid protection IIS has switched on by default.  If your server doesn&#8217;t allow double escaping of request strings, the YOURLS links with a + in them don&#8217;t work.  This breaks the admin interface and the stats reporting pages.</p>
<p>The rest of the web.config is standard stuff to fix a non-canonical hostname, and make sure the IDs are rewritten to the right pages:</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;requestFiltering</span> <span style="color: #000066;">allowDoubleEscaping</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/security<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Canonical Host Name&quot;</span> <span style="color: #000066;">stopProcessing</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;(.*)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{HTTP_HOST}&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^domain\.com$&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Redirect&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;http://domain.com/{R:1}&quot;</span> <span style="color: #000066;">redirectType</span>=<span style="color: #ff0000;">&quot;Permanent&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;YOURLS 1&quot;</span> <span style="color: #000066;">stopProcessing</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;^([0-9A-Za-z]+)/?$&quot;</span> <span style="color: #000066;">ignoreCase</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;conditions</span> <span style="color: #000066;">logicalGrouping</span>=<span style="color: #ff0000;">&quot;MatchAll&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{REQUEST_FILENAME}&quot;</span> <span style="color: #000066;">matchType</span>=<span style="color: #ff0000;">&quot;IsFile&quot;</span> <span style="color: #000066;">ignoreCase</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{REQUEST_FILENAME}&quot;</span> <span style="color: #000066;">matchType</span>=<span style="color: #ff0000;">&quot;IsDirectory&quot;</span> <span style="color: #000066;">ignoreCase</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Rewrite&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;/yourls-go.php?id={R:1}&quot;</span> <span style="color: #000066;">appendQueryString</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;YOURLS 2&quot;</span> <span style="color: #000066;">stopProcessing</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;^([0-9A-Za-z]+)\+/?$&quot;</span> <span style="color: #000066;">ignoreCase</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Rewrite&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;/yourls-infos.php?id={R:1}&quot;</span> <span style="color: #000066;">appendQueryString</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;YOURLS 3&quot;</span> <span style="color: #000066;">stopProcessing</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;^([0-9A-Za-z]+)\+all/?$&quot;</span> <span style="color: #000066;">ignoreCase</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Rewrite&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;/yourls-infos.php?id={R:1}&amp;amp;all=1&quot;</span> <span style="color: #000066;">appendQueryString</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2010/08/23/run-yourls-on-iis-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RegExCatchAll Transport Agent for Exchange 2007/2010</title>
		<link>http://durdle.com/archives/2010/05/29/regexcatchall/</link>
		<comments>http://durdle.com/archives/2010/05/29/regexcatchall/#comments</comments>
		<pubDate>Sat, 29 May 2010 15:31:16 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[catchall]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[email suffix]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[exchange 2007]]></category>
		<category><![CDATA[exchange 2010]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[transport agent]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/?p=777</guid>
		<description><![CDATA[How moving email services to an Exchange Server revealed email suffix matching as a missing feature, and how to implement that feature using a Transport Agent.]]></description>
			<content:encoded><![CDATA[<p>For a number of years now I have been doing two things with email:</p>
<p>1) I run my own <a href="http://www.microsoft.com/exchange/">Exchange Server</a>.  <a href="/wp-content/uploads/Exchange2010Logo.png" rel="lightbox[818]"><img class="alignleft  size-full wp-image-805" title="Exchange 2010 Logo" src="/wp-content/uploads/Exchange2010Logo.png" alt="Exchange 2010 Logo" width="150" height="150" /></a>It provides <a href="http://technet.microsoft.com/en-us/exchange/bb288524.aspx">ActiveSync</a>, <a href="http://www.microsoft.com/exchange/code/OWA/index.html">Outlook Web Access</a>, and <a href="http://office.microsoft.com/en-us/outlook/hp101024441033.aspx">Outlook Anywhere</a> for my company’s email domains and my personal durdle.com domain.</p>
<p>2) I provide email addresses at durdle.com for family members (and a few people who just happen to share the family name).</p>
<p>&nbsp;<br />
&nbsp;</p>
<p>Historically all those family emails have been maintained by <a href="http://www.gradwell.com/">Gradwell</a> without going near my Exchange Server.  The durdle.com <a href="http://en.wikipedia.org/wiki/MX_record">MX records</a> in DNS pointed to Gradwell’s servers for mail delivery and I had a forwarder at Gradwell that would redirect my – and only my – messages to the Exchange Server.  For a number of reasons I needed to change this so that all email is delivered via my Exchange Server.  I made this change yesterday, discovering one problem in the process.</p>
<h5>Email Suffixes</h5>
<p>Gradwell’s mail server supports email suffix matching.  If you have a <a href="http://mail.google.com/">GMail</a> account you may be familiar with the approach.  Say you have an email <a href="mailto:john@gmail.com">john@gmail.com</a>.  Gmail will actually deliver mail to <a href="mailto:john+anything@gmail.com">john+anything@gmail.com</a>; you can add any suffix you like after the + and GMail will still deliver it to your inbox.  Gradwell support this by allowing you to place a period after the local part so you can use <a href="mailto:john.anything@example.com">john.anything@example.com</a>.  You don’t have to create these email addresses anywhere – you can just start using it and the mail server will make sure it gets to you.</p>
<p>This is fantastically useful because it means that when a website asks for your email address you can give out a custom throwaway email just for that site.  So when you sign up at DodgyCo.com, you give them the email <a href="mailto:john.dodgyco@example.com">john.dodgyco@example.com</a>.  If you ever receive spam because DodgyCo sold your email address you’ll know a) who sold you out, and b) which email address to add to your spam filter.</p>
<h5>Exchange Server</h5>
<p>Enter Microsoft Exchange Server.  I’m currently running the 2010 edition, but the problem I’m about to describe (and solve!) exists in every recent version.  Exchange Server doesn’t support email suffixes.  Every recipient has to have an alias created on the server.  If you want to deliver to <a href="mailto:john.suffix@example.com">john.suffix@example.com</a> you’d better remember to create an alias for that user, otherwise the Exchange Recipient Filter will reject the message since – as far as it is concerned – the user does not exist on the server.</p>
<p>Worse, Exchange doesn’t even implement any generic <a href="http://en.wikipedia.org/wiki/Catch-all">CatchAll</a> functionality.  CatchAll would allow the server to redirect messages for non-existing recipients to a specific address. <a href="http://catchallagent.codeplex.com/" target="_blank">Smart people</a> have created solutions to the CatchAll problem but all that does is allow you to define one mailbox for ALL non-deliverable messages to be delivered to.  Since I need to provide suffix matching to multiple users this doesn’t work for me.</p>
<p>Time to extend Exchange’s functionality!</p>
<h5>Transport Agents</h5>
<p><a href="http://technet.microsoft.com/en-us/library/bb125012.aspx" target="_blank">Transport Agents</a> were introduced in Exchange 2007 to replace Exchange 2003’s SMTP Event Sinks and have been retained largely unchanged in Exchange 2010.  Broadly speaking when a message arrives at an Exchange Server it is moved through the transport pipeline as each SMTP event occurs.  Each <a href="http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol">SMTP event</a> (Connect, MAIL FROM, RCPT TO, etc) can trigger an interested Transport Agent to perform some actions on the message.<br />
The complete list of SMTP events and their sequence is described on <a href="http://technet.microsoft.com/en-us/library/bb125012.aspx" target="_blank">this Exchange Server TechCenter page</a>.</p>
<p>Transport Agents are simply DLLs written in managed code that fire on SMTP events.  Back when I contracted for the <a href="http://www.mod.uk/">MOD</a> I wrote a Transport Agent for Exchange 2007 which demonstrated that Exchange was capable of performing Dominance Checking on outgoing emails so I knew that it wouldn&#8217;t take to long to write a Transport Agent to filter incoming messages.  I was able to reuse some of that code and also made use of some of <a href="http://www.codeplex.com/site/users/view/wilbertdg" target="_blank">Wilbert De Graaf</a>’s <a href="http://catchallagent.codeplex.com/" target="_blank">CatchAll Agent</a> code which made the handling of a configuration file very quick to implement.  Thank you Wilbert!</p>
<h5>Requirements</h5>
<p>I had a couple of requirements for my Transport Agent:</p>
<p>1) It should allow redirection of multiple suffixes to different recipients.</p>
<p>2) It should allow me to ban delivery to any previously used suffixes and ensure that the sender receives a non-deliverable report.</p>
<p>I ended up meeting these requirements by using C# to write a Transport Agent that accepts its configuration from an XML file.  The config.xml defines multiple regular expressions to match against along with associated redirect addresses.  It also lists banned email addresses which the Transport Agent should reject.</p>
<p>To mimic the <a href="http://www.gradwell.com/support/howto/article/392">Gradwell behaviour</a> which we were already making use of I needed to match firstname then a dot and then any word before the domain.  This is a fairly simple <a href="http://support.microsoft.com/kb/308252">regular expression in C#</a>, and looks like this:</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;">^firstname+\.[a-z]+@example.com$</pre>
</div>
</div>
<p>The config.xml takes the form:</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;redirect</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^john+\.[a-z]+@domain.com$&quot;</span> <span style="color: #000066;">address</span>=<span style="color: #ff0000;">&quot;john@domain.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;redirect</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^jane+\.[a-z]+@domain.com$&quot;</span> <span style="color: #000066;">address</span>=<span style="color: #ff0000;">&quot;jane.doe@gmail.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;banned</span> <span style="color: #000066;">address</span>=<span style="color: #ff0000;">&quot;john.spam@domain.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;banned</span> <span style="color: #000066;">address</span>=<span style="color: #ff0000;">&quot;jane.newsletter@domain.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</div>
</div>
<p>Here we define two patterns for redirect, one to an internal recipient and one redirect to an external SMTP address.  We also ban two known &#8220;bad&#8221; recipient addresses.</p>
<p>You’ll need to provide at least one redirect entry, but you’re not required to ban any addresses if you don&#8217;t want to.  Also, while redirects specifiy regular expressions to match, banned addresses are just strings which are simply compared.  I leave it as an exercise for the reader to add regular expressions to the banned list!</p>
<h5>The Code</h5>
<p>Whenever the config.xml file is changed, the agent reloads it and parses the XML.  It puts the banned emails into a List and the regular expression patterns and redirect addresses into a Dictionary.  If any of the emails in the config appear invalid the new configuration is rejected and the agent continues to use the running config.</p>
<p>The agent defines a RCPT TO: handler.  This event is fired as soon as the sending MTA starts to transmit the recipient addresses.  rcptArgs contains the argument we need: RecipientAddress, which we store as a lowercase string for comparison.  Although the spec (<a href="http://www.faqs.org/rfcs/rfc2821.html">RFC2821</a>) actually requires email addresses to be case sensitive, I&#8217;ve never met an MTA that adheres to that part of the spec.  So for our purposes email addresses are case insensitive and we can do all comparisons in lowercase.</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> RcptToHandler<span style="color: #008000;">&#40;</span>ReceiveCommandEventSource source, RcptCommandEventArgs rcptArgs<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
<span style="color: #008080; font-style: italic;">// Get the recipient address as a lowercase string.</span>
<span style="color: #6666cc; font-weight: bold;">string</span> strRecipientAddress <span style="color: #008000;">=</span> rcptArgs<span style="color: #008000;">.</span><span style="color: #0000FF;">RecipientAddress</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToLower</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre>
</div>
</div>
<p>It performs two checks.  First &#8211; is the recipient address in the ban list?</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Search the banned email List for the recipient.</span>
<span style="color: #6666cc; font-weight: bold;">bool</span> exists <span style="color: #008000;">=</span> catchAllConfig<span style="color: #008000;">.</span><span style="color: #0000FF;">Banned</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Exists</span><span style="color: #008000;">&#40;</span>element <span style="color: #008000;">=&gt;</span> element <span style="color: #008000;">==</span> strRecipientAddress<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>exists<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// If found respond to the sending MTA with the reject response.</span>
	source<span style="color: #008000;">.</span><span style="color: #0000FF;">RejectCommand</span><span style="color: #008000;">&#40;</span>CatchAllAgent<span style="color: #008000;">.</span><span style="color: #0000FF;">rejectResponse</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">// No further processing.</span>
	<span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre>
</div>
</div>
<p>And second, does the recipient address match any of the regular expressions?</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// For each pair of regexps to email addresses</span>
<span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var pair <span style="color: #0600FF; font-weight: bold;">in</span> catchAllConfig<span style="color: #008000;">.</span><span style="color: #0000FF;">AddressMap</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// Create the regular expression and the routing address from the dictionary.</span>
	Regex emailPattern <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Regex<span style="color: #008000;">&#40;</span>pair<span style="color: #008000;">.</span><span style="color: #0000FF;">Key</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	RoutingAddress emailAddress <span style="color: #008000;">=</span> pair<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span><span style="color: #008000;">;</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">// If the recipient address matches the regular expression.</span>
	<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>emailPattern<span style="color: #008000;">.</span><span style="color: #0000FF;">IsMatch</span><span style="color: #008000;">&#40;</span>strRecipientAddress<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">// And if the recipient is NOT in the address book.</span>
		<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">addressBook</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&amp;&amp;</span>
			<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">addressBook</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Find</span><span style="color: #008000;">&#40;</span>rcptArgs<span style="color: #008000;">.</span><span style="color: #0000FF;">RecipientAddress</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
		<span style="color: #008000;">&#123;</span>
			<span style="color: #008080; font-style: italic;">// Redirect the recipient to the other address.</span>
			rcptArgs<span style="color: #008000;">.</span><span style="color: #0000FF;">RecipientAddress</span> <span style="color: #008000;">=</span> emailAddress<span style="color: #008000;">;</span>
&nbsp;
			<span style="color: #008080; font-style: italic;">// No further processing.</span>
			<span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
		<span style="color: #008000;">&#125;</span>
	<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre>
</div>
</div>
<p>Note that in both cases as soon as we&#8217;ve got a positive result we stop further processing.  If an address is in the ban list we immediately reject it, and if we find a matching regular expression we use its paired address to redirect the message and stop looking for further matches.</p>
<p>I&#8217;ve given enough information here that a C# developer with some spare time could create this Transport Agent themselves.  However I know that it is really useful to have a package you can just download and install without having to worry about compiling it yourself.  So I&#8217;ve packaged the DLL together with installation scripts and the <a href="/regexcatchall/installation/">install and configuration guide</a>.  </p>
<p>Please visit the <a href="/regexcatchall/">product page</a> for more information and to purchase the Transport Agent.  Payment is via PayPal, you will receive the download link within minutes of payment.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2010/05/29/regexcatchall/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix orphaned SQL Server users</title>
		<link>http://durdle.com/archives/2010/03/11/fix-orphaned-sql-server-users/</link>
		<comments>http://durdle.com/archives/2010/03/11/fix-orphaned-sql-server-users/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 17:04:21 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Future Howard]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/?p=765</guid>
		<description><![CDATA[I always forget this in between using it, so for the benefit of future Howard, here&#8217;s how to fix orphaned users resulting from restoring a SQL database to a different machine. First, list the orphan users to make sure this is the problem: EXEC sp_change_users_login 'Report' Usually I already have the login and password set...]]></description>
			<content:encoded><![CDATA[<p>I always forget this in between using it, so for the benefit of future Howard, here&#8217;s how to fix orphaned users resulting from restoring a SQL database to a different machine.<span id="more-765"></span></p>
<p>First, list the orphan users to make sure this is the problem:</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">EXEC</span> sp_change_users_login <span style="color: #ff0000;">'Report'</span></pre>
</div>
</div>
<p>Usually I already have the login and password set up on the server, this being the case you can fix the orphan by doing:</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">EXEC</span> sp_change_users_login <span style="color: #ff0000;">'Auto_Fix'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'user'</span></pre>
</div>
</div>
<p>If not, and you want/need to create the login and password, you&#8217;ll need to do this instead:</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">EXEC</span> sp_change_users_login <span style="color: #ff0000;">'Auto_Fix'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'user'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'login'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'password'</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2010/03/11/fix-orphaned-sql-server-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS7 web.config fun</title>
		<link>http://durdle.com/archives/2010/03/08/iis7-web-config-fun/</link>
		<comments>http://durdle.com/archives/2010/03/08/iis7-web-config-fun/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 20:15:11 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[gradwell]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[memset]]></category>
		<category><![CDATA[web.config]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[workavoidance]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/?p=747</guid>
		<description><![CDATA[I spent some time last weekend migrating the Work Avoidance site away from Gradwell and onto a dedicated virtual server from MEMSET. Since this involved a move to a Windows box away from UNIX hosting, I had to configure in IIS7 some of the settings I had in the .htaccess under the UNIX host. For...]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/iis7-logo.jpg" rel="lightbox[747]"><img src="/wp-content/uploads/iis7-logo.jpg" alt="IIS7 Logo" title="IIS7" width="200" height="125" class="alignleft size-full wp-image-757" /></a>I spent some time last weekend migrating the <a href="http://workavoidance.net">Work Avoidance</a> site away from <a href="http://www.gradwell.net/">Gradwell</a> and onto a dedicated virtual server from <a href="http://www.memset.com/dedicated-servers/virtual.php">MEMSET</a>.  Since this involved a move to a Windows box away from UNIX hosting, I had to configure in IIS7 some of the settings I had in the .htaccess under the UNIX host.<span id="more-747"></span></p>
<p>For example, I want a canonical host name (so visitors always see <a href="http://workavoidance.net">workavoidance.net</a> with no www prefix in the address bar) and to ensure that the <a href="http://wordpress.org/">WordPress</a> permalinks work properly.  While I was at it I took the opportunity to disable hot-linking of our images, since for some reason a Russian website had taken a shine to some of our <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=303892009&#038;mt=8">Armory</a> graphics.</p>
<p>Below is the <code>web.config</code> I created.  It redirects users to the canonical host name, enables WordPress permalinks and disables hot-linking of our images.  The redirect proved something of a problem to begin with.  Our iPhone App &#8220;<a href="http://itunes.apple.com/us/app/monkey-shaker/id290779801?mt=8">Monkey Shaker</a>&#8221; has an online <a href="http://workavoidance.net/highscores/shaker/">high score system</a>.  Scores are submitted from the app via an encrypted HTTP POST to a PHP page which decrypts the information and updates the database.  I discovered that when you issue a server side redirect most clients won&#8217;t re-POST their data to the new page &#8211; they will issue a GET for the new page and the original POST data is lost.  This meant that highscore submissions were failing.</p>
<p>(NB: this isn&#8217;t as big a disaster as it sounds since we built a very robust mechanism to retry score submission into the app.)</p>
<p>So, you&#8217;ll note an extra entry in the web.config to exclude that page from a redirect:</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{URL}&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;scoresubmit\.php$&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre>
</div>
</div>
<p>&#8220;Why not just change the URL in the app to be canonical?!&#8221; You may well ask.  Yes, we probably will, but that relies on issuing an update and getting <strong>over a quarter of a million users</strong> to download it.  This way we don&#8217;t have to rely on that.</p>
<p>Still to come &#8211; how I implemented caching in WordPress and in our high score system to improve performance.</p>
<p>Here&#8217;s the rewrite rules section of the completed web.config:</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Canonical Host Name&quot;</span> <span style="color: #000066;">stopProcessing</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;(.*)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{HTTP_HOST}&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^workavoidance\.net$&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{URL}&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;scoresubmit\.php$&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Redirect&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;http://workavoidance.net/{R:1}&quot;</span> <span style="color: #000066;">redirectType</span>=<span style="color: #ff0000;">&quot;Permanent&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Prevent image hotlinking&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;.*\.(gif|jpg|png)$&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{HTTP_REFERER}&quot;</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^$&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{HTTP_REFERER}&quot;</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^http://workavoidance\.net/.*$&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Rewrite&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;/no.png&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wordpress&quot;</span> <span style="color: #000066;">patternSyntax</span>=<span style="color: #ff0000;">&quot;Wildcard&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{REQUEST_FILENAME}&quot;</span> <span style="color: #000066;">matchType</span>=<span style="color: #ff0000;">&quot;IsFile&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">input</span>=<span style="color: #ff0000;">&quot;{REQUEST_FILENAME}&quot;</span> <span style="color: #000066;">matchType</span>=<span style="color: #ff0000;">&quot;IsDirectory&quot;</span> <span style="color: #000066;">negate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/conditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Rewrite&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;index.php&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2010/03/08/iis7-web-config-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Notification Area Balloon Tips in Windows XP</title>
		<link>http://durdle.com/archives/2008/08/29/disable-notification-area-balloon-tips-in-windows-xp/</link>
		<comments>http://durdle.com/archives/2008/08/29/disable-notification-area-balloon-tips-in-windows-xp/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 10:04:50 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Future Howard]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Tech Support]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2008/08/29/disable-notification-area-balloon-tips-in-windows-xp/</guid>
		<description><![CDATA[I&#8217;m rebuilding my new Sony Vaio Z with Windows XP, and as usual there are a load of tweaks I need to make to the OS before I feel &#8220;at home&#8221; again.  Since the fingerprint reader software on the new build has an annoying habit of popping up info balloons on every boot &#8211; regardless...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m rebuilding my new Sony Vaio Z with Windows XP, and as usual there are a load of tweaks I need to make to the OS before I feel &#8220;at home&#8221; again.  Since the fingerprint reader software on the new build has an annoying habit of popping up info balloons on every boot &#8211; regardless of how often I click them &#8211; I felt the need to <a href="http://support.microsoft.com/kb/307729">Disable Notification Area Balloon Tips in Windows XP</a>.</p>
<p>Much better.</p>
<p>And sorry Vista, I tried, I really did.  I liked how your hot-swap driver support meant I could switch between stamina and speed modes without a reboot, but I hated your poor network performance against my NAS (even with SP1).  Maybe I&#8217;ll try again on the next new laptop.  Oh, and Sony?  Thank you for my XP downgrade CD and drivers.  Lovely.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2008/08/29/disable-notification-area-balloon-tips-in-windows-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My 1080p HTPC: Multiple Freeview Tuners</title>
		<link>http://durdle.com/archives/2008/07/12/my-1080p-htpc-multiple-freeview-tuners/</link>
		<comments>http://durdle.com/archives/2008/07/12/my-1080p-htpc-multiple-freeview-tuners/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 09:09:24 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Cinema]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HDTV]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/?p=305</guid>
		<description><![CDATA[When I originally built my HTPC, I used 2 Freeview cards.  Each Hauppauge WinTV-NOVA-T500 has two Freeview tuners in one PCI card.  By installing two of these (and with some registry tweaking) it is possible to build a device that can record/watch 4 Freeview channels at once. Out of the box the Vista Media Centre...]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/1010207853.jpg" rel="lightbox[305]"><img class="alignleft size-full wp-image-307" style="margin: 2px; float: left;" title="Hauppauge WinTV-NOVA-T-500" src="/wp-content/uploads/1010207853.jpg" alt="" width="150" height="150" /></a>When I originally built my <a href="http://blog.durdle.com/archives/2008/06/21/my-1080p-htpc/">HTPC</a>, I used 2 Freeview cards.  Each Hauppauge <a href="http://www.hauppauge.co.uk/site/products/data_novat500.html">WinTV-NOVA-T500</a> has two Freeview tuners in one PCI card.  By installing two of these (and with some registry tweaking) it is possible to build a device that can record/watch 4 Freeview channels at once.</p>
<p>Out of the box the Vista Media Centre GUI is only capable of setting up 2 tuners at any one time.  This is odd since the underlying tuner architecture is actually quite capable of using as many tuners as you can fit in the machine.  Your limiting factor, really, is the speed you can push the data to your hard drive.<span id="more-305"></span></p>
<p>So, how to enable the extra tuners?  Here&#8217;s the process I followed to make it work:</p>
<ol>
<li>Start Media Centre by pressing the Green Button.</li>
<li>Go to Setting -&gt; TV -&gt; Set Up TV Signal.</li>
<li>Follow the process for configuring the tuners, in the first run through you will configure the first 2 tuners.</li>
<li>Close the Media Centre interface.</li>
<li>Stop the Media Centre Receiver service.
<pre>net stop ehrecvr</pre>
</li>
<li>Open the Registry Editor, and navigate to this key:
<pre>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
\Media Center\Service\Video\Tuners\{71985F48-1CA1-11D3-9CC8-00C04F7971E0}</pre>
<p>That GUID on the end is the one for the DVB-T tuning space.</li>
<li>Under the GUID key there will be one key per tuner device &#8211; you need to find the two keys that were just configured by the Media Centre interface.</li>
<li>You can locate them by looking for the <strong>EnabledForMCE</strong> value under the <strong>UserSettings </strong>key.  If the value is set to <strong>0xffffffff</strong> it has been configured, if not it&#8217;ll be <strong>0&#215;00000000</strong>.</li>
<li>Export those two keys to .reg files by right-clicking on the GUID key and choosing Export [Selected Branch Only].  Name each one separately (Tuner1.reg, Tuner2.reg, etc).</li>
<li>Repeat steps 1 to 9 for each set of two tuners you have, in my case I just had to do the process twice, once for tuners 1 and 2, then again for 3 and 4.</li>
<li>Once you&#8217;ve exported all the registry keys, and ensuring the ehrecvr service is still stopped, double-click all the keys to import them into the registry.</li>
<li>Close Registry Editor.</li>
<li>Start the Media Centre interface.</li>
</ol>
<p>You can test that this has worked by entering the guide and starting recordings on 4 channels at once.  You should be able to go into Recorded TV and watch the streams of any of the channels as they are being recorded.</p>
<p>Sounds great, right?  So why am I using satellite cards instead of Freeview?  Two reasons: signal quality, and HD support.  We&#8217;re in a bit of a fringe signal area, and our aerial is fed via a series of boosters and distribution devices through multiple apartments.  I happen to have a Sky Minidish with a quad LNB anyway from when I used to subscribe to SkyHD.  I can&#8217;t put a new Freeview aerial on the roof, and loft-based aerials don&#8217;t offer the signal quality necessary.  So I turned to the <a href="http://www.hauppauge.co.uk/site/products/data_novahds2.html">satellite cards</a>, which offer the benefit of HD content too.  More on them, and why using Satellite under Vista is a pain in the proverbial in the next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2008/07/12/my-1080p-htpc-multiple-freeview-tuners/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disable Windows Desktop Search Explorer Integration</title>
		<link>http://durdle.com/archives/2008/07/10/disable-windows-desktop-search-explorer-integration/</link>
		<comments>http://durdle.com/archives/2008/07/10/disable-windows-desktop-search-explorer-integration/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 11:44:49 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Future Howard]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/?p=301</guid>
		<description><![CDATA[Another post from the &#8220;helping future Howard&#8221; category.  I use Outlook 2007, which is great, but in order to be able to search your email with decent performance you must install Windows Desktop Search.  Unfortunately when you do this it integrates with Explorer without asking permission to do so.  This means that should you hit...]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/windows_search.jpg" rel="lightbox[301]"><img class="alignleft size-full wp-image-302" style="border: 0pt none; margin: 1px; float: left;" title="Windows Search" src="/wp-content/uploads/windows_search.jpg" alt="" width="127" height="402" /></a>Another post from the &#8220;helping future Howard&#8221; category.  I use Outlook 2007, which is great, but in order to be able to search your email with decent performance you must install Windows Desktop Search.  Unfortunately when you do this it integrates with Explorer without asking permission to do so.  This means that should you hit F3 to search inside an Explorer folder you&#8217;ll be presented with the monstrosity on the left; an entirely useless dialogue box unless you happen to be indexing the contents of your entire machine and network.  I&#8217;m not: I only index my Outlook content.</p>
<p>So, to disable this you must open regedit and find:</p>
<pre>HKEY_CURRENT_USER\Software\Microsoft\Windows Desktop Search\DS</pre>
<p>and set the <strong>ShowStartSearchBand </strong>value to <strong>0</strong>.  That&#8217;ll give you back the default behaviour.</p>
<p>I find it quite irritating that the interface chooses to admonish me that I&#8217;m not indexing the content instead of just presenting me with the search functionality that is able to search the content for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2008/07/10/disable-windows-desktop-search-explorer-integration/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>VMRC Graphic Corruption</title>
		<link>http://durdle.com/archives/2008/01/30/vmrc-graphic-corruption/</link>
		<comments>http://durdle.com/archives/2008/01/30/vmrc-graphic-corruption/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 15:17:29 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Virtualisation]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2008/01/30/vmrc-graphic-corruption/</guid>
		<description><![CDATA[I&#8217;m looking for help here.&#160; The image (click to embiggen) you see here is a screen capture of one of my virtual machines suffering some form of graphic corruption.&#160; It should look like this.&#160; This happens often enough now that it is seriously irritating.&#160; I can make it go away by closing VMRC and reconnecting...]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm3.static.flickr.com/2015/2230814484_0f03e09b3a.jpg" rel="lightbox[282]"><img src="http://farm3.static.flickr.com/2015/2230814484_0f03e09b3a_m.jpg" align="left" /></a> I&#8217;m looking for help here.&#160; </p>
<p>The image (click to <a href="http://www.kottke.org/07/06/embiggen-cromulent">embiggen</a>) you see here is a screen capture of one of my virtual machines suffering some form of graphic corruption.&#160; It should look like <a href="http://www.flickr.com/photos/hjd/2230814418">this</a>.&#160; This happens often enough now that it is seriously irritating.&#160; I can make it go away by closing VMRC and reconnecting to the server, but I&#8217;d rather not have to do so several times a day (sometimes multiple times an hour).</p>
<p>I&#8217;m running <a href="http://www.microsoft.com/windowsserversystem/virtualserver/">Virtual Server</a> 1.1.603.0 EE R2 SP1, and all my VMs have Virtual Addition version 13.813 installed.&#160; The VMRC client which came with R2 SP1 is version 1.1.603.0.</p>
<p>The same corruption is visible from machines with ATI and NVidia graphics cards, running XP SP2, Vista or Server 2003.</p>
<p>So &#8211; why is this happening, and how can I stop it?</p>
<p>Anyone?</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2008/01/30/vmrc-graphic-corruption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Windows Media Player context menu entries</title>
		<link>http://durdle.com/archives/2007/12/19/remove-windows-media-player-context-menu-entries/</link>
		<comments>http://durdle.com/archives/2007/12/19/remove-windows-media-player-context-menu-entries/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 09:01:36 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[context menu]]></category>
		<category><![CDATA[shell extensions]]></category>
		<category><![CDATA[windows media player]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2007/12/19/remove-windows-media-player-context-menu-entries/</guid>
		<description><![CDATA[I use Winamp to play mp3s.  I always have done &#8211; it&#8217;s lightweight, I like the interface and it has the few plugins I need.  I don&#8217;t need the bloat of iTunes or Windows Media Player.  However, I seem to have Windows Media Player installed &#8211; I don&#8217;t remember installing it, and I probably wouldn&#8217;t...]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://www.winamp.com/player" title="Winamp" target="_blank">Winamp </a>to play mp3s.  I always have done &#8211; it&#8217;s lightweight, I like the interface and it has the few plugins I need.  I don&#8217;t need the bloat of iTunes or Windows Media Player.  However, I seem to have Windows Media Player installed &#8211; I don&#8217;t remember installing it, and I probably wouldn&#8217;t have noticed it was there were it not for the plethora of context menu items it installs.</p>
<p>All I wanted to do was right-click a selection of mp3s and then queue them in the Winamp playlist.  That&#8217;s when I noticed a load of entries like &#8220;sync to device&#8221;, &#8220;burn&#8221;, &#8220;add to library&#8221;.  Turns out Media Player had hooked into the shell.  Thankfully, there is a way to get rid of this integration (which added a delay of several seconds to my right-click!).</p>
<p>Here&#8217;s the fix, click Start, Run and type:</p>
<blockquote><p>regsvr32 /u wmpshell.dll</p></blockquote>
<p>Horrah &#8211; a much cleaner context menu.  I wonder if there is any software to allow you to remove specific entries from that list?</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2007/12/19/remove-windows-media-player-context-menu-entries/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

