EProtect
Goal
eProtect is an email obfuscation add-on for PmWiki. It intercepts pages before they are saved, and rewrites email addresses in a protected format.
Solution
With the eProtect script [[mailto:username@domain.net]]
is automatically replaced with [[hidden-email:hfre@qbznva.arg]]
when you save the page you are currently editing. The actual version of this script supports also alternative linktext e.g. [[mailto:username@domain.net | Nice guy]]
is then replaced with [[hidden-email:hfre@qbznva.arg | Nice guy]]
.
Upon viewing the page, this [[hidden-email:]]
directive is interpreted by eProtect, and then translated into a small javascript which is programmed to decode the protected address. If you gave an alternative linktext then this linktext is displayed.
Viewing the source code of the page will not reveal the true email address, nor will clicking on the "Edit Page" link.
But beware: Do not use the email-address as alternative text as this would render this script useless.
About Email Obfuscation
Email obfuscation is simple method of obscuring an email address so email harvesters cannot easily extract that information from your website. Email obfuscation is not encryption, so it's not terribly difficult for someone to write a de-obfuscation script, however, my preliminary research indicated that none of the top email harvesters currently on the market have any such features. BTW: The encoding is ROT13.
Download one
- e-protect.phpΔ -> before PHP 5.5
- e-protect2.phpΔ -> PHP 5.5 - PHP 7.2 (requires PmWiki 2.2.58+)
- e-protect-php72.phpΔ -> PHP 5.0 - PHP 7.2+ compatible (requires PmWiki 2.2.58+)
Installation
- Copy e-protect.php to your
cookbook/
folder. - Add this line to your config.php file:
include_once('cookbook/e-protect.php')
; - That's it! You're now protected and every
[[mailto:
statement is automatically converted.
Resources
I did a lot of research on spam, anti-spam, obfuscation, and email harvesters. I found quite a few sites and various methods and approaches. Here are just a few of the (better) sites that I visited.
- http://www.private.org.il/harvest.html "How Do Spammers Harvest Email Addresses?"
A very informative arcticle all-around, especially for people who are new to the Internet and don't have a clue. (http://www.private.org.il/harvest.html) - http://www.spamhaus.org/news.lasso?article=9 "The Spam Definition and Legalization Game"
An interesting article about spam and law makers (USA). (http://www.spamhaus.org/news.lasso?article=9) - http://ez2ba.com/html/help/guides/get-rid-of-spam.html "How To Get Rid Of Spam"
A decent page with a lot of suggestions to reduce spam that you probably wouldn't have thought of. (http://ez2ba.com/html/help/guides/get-rid-of-spam.html) - http://www.spamblogging.com/archives/000081.html "Proof Of Concept To Throw Off The Bots"
A very "geek speak" method. It would probably work too, if only I could understand what this guy was talking about. Still good reading if you are really bored one day!
http://www.spamblogging.com/archives/000081.html - Some on-line email obfuscators (cut and paste to your html pages).
- http://www.u.arizona.edu/~trw/spam/spam.htm Javascript obfuscator
http://www.u.arizona.edu/~trw/spam/spam.htm - http://ez2ba.com/html/site-toys/obfuscate-email.html Plain HTML obfuscator
http://ez2ba.com/html/site-toys/obfuscate-email.html
- http://www.u.arizona.edu/~trw/spam/spam.htm Javascript obfuscator
History
- 07-Apr-2005 Replaced
str_rot13
withstrtr
with proper parameters. This fixes the issues with @ and withstr_rot13
not being available in early versions of PHP. JoachimDurchholz - 07-Apr-2005 Changed install directory from
local/
tocookbook/
JoachimDurchholz - 18-Nov-2004 Conversion and extension for use with PmWiki 2.x Klonk
- 07-Jan-2005 Found a problem in decoding the email addresses when SideBar and main text contains emails to decode. Moved script to page header. Klonk
- 29-Jan-2005 Reformatted html links in Resources to prevent ez2ba.com from redirecting to homepage due to trailing space (%20) after URL when page title included in double-brackets. Kevin
- 15-Feb-2005 Added support for
[[text -> mailto:target]]
markup Klonk - 18-Feb-2005 Fixed bug (missing commenting of Javascript); now produced code is valid XHTML Klonk
- 18-11-2004 I almost have rewritten it completely to get it working with PmWiki2. The text of this page is also almost copied from PmWiki 1.x. I just added some stuff to point out the changes I added to the script. Comments are welcome... Now I can move my homepage to PmWiki2 ;-) Klonk
- 11-05-2004 This script was originally written by Steve Leite for PmWiki 1.x.
See Also
- DeObMail - Unobtrusive e-mail link (de)obfuscator
Contributors
- Steve Leite (see PmWiki 1.x Cookbook)
- Karl Loncarek Klonk
Comments
See discussion at EProtect-Talk
User notes +2 -1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.