It would be great if everybody could set his/her own custom link class instead of 'spamspan' to prevent spam bots to detect the email addresses by recognizing the class="spamspan". Thx!

Comments

vitalie’s picture

Did the bots actually recognized it? Can you provide a patch?

mibfire’s picture

I dont know anything about this but if i should write a bot then the first would be to check this module to know how i can recognize the protection for emails. I can provide a patch of cos.

vitalie’s picture

OK, then I would like to question this further. You see, if I am to write a bot as you say, I can preg_match any class, knowing the structure of what's inside <span class="spamspan"></span>.

It seems to me that this leads to what's on the description page of this module:

This technique is unlikely to be absolutely foolproof. It is possible in theory for a determined spambot to harvest addresses from your site no matter how you disguise them. But research suggests that the by far the great majority of spambots do not bother to attempt to collect addresses which have been hidden using JavaScript. Indeed, most spambots cannot currently read JavaScript at all.

mibfire’s picture

The <span class="anything"></span> could match with other else too, not just spamspan if you used regex. So if i wanna get only emails i couldnt use regex for this.

But you are right in that we cant do 100% protection but we can increase the level of it.

vitalie’s picture

OK, I am all for increasing the level of it.

Here's the default output of spamspan:

My work email is <span class="spamspan"><span class="u">me</span> [at] <span class="d">example.com</span></span> and my home email is <span class="spamspan"><span class="u">me</span> [at] <span class="d">example.org</span></span>.

As a bot, it is enough match <span anything><span class="u">user</span>anything<span class="d">domain</span>. This way you avoid other spans and have your user and domain to put together as user@domain.

I think a valid increase in protection would also set new classes instead of u, d, and maybe others that are now used (see dev version).

mibfire’s picture

and [at].:) So the complete list would be: spamspan, u, d, [at]

vitalie’s picture

yeah, [at] and [dot] are already configurable.

Here's what I believe to be the most complete output of spamspan:

<span class="spamspan"><span class="u">name</span> [at] <span class="d">example<span class="t"> [dot] </span>com</span><span class="h"> (subject: A%20Subject!, body: Some%20Body.) </span><span class="a"> (Email me)</span><span class="e"><!--id="myid" class="myclass"--></span></span>

Original input: <a id="myid" href="mailto:name@example.com?subject=A%20Subject!&amp;body=Some%20Body." class="myclass">Email me</a>

mibfire’s picture

looks very amazing:)))