Indiana University


ComputerScience






 Home

 Contacts

 Courses

 Academics

 Careers

 Research

 People

 Calendar

 Resources

 Facilities
   FAQ
   System Notices
   Help
   Hardware
   Software
   Network
   Policies
   CSG Staff
   Lindley Hall

CSG FAQ

Q: How can I prevent spammers from obtaining my email address from web pages?

Email spammers use a variety of techniques to gather email addresses. One common technique is to grab them from web pages so you may want to avoid including your email address in your web pages. However, you may need to give out your email address but still want to hide it from the spammer's email harvesting programs. Here are some ways you can do this:
  • email2png - There is a little script called email2png that takes an email address (or any character string, actually) and converts it to a png image that you can use in place of a textual email address. For example, you can use this script as follows:

    email2png janedoe@cs.indiana.edu ~/.hyplan/email.png

    This generates a png image file in your .hyplan directory named email.png that you could then use in your .html file with a standard IMG tag.

    Here is a sample image created by email2png:

    Jane Doe Email Address

    This image was included using the following html:

    <IMG SRC="janedoe.png" ALT="Jane Doe Email Address">

    Note that the busy background is used to try and prevent simple OCR scanning from getting the email address from the image. If you prefer to use a simple transparent background you can just use the -b flag to email2png and you will get an image like this:

    Jane Doe Email Address

  • tomail.cgi - On the CS web server you can use the local tomail cgi script we have available. As an example of how to use this, you could replace a typical mailto link in your web document that may look like this:

    <A HREF="mailto: username@cs.indiana.edu"> username@cs.indiana.edu </A>

    with this:

    <A HREF="/cgi-bin/tomail.cgi?name=username"> Email me </A>

    When someone clicks on the 'Email me' link, it will generate a human-readable version of the email address using a combination of text and images that would be difficult for automated scanners to parse. It also presents a CAPTCHA challenge that, if passed, redirects the user to a normal mailto link. By default, it will use the domain of cs.indiana.edu. If you want to specify another domain, you just pass tomail.cgi the domain parameter. For example, this would display the address joebob@down.home.edu:

    <A HREF="/cgi-bin/tomail.cgi?name=joebob&domain=down.home.edu"> Email me </A>

    Here is an Sample of the tomail script.

  • Web Form - Another technique is to use web forms instead of mailto links. Please see the associated FAQ on this topic for the system available on the CS web server.

There is also a UITS Knowledge Base Entry on this topic that provides additional information.




See an error in this FAQ entry? Please report it.

[Return to the FAQ index]









Valid HTML 4.01!