Protect e-mail links in Umbraco V3
Published on 18. juni 2007 inA while back, I got this little httpmodule for protecting emails from being harvested by spam robots. It was written in .Net 1.1, so i just converted it to 2.0 and put it in a zip file.
Get the source (CodeArchitects.SafeMailLink_source.zip)
To install: 1: copy the CodeArchitects.SafeMailLink.dll to the "bin" folder of your umbraco install 2: Add this line to the web.config in the <httpModules> section:
<add name="SafeMailLinkModule" type="CodeArchitects.SafeMailLink.SafeMailLinkModule, CodeArchitects.SafeMailLink" />
You're done!
Hope you enjoy it :-)
UPDATE 15-07-2009: I just updated the source/binaries with changes sent in by Gordon Saxby. Fixes an issue where the module causes problems when there is no ending html tag.
Related posts
Comments
Comments disabled
Comments are disabled for this post.

On 06. juli 2007 by Warren Buckley
Hiya Morten
I would be intresting to know how this works and prevents spam robots from harvesting emails from an umbraco site.
Thanks,
Warren :)
On 06. juli 2007 by Morten Bock
Hi Warren
It runs through the output from umbraco and inserts a little javascript funtion that obfuscates the mailto links to something like my<!--x-->mail<!--y-->com but still keep them workin when clicked. Try it out and se the generated code.
On 29. juli 2007 by Tobbe
Hejsan Morten,
såg att lite av min gamla kod fanns med om man laddar ner källkoden.
builder.Replace("http://web01.ec.local/", "/");
builder.Replace("http://de-web.ec.local/", "/");
builder.Replace("http://dk-web.ec.local/", "/");
är fritt fram att ta bort.
On 29. oktober 2007 by Thomas Kahn
Excellent solution!
It saved me tons of extra work and works great!
I'm just so impressed with all the cool add-ons and components for Umbraco that people develop!
On 30. oktober 2007 by Mads
Hej Morten
Jeg kan ikke finde "httpModules" i min web.config. Skal jeg bare tilføje den manuelt så?
On 30. oktober 2007 by Morten Bock
Hej Mads
Den ligger som standard i Umbraco 3.0, så den burde være der. I web.config filen fra version 3.0.3 starter den på linie 57.
Den ligger inden i system.web afdelingen...
On 31. oktober 2007 by Mads
Hehe, det var mig der så helt forkert. Jeg sad og kiggede i 2.1 versionen.
Mange tak for det herlige modul Morten :-)
On 01. november 2007 by Mads
Hvor kan man i øvrigt finde flere af denne slags moduler henne? Jeg går ud fra at du ikke er den eneste hehe :-) Kan du anbefale nogle sites?
On 28. oktober 2008 by Gordon Saxby
I tried using this on a couple of sites, but had a problem (see http://forum.umbraco.org/yaf_postst6736_Google-Sitemap-not-working-in-305.aspx).
Is there a way to make your module work and enable XML output at the same time?
On 28. juli 2009 by Bjørn Fridal
Thanks for this module its a little life safer and a big thanks to Gordon Saxby. My Umbraco log was overflowing with errors until I got the updated version.
On 18. maj 2010 by Mario Allegro
Hello Morten,
is this source and binary still available or is it recommded to not use it.
I tried to download and got a 404 error.
Thank you very much!
Mario!
On 20. maj 2010 by Morten Bock
Hi Mario
The files probably got lost when I moved my blog to a new host/platform. But I am pretty sure that I have them somewhere. I will take a look and send you an email when I get them uploaded.