Spam, death and taxes

Spam, death and taxes
14 November 2003

Email spam - like death and taxes - is unavoidable. But unlike the inevitability of the latter two, there are counter measures for spam.

Just as smoking hastens death and increases your contributions to the Chancellor of the Exchequer, our web sites can seriously damage the health of our email inbox.

Spammers, who must by now rank in standing somewhere below traffic wardens, second hand car dealers, journalists and snake’s bellies, use a number of methods to collect email addresses. One of their favourite and most commonly used methods is ‘harvesting’ software that vacuums email addresses from web sites.

Mutations of the search engine spider, harvesters are released onto the net with the sole mission of finding and collecting email addresses by crawling over web sites.

The scorched earth answer to harvesters is to simply remove all email addresses from all your pages. As sledgehammers go, this is a bit on the extreme side, especially as web sites almost by definition pre-suppose some level of interaction with users.

The best solution, then, is to use email forms instead as the email address is not part of the form itself and therefore cannot be harvested.

Alternatively, you can at least make life difficult for the spammers by using JavaScript to break up your email address into segments that are reassembled in your visitor’s browser. This may not be 100 per cent bombproof, but it’s effective in most cases

The script below can be used to replace an ordinary email link

<SCRIPT LANGUAGE="javascript">
var first = 'ma';
var second = 'il';
var third = 'to:';

// example: info
var address = 'info';

// example: exampleco
var domain = 'exampleco';

var ext = 'co.uk';
document.write('<a href="');
document.write(first+second+third);
document.write(address);
document.write('@');
document.write(domain);
document.write('.');
document.write(ext);
document.write('">');
document.write('Email Me!</a>');
</script>


Change info to that of the desired email recipient and exampleco to your own domain. Retain the single quote marks where shown and leave off the domain extension at // example: and var domain = .  The script above is set for .co.uk, change var ext = to the appropriate domain extension if necessary.