Current Version: 0.1 - Jul 1999

Description

This is a small perl script I hacked together to make it simplier for the subscribers of one mailinglist to change their settings, subscribe to the list, unsubscribe, get their forgotten passwords and so.

It is designed to work for only one list so if you want to use it for more lists you will have to install it a couple of times. You can however share the templates as well as the logfile. You could even split up the script in two parts, do the variable initializing in one part which you copy for all of your lists and then do the actual work in the other part which is the same for all. The question arises if it is worth the trouble since the script is only 40k or so. If there is demand I will perhaps add multi list support.

Download

Release history

  • 0.1 - Jul 1999: first official release.

How it works

You have some static pages (login, subscribe, forgot), the script as well as a small C-proggy (see below).

  • If a user wants to subscribe to the list she provides an email address and is sent an authorization key. Together with this key the user can finally get on the list. This solves two problems:
    • Providing a wrong address: The user never gets a key and so can never get on the list and I have fewer addresses to unsubscribe due to bounces.
    • Providing someone else's address: Just the same as above. Note that this key is just the result of a crypt(email) so it is not that save as a randomly generated code one but it does everything I want.
  • If a user has lost his password he may get it after providing his address. If a user has lost his address too (I hate those forwarding addresses and users who are unable to look at mail headers) he may get a list of all subscribed and not concealed addresses. You may want to disable the latter feature if you feel like it.
  • When a user logs in with her email address and his password, this users settings are displayed. She may then change them or unsubscribe from the list.

All actions are done by sending email commands to the listserver ('system <list> <passwd> #<cmd>') so I do not have to take care of nasty things like file locking and I also cannot screw up the listserver's files.

The script can run under any user. The only write privileges the script needs are to it's logfile.

To find out which users are subscribed the script needs a way to read the subscribers file of your list. Since this is not possible when running as an unprivileged user (at least it was not possible on the system where I needed this script) I came up with the following idea: Write a small C program which reads the subscribers file and prints it to STDOUT. This program is then setuid listserver.

Installation

In the tarball you will find the following things: The C program, the script, the templates, the static pages, the README and the LICENCE.

  • Modify the C program (readsubs.c) so that SUBSCRIBERS_FILE points to well, the subscribersfile. Compile it, give ownership to the listserver-user and set the suid bit. Place it in some location so that the script can execute it.
  • Copy the templates to a convenient directory the script can access.
  • Copy the static pages to a directory so that they can be accessed via your web-server.
  • Copy the script to your cgi-bin directory or do whatever is needed so that the httpd uses it as a cgi script. Then change some variables at the top of the script. Namely:
   $TEMPLATES_BASE     the directory you copied the templates to
   $HOSTNAME           the fqhostname of your web server
   $DOCBASE            the vritual directory the static pages are in
   $SCRIPT_LOCATION    the virtual path to the script
   $LOGFILE            the location of the log-file (/dev/null if you don't
                       want one)
   $SUBSCRIBERS        the location of the readsubs program
   $LISTOWNER          your email address known to the listserver as the
                       owner address for your list
   $LISTSERVER         the address of your listserver
   $LISTNAME           the name of your list used by the listserver
   $LISTPASSWD         the password of your list

   $LISTNAME_TO_DISPLAY
   $LISTNAME_SHORT_TO_DISPLAY       Those 4 are used on the dynamic created
   $MAINTAINER_ADDRESS_TO_DISPLAY   web pages as well as in emails to users.
   $MAINTAINER_NAME_TO_DISPLAY

   $SENDMAIL_NO_RETURN              here you need to specify the path to
   $SENDMAIL_RETURN_LISTOWNER       sendmail or your equivalent

   $SEND_COMMAND_CC_TO_LISTOWNER    wheter you want CCs of all commands sent
                                    to the listserver
  • change the static pages so that the action part in the form tags point to the script. (Search for cgi-bin in them and adjust the path to your system)
  • Send lots of money or a picture postcard to
    Peter Palfrader
    Hoettinger Auffahrt 1
    A-6020 Innsbruck
    Austria/Europe

So that's it. Enjoy!

LICENSE

GPL (see the file LICENSE)