BarelyFitz Designs :

MailServ Mailing List Gateway


MailServ provides a World Wide Web interface to several types of mailing list servers. Users can select commands, enter information, and press buttons to send email commands to the mail server. For example:

MailServ does not provide the actual mailing list services (you'll need to have an existing mailing list management program to do that), but what do you expect -- MailServ is free!

You can install MailServ on your own server, and even customize it with your own look-and-feel. Since MailServ is written entirely in Perl, it's a snap.

System Requirements

MailServ is written in the Perl scripting language; therefore, you must have Perl before you can run it.

MailServ was written for UNIX systems, but with a little work can probably be modified to run on other types of systems. It uses /usr/lib/sendmail to send e-mail to the mailing list server, so if you port it to a PC, for example, you'll probably have to change it and provide your own command to send mail.

Supported Mailing List Servers

The following mailing list servers are currently supported. Click a button to get a demo of the interface.

Not all mail server commands are necessarily supported, but you can easily add additional commands.

Download & Install

  1. Download the following file:


  2. Unpack the archive. You should get the following files:

    I suggest making a cgi-bin/MailServ subdirectory and installing mailserv there, and a cgi-bin/MailServ/config/ subdirectory to store the config files. MailServ will automatically look for config files either in the same directory in which it was invoked, or in the config subdirectory (or you can edit the mailserv script to make it look elsewhere).

    If MailServ cannot find the files that it needs, it should display an error message.

  3. For each type of mailing list server that you want to support, create a link to the mailserv script:
    ln -s mailserv listproc
    ln -s mailserv listserv
    ln -s mailserv mail-list
    ln -s mailserv maiser
    ln -s mailserv majordomo
    ln -s mailserv majordomo-admin
    ln -s mailserv mlp
    ln -s mailserv pmdf
    ln -s mailserv smartlist
    ln -s mailserv subscribe
    You can delete the .cf files for any mailing lists that you do not want to support.
You can also create your own config files to make MailServ work with additional mailing list servers. Copy the the script and modify it to your liking, and create a link to mailserv for your new mailing list server.


Edit the mailserv script to point everything to your WWW server. You must edit at least the following variables:
Contains the email address of the WWW site administrator. For example:
$owner = '';

Contains one or more regular expressions to restrict the webservers from which MailServ can be called. Change this to match your web server, or comment it out if you don't mind if other people use your web server to send email.

Take a look at the other available config options.

Include Path

Your web server should automatically set your Perl include path to point to the cgi-bin directory that contains MailServ. If you are using a different WWW server, then you might have to explicitly tell MailServ where to look for the Perl include files and config files. Add a line like the following to the beginning of the mailserv script:
unshift(@INC, "/your-cgi/MailServ/", "/your-cgi/MailServ/config");
The actual values you use would depend on where in installed the mailserv script and the config files.

How Does It Know Which Config File to Use?

For these examples, I will use the majordomo script (which is a symbolic link to the mailserv script).

  1. When you run majordomo, it looks at the name by which it was invoked ("majordomo").
  2. It loads the file, which contains descriptions and code to process the commands for the Majordomo mail server.

Usage Examples

To run MailServ, create an HTML form like the following:

The HTML for the form is:

<form method=POST action=/cgi-bin/majordomo TARGET=_blank>
<input type=submit value="Mailing list name">
<input type=hidden name=to value="">
<input type=hidden name=list value="moe-list">
You can substitute any of the valid mailing list servers instead of majordomo, and substitute your mailing list server address and listname. The target tells it to open a new window.

Form Inputs

The following inputs are valid:
The mailing list request address. If you do not specify this, a field will appear prompting the user for the address. Example:
<input type=hidden name=to value="">

The mailing list name. If you do not specify this, a field will appear prompting the user for the list name. Example:
<input type=hidden name=list value="moe-list">

One or more commands that the user has already selected. You can specify one or more commands to be "pre-selected". Example:
<input type=hidden name=commands value="subscribe moe-list">
<input type=hidden name=commands value="index moe-list">

Maximum number of commands that the user can select. You should only specify this if you also specify one or more pre-selected commands. If you set it to one, MailServ jumps immediately to the final "send commands" form instead of displaying the "select commands" form. Example:
<input type=hidden name=commands value="subscribe moe-list">
<input type=hidden name=commands value="index moe-list">
<input type=hidden name=max value="1">

By default, MailServ directs email errors to the $owner address specified in the mailserv script. You can send errors to another address (such as to separate mailing list administrators). Example:
<input type=hidden name=errors value="">


You can provide a front-end for selecting one of several mailing lists. Here are some examples. View the source to see how it works.
Stooge mailing lists:
Or if you have separate digest and reflected lists, you can do something like this:

To pre-select a command, use the "commands" hidden variable in your HTML form. For example:
To pre-select multiple commands, specify multiple "commands" hidden variables. For example:
To pre-select a command and immediately skip to the final "send commands" form, add the "max" hidden variable. If you do this, I recommend you also provide an unsubscribe button. For example:


General problems.
  1. Run "perl -c mailserv" to check the syntax of the script.

  2. Also run "perl -c" on the config files that you are using.

  3. Run the linked script from the command line. For example, "./majordomo". The output should start with "Content-type: text/html", followed by a blank line, followed by the HTML for the form.

  4. Check your server's error log (for example, /usr/local/etc/httpd/logs/error_log)

When a user subscribes, email goes to the wrong address
Some mailing list servers are configured to use the SMTP envelope From header as the subscription address, so the subscription will be sent to $owner or errors address instead of to the address in the From: header. If possible, you should configure your mailing list server to use the From: header.

In particular, ListProc exhibits this problem, and must be patched before you can use MailServ with it. From the MLM FAQ:

Sometimes the MLM needs to be sure the person sending it a command is truly who he or she says. Forging mail is trivial, so the From: line really can't be trusted -- even so it's the only identification most MLM's require. Three exceptions: 1. ListProc 6.0c uses the envelope "From_" line, which is annoyingly different (the distribution does include a patch to make it use "From:" like everyone else). [...]

You also might have to edit your file to configure your web server's UID as a "trusted" UID, so it can use the -f argument with sendmail.

Copyright 1993 Steven E. Brenner
mailserv and .cf files
Copyright (C) 1996 By (Patrick Fitzgerald)
MLP config file
Thanks to (Garey Smiley).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSEŽ See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Page: all 1 2 3 4 5 6 7 8