the complete webmaster
tutorials reviews reference
ASP
CGI
FrontPage
HTML
Java
JavaScript

Sponsored by El Scripto

Visit the Mortgage Loan Place for Home Loans and also click here to find VA Loans on our site.

Open software to automate your online business

home / articles / cgi

Email List Manager - Setup

In part two of this article, we'll explore the details of how to set up the email list manager - elist.pl. Here's a detailed guide for installation and setup:
  • Retrieve the compressed archive, elist.zip or elist.tar.
    • If you will be running this script on a UNIX web server (the best available choice), choose elist.tar. It has the necessary protections already set on most of the files.
  • Untar (tar xf elist.tar) the archive into a directory. You'll notice that it creates a directory named "elist." This directory doesn't need to be a part of the path that is normally served to users. In fact, it shouldn't be part of it.
  • Within that directory (cd elist), do ls -l to see all the files. Here's a brief description of each:
    • badaddr.html - Displayed when an email address does not contain the mandatory @
    • badpass.html - Shown if an invalid administrator password is entered
    • byebye.html - When a user asks to be deleted from the list, this message is displayed
    • cgi-lib.pl - A handy interface for doing CGI in Perl. You'll need to move this and elist.pl into the cgi-bin directory for your web server.
    • default.html - If you run /cgi-bin/elist.pl with no email address, this file is shown
    • elist.pl - The main perl script. You'll need to move this and cgi-lib.pl into the cgi-bin directory for your web server.
    • emaillist.txt - the list of email addresses, one per line with a tab-a or tab-d to indicate if the address is active (a) or "deleted" (d). This file must be writable by your httpd process . Doing chmod a+w emaillist.txt will basically guarantee that it will work, but then anybody can change it. Contact your site administrator (aka webmaster) for more information about your web server's specific setup.
    • error.html - If a critical error occurs - like file not found - this will be displayed
    • notfound.html - Shown if a user tries to delete his or her email address, but it has already been deleted.
    • onlist.html - Shown if a user enters an email address that is already on the list.
    • sendmail.html - Displayed when the administrator wants to send an email to everyone on the list
    • thanks.html - Displayed after a user is added to the list.
  • Feel free to edit the .html files
    • Within some of the files, you'll see things like $email, $MYCGI, etc. These words that start with $ substituted by the elist.pl. The  words and their substituted values are as follows (they're not case sensitive):
      • $email - the current user's email address ("joe%blow"@doe.com)
      • $urlemail - user's url encoded email address, for use in MAILTO: urls (%22joe%25blow%22@doe.com)
      • $mycgi - the name and path to the elist.pl (/cgi-bin/elist.pl)
      • $back - uses the value of HTTP_REFERER, returned by the client's web browser, which is usually with the referring (previous) URL
    • All the .html files that elist.pl are parsed for the above strings. None of the .html files are directly accessed by the user's web browser.
  • And take a look at elist.pl, as you'll need to make some changes there, too:
    • $HOME="/home/dzs/elist" - this should be changed to the directory where the above files are located. Type "pwd" and you'll see the current directory.
    • $PASSWORD="goober" - change the goober part to any obscure word. To be safe, just use letters and numbers, symbols like $ or @ may cause problems. This password is required whenever authentication is required to view or edit the list or send mail.
    • $SENDMAIL="/usr/sbin/sendmail -i -t -v" - this command /usr/sbin/sendmail is used to actually send the email messages. You'll probably need to change the path to wherever sendmail is located on your machine. Type which sendmail to find it.
  • Now, make sure that you've moved the .pl files (elist.pl and cgi-lib.pl) into your web server's cgi-bin directory.
    • Make sure elist.pl is executable (chmod a+x elist.pl)
    • Contact your webmaster to find out where it is. It might be /usr/local/etc/httpd/cgi-bin on Apache-based servers.
  • If you're lucky, try typing the following into your nearest web browser
    • http://yourserver/cgi-bin/elist.pl
    • You should see something like this:

    • From this screen, you can enter a new email address or, if you didn't change the password, view and edit the current list.

Author: Doug Steinwand
Date: [09/16/97]

More articles about CGI
More articles by Doug Steinwand
Author Biography

Open software to automate your online business
write for us about us advertise

Copyright 1997, 1998 A Big Lime. All rights reserved.

dy>