pbmtopng

How to convert an email address into an web page graphic

The unix commands/technique shown below can be used to convert an email address into a web page graphic.


Why would you want to do this?:
Publishing your email address(es) on the web (in text form) makes them vulnerable to web crawling spiders and various other web-bots. These spiders/bots scour the web looking for various things. Some spiders index web sites for search engines, some look for copyrighted material, some look for plagiarism, some look for email addresses. The ones looking for email addresses are used by spammers to build mailing list. By converting text into a graphic, you render it virtually unreadable to spiders or web-bots.

Isn't my email address already secure?:
If you think that your email addresses are currently secure, you may be surprised to find that the spam-bots have reached a high level of sophistication. The vulnerability lays in the '@' symbol. No matter how clever your encoding method(s), eventually it all comes down to the '@' symbol. If you've got an '@' symbol on your web page, it's more than likely part of an email address. Even if your '@' symbol has been ASCII/Entity/Unicode encoded, it's still an '@' symbol. Encoding your email addresses in a textual form is inherently prone to decoding. If the text can be read in, it can be decoded.

But I'm using JavaScript to encode my email address:
Even sophisticated programing and scripting is vulnerable. There are numerous applications/scripts designed specifically for spammers. These programs are designed to defeat all types of character encoding, to remove extraneous characters, de-assemble sophisticated variable substitution methods. If your email addresses are posted in textual form, there's probably a script capable of decoding them. Many of these scripts are incorporated into spammers web-bots. No matter how you encode your email address(es), a spammer will write some code to decode it. Even the graphic method that I use will some day fall victim to the spam-bots. Hopefully, the spammers will have a more difficult time cracking the image method. Until then, I recommend an image encoding method.

It's an Arms Race!

What's the downside?:
The email addresses (encoded/displayed as an image) cannot be read by the blind. Blind people have processes/programs which read web pages for them. Unfortunately, these processes cannot read graphics. If your web site needs to conform to government standards for accessibility, you'll have to stick with text for your email addresses.

Your users will not be able to click on the graphic, and have their email software automatically open a blank email with your address on it. The 'mailto:' link is a weak link. You may use a graphic image, but attaching a valid mailto: link (which includes your email address) to the graphic, totally negates the benefit of using a graphic in the first place. Users are going to have to manually type your email address when they compose an email to you.

Note: I attach bogus mailto: links to my email address images. Clicking on the image will call up your email software, but the email address will need to be manually changed from xxxxxx@xxxxxxxxx.xxx to a valid address by the user. I even include a reminder in the Subj: line of the draft message created.

commands1

The 'echo' command is a common unix command, found on virtually any machine running a flavor of Unix. You may need to download, compile, or install the next three piped commands (pbmtext, pnmcrop, pnmpad). The output is redirected to a named graphic file.

After creating the portable bit mapped graphic, you'll need to convert it into a web ready image format. I use the PNG format; it incorporates a transparency effect, and has no licensing issues.

commands2

The 'pnmtopng' command may need to be downloaded, compiled, or installed on your system. The -text option allows you to embed some comments in the image. You'll need to create a text file using a texteditor in order to make use of this option (I used TextEdit 1.2 (v185) for Mac). At the end of the command, you can see that I've redirected the output to a named .png graphic file. You should probably proof/view the images using an image viewer. I used GraphicConverter 4.5.2.

How do I code the HTML?

It's a relatively stright forward job to code the HTML once you've got the images created. Here's a sample of the code that I use:

commands3

If you'd like to see the end result in action, check the bottom of this page, or you can point your browser at my feedback page: http://www.robsworld.org/feedback.html All the email addresses on that page have been converted into png format using the method/technique described above.

Most of the commands (other than 'echo') used in this technique are part of a package called 'netpbm'. I've got netpbm 9.25-1 installed on my machine, and it works fine on my Mac. You can use the Unix 'man' command to learn more about any of the commands used above. Provided you have the software installed, and man paths properly configured. I ran these commands from my Mac's terminal. If you own a Mac, you can use 'Fink' to download and install the 'netpbm' package.

I hope this technique/method helps. Please feel free to email me any comments or suggestions regarding this technique/method.

Robert L. Vaessen

My Mac (when this web page was originally created):
Hardware/System/Software
Hardware: 350Mhz PowerPC G4 (PCI) w/1024Mb RAM
System: OS 10.2.3 (build 6G30) / OS 9.2.1
Software: Terminal 1.3.1 (v82), GraphicConverter 4.5.2, TextEdit 1.2 (v185)
Unix commands: echo, pbmtext, pnmcrop, pnmpad, pnmtopng

Author: Robert L. Vaessen e-mail: robert robsworld org
Last Updated:

This page has been accessed times since Thu, Jan 16, 2003.