<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: spam code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Wed, 23 Jul 2008 09:16:50 GMT</pubDate>
    <description>DZone Snippets: spam code</description>
    <item>
      <title>Gmail - Select All Spam</title>
      <link>http://snippets.dzone.com/posts/show/4374</link>
      <description>// Standard HTML GMail does not have a select all option on the Spam page(s). Paste this into firebug console to select all...&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;for (i = 0; i &lt; document.f.t.length; i++) {document.f.t[i].checked = true;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;for each(s in document.f.t){s.checked=true;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 31 Jul 2007 14:58:01 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4374</guid>
      <author>emartin24 (Eric Martin)</author>
    </item>
    <item>
      <title>javasrcritpt email to avoid spam</title>
      <link>http://snippets.dzone.com/posts/show/2720</link>
      <description>// email is written with javascript to hide it aganst scanning.&lt;br /&gt;// if javascript is off, the email is obfuscated&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;script type="text/javascript" language=javascript&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;name=('hugo');&lt;br /&gt;at=('@');&lt;br /&gt;domain=('mueller');&lt;br /&gt;dot=('.');&lt;br /&gt;ext=('de');&lt;br /&gt;document.write('&lt;a href="mailto:' + name + at + domain + dot + ext + '"&gt;' + name + at + domain + dot + ext + '&lt;\/a&gt;');&lt;br /&gt;//--&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;noscript&gt;hugo (at) mueller (dot) de&lt;/noscript&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 27 Sep 2006 03:57:01 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2720</guid>
      <author>ovhaag (Oliver Haag)</author>
    </item>
    <item>
      <title>Hide email address from spammers with Javascript</title>
      <link>http://snippets.dzone.com/posts/show/699</link>
      <description>&lt;code&gt;&lt;br /&gt;function mangle() {&lt;br /&gt;	if (!document.getElementsByTagName &amp;&amp; !document.createElement &amp;&amp;&lt;br /&gt;		!document.createTextNode) return;&lt;br /&gt;	var nodes = document.getElementsByTagName("span");&lt;br /&gt;	for(var i=nodes.length-1;i&gt;=0;i--) {&lt;br /&gt;		if (nodes[i].className=="change") {&lt;br /&gt;			var at = / at /;&lt;br /&gt;			var dot = / dot /g;&lt;br /&gt;			var node = document.createElement("a");&lt;br /&gt;			var address = nodes[i].firstChild.nodeValue;&lt;br /&gt;&lt;br /&gt;			address = address.replace(at, "@");&lt;br /&gt;			address = address.replace(dot, ".");&lt;br /&gt;&lt;br /&gt;			address = address.replace(at, "@");&lt;br /&gt;			address = address.replace(dot, ".");&lt;br /&gt;			node.setAttribute("href", "mailto:"+address);&lt;br /&gt;			node.appendChild(document.createTextNode(address));&lt;br /&gt;			&lt;br /&gt;			var prnt = nodes[i].parentNode;&lt;br /&gt;			for(var j=0;j&lt;prnt.childNodes.length;j++)&lt;br /&gt;				if (prnt.childNodes[j] == nodes[i]) {&lt;br /&gt;					if (!prnt.replaceChild) return;&lt;br /&gt;					prnt.replaceChild(node, prnt.childNodes[j]);&lt;br /&gt;					break;&lt;br /&gt;				}&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You can use this script, if you'd like to post your email address to your homepage, but don't want to see it picked up by spammers.&lt;br /&gt;&lt;br /&gt;Just run it in your onload event handler and mark emails in your HTML as:&lt;br /&gt;&lt;br /&gt;      &lt;span class="change"&gt;markos at gaivo dot net&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This way they are still recognizable by those who don't use javascript.&lt;br /&gt;&lt;br /&gt;If you need help or want to discuss this code, please do it on my &lt;a href="http://markos.gaivo.net/blog/?p=22"&gt;blog&lt;/a&gt;.</description>
      <pubDate>Mon, 12 Sep 2005 16:04:33 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/699</guid>
      <author>markos (Marko Samastur)</author>
    </item>
    <item>
      <title>Clearing out a bunch of spam with spoofed emails that were bounced back to some poor guy with a catchall email</title>
      <link>http://snippets.dzone.com/posts/show/219</link>
      <description>We don't really want to delete them all just in case.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;cd /usr/local/scratch/&lt;br /&gt;mkdir junk&lt;br /&gt;find /var/spool/postfix -exec grep "somediscernible-feature.com" '{}' \; | awk '{print($3)}' | xargs -J X mv X ./junk/&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The "find" produces&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Binary file /var/spool/postfix/active/D/D8832E38 matches&lt;br /&gt;Binary file /var/spool/postfix/active/D/D78EC1C72 matches&lt;br /&gt;Binary file /var/spool/postfix/active/D/D593D279D matches&lt;br /&gt;Binary file /var/spool/postfix/active/D/D0EB32833 matches&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The awk&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/var/spool/postfix/active/D/D8832E38&lt;br /&gt;/var/spool/postfix/active/D/D78EC1C72&lt;br /&gt;/var/spool/postfix/active/D/D593D279D&lt;br /&gt;/var/spool/postfix/active/D/D0EB32833&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And then the mv, moves it.</description>
      <pubDate>Sat, 23 Apr 2005 17:53:38 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/219</guid>
      <author>jason (Jason Hoffman)</author>
    </item>
  </channel>
</rss>
