MailServ Mailing List Gateway
IntroductionMailServ 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 RequirementsMailServ 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 ServersThe 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
- Download the following file:
- Unpack the archive. You should get the following files:
- cgi-lib.pl (written by Steven E. Brunner)
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.
- 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 subscribeYou can delete the .cf files for any mailing lists that you do not want to support.
ConfigEdit 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 = 'firstname.lastname@example.org';
- 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 PathYour 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).
- When you run majordomo, it looks at the name by which it was invoked ("majordomo").
- It loads the majordomo.cf file, which contains descriptions and code to process the commands for the Majordomo mail server.
Usage ExamplesTo 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="email@example.com"> <input type=hidden name=list value="moe-list"> </form>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 InputsThe 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.
<input type=hidden name=to value="firstname.lastname@example.org">
- The mailing list name. If you do not specify this, a field
will appear prompting the user for the list name.
<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".
<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
<input type=hidden name=errors value="email@example.com">
ExamplesYou can provide a front-end for selecting one of several mailing lists. Here are some examples. View the source to see how it works.
- General problems.
- Run "perl -c mailserv" to check the syntax of
- Also run "perl -c" on the config files that you
- 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.
- Check your server's error log (for example, /usr/local/etc/httpd/logs/error_log)
- Run "perl -c mailserv" to check the syntax of the script.
- 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 sendmail.cf 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 firstname.lastname@example.org (Patrick Fitzgerald)
- MLP config file
- Thanks to email@example.com (Garey Smiley).
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.