This chapter is all about running your own e-mail server. Why would a Webmaster want to do this, you ask? When visiting a home page on the Web, it is customary that comments can be e-mailed to an address in the form of webmaster@yourco.com. If you would
like to carry on this tradition, you will probably want to run your own mail server.
You might also complement your Web site with a mail server if you offer leased Internet service to your clients. Think about it. With a well-built Web site (like the one in this book), a mail server, and an FTP server, you could sell Internet access.
We'll cover the FTP server in the next chapter.
Competition in the category of e-mail server software for Windows 95 is just heating up. We have only found a few such packages. All are strong in many areas. The one we chose to include with this book is SLmail95 from Seattle Lab, a humbly named
company in Seattle, Washington.
While we're on the subject of mail, we'll also show you how to install Blat, which is how you e-mail HTML form data. Blat is not a GUI program, it's a Windows 95 DOS prompt (or NT console-mode) program. The astute reader might remember why we need
console-mode programs: they are the only kind of CGI application that some HTTP servers can launch. At any rate, Blat runs in the background and it doesn't really need a GUI.
Here's an example of what you can do with Blat. Suppose you sell software over the Internet and you would like to encourage and track your customer feedback. In order to make it as simple as possible for your customers to express their opinion about
your product, you provide a convenient HTML form on your home page. When a customer fills out the form, the SUBMIT action invokes a CGI Perform program to parse the data. Then it is passed to Blat to be e-mailed to your inbox.
At the end of the chapter, we talk briefly about list servers, gopher servers, and finger servers.
Because you are going to want to have several e-mail addresses for yourco.com (for example, webmaster, info, and sales), and possibly a list server in the future, we are going to show you how to install SLmail 95 from Seattle Lab.
Copy SLmail95.exe from the CD-ROM into a temporary directory. Using the Explorer or Run command from the Start button, execute SLMAIL95.EXE to self-extract the archive. Once the archive is extracted, execute SETUP.EXE. You will see a few straightforward
copyright and basic configuration dialogs. That's all there is to it to get it up and running.
Now is a good time to setup your Webmaster e-mail account. And once you see how easy this is, you can add other mail addresses as appropriate. Here are the steps:
A listserver (also called listserv) is a service program that lets its group members broadcast e-mail messages amongst themselves. An individual user sends a single e-mail message to the server, which in turn sends it to all the other members of
the listserv group.
Luckily, SLmail 95 is also a very good list server.
SLmail mailing lists may be set up with numerous options in order to make them usable in many configurations and situations. For example, if you are configuring a mailing list to serve as a special-interest discussion group, you would want to configure
it differently than if you were configuring a mailing list for product announcements. The Configure Mailing Lists dialog enables you to set options appropriately for either case.
The first section of this dialog comprises the mailing list options. Most of these options are self-explanatory.
Mailing lists may be closed or open. Anyone may send mail to an open mailing list; only members of the mailing list may send mail to a closed list. By default, SLmail creates mailing lists as closed.
In a moderated group, the moderator (owner of the list) must review and approve or reject all mail to the list before members of the list receive it.
In a moderated join mailing list, all requests for addition to the list are forwarded to the moderator (the list owner), who must approve them before they are added.
If the bulk mailing list messages option is enabled, messages from various members of the list may be grouped together and sent in a single package at a time when the system is not busy.
If this option is selected, the list owner receives a copy of all messages sent to the list. This option is enabled by default.
If this option is selected, SLmail checks each time it is run to verify that all files necessary for the mailing list are present. If the option is not selected, SLmail will not attempt to access the files until they are needed.
You can create a read-only list by enabling this option.
This option (enabled by default), determines whether inquiries to SLmail will divulge the existence or the members of a mailing list, either through the ESMTP EXPN command or through queries to the listserver. The same applies to these two options: List
Presence Visible to Listserver Queries and List Members Visible to Listserver Queries.
If this option is enabled, the subject line of all mail received by members of the list will be prefaced by the name of the list. This lets recipients recognize mail from the list. The subject to be used is entered in the text field immediately below
this check box.
If you do not desire a list to grow larger, this option will make SLmail inform all would-be subscribers that their request to join the list has been denied.
This option increases the level of SLmail logging. If the option is enabled, every access to the mailing list will generate an entry in a log file. The log file to use may be typed in the text box immediately below the check box, or you may use the
Browse button to select an existing file.
Digests are a powerful feature of mailing lists that receive heavy use. A digest is a collection of past articles. New users who join a list in progress can receive a digest that will quickly bring them up to date. If digests are enabled, the list box
lists the current digest number, and the button to the right will cause a new digest to be created and the digest number to be incremented.
You may wish to send a standard greeting (perhaps a Frequently Asked Questions file) to new members who join the list. This option allows you to do so. You may type the name of the file to send in the edit box, or use the Browse button to select an
existing file.
It is sometimes appropriate to attach a standard messageperhaps a disclaimer, or an informational message, or a signatureto all mail associated with the mailing list. This option allows you to do so. You may type the name of the file to send
in the text box, or use the Browse button to select an existing file.
The second section of the Configure Mailing Lists dialog enables you to determine the default settings for new users when they join the mailing list.
If Reproduce Submitted Articles to Sender is enabled, the member receives copies of their own submissions. If Send Short Acknowledgment is checked instead, the members will not receive copies of their own submissions. They will instead receive only an
acknowledgment that the article was received. (The default is Reproduce Submitted Articles to Sender.) If Conceal Presence on List is checked, other members will not see the address of the new member.
A new mailing list may be quickly configured by copying the configuration of an existing list. If you click the Copy Configuration from Other List button, a File Open dialog will let you choose the existing configuration to copy. You may then make what
changes you desire for the new list.
Adding a user to the mailing list may be accomplished in two different ways. The first way is to use the Mailing List Member Maintenance Dialog as the list owner or as the system administrator and manually add the user information. The other way is to
use the list server commands to send a request to the list server account for the node that maintains the list and ask it to add you to that mailing list. In this case, you may have to go through a moderator in order to get added to
the list.
The Mailing Lists dialog is the central point from which the mailing lists are maintained. You access this dialog by choosing "Mailing List Maintenance" from the System Menu.
As different mailing lists are selected in the Mailing Lists list box, the three controls to the right are changed so that they display the information about the selected mailing list. Below these controls is an additional control labeled Rescan Items.
This button, when pressed, scans through all the existing mailing lists to ensure that all the settings are correct.
The first set of controls shows the number of pending subscriptions and has a button labeled Process Pending Subscriptions. Pressing this button creates the Mailing List Subscriptions Dialog, which is used to accept or reject requests for membership in
a given list. This process is necessary if the mailing list is set up for moderated additions to the list.
Beneath that is the set of controls that shows the number of pending messages, and has a button labeled Process Pending Messages. Pressing this button creates the Mailing List Submissions Dialog, which is used to accept, reject, forward, or delete
messages sent to a given moderated list. Because the list is moderated, this process is needed to guarantee that unwanted messages do not get through the list.
Finally, there is the set of controls used to maintain the membership of the list, and that set has a button labeled Edit Members. Pressing this button creates the Mailing List Members Dialog, which is used to add, delete, or modify the users that
subscribe to a given mailing list. This process is used in conjunction with the Bulk Additions feature and the listserver auto-responder to allow for three ways to add members to the mailing lists.
The Subscriptions dialog is responsible for handling the remote requests to join a moderated list. On the left side of the dialog is a list box containing the addresses of the remote users who wish to gain membership to the specified list. On the right
side are two edit fields labeled Address and Name. These edit fields are set when a selection is made from the list box.
At the bottom of the dialog are two buttons marked Approve and Reject. Pressing the Approve button moves the remote user into the membership list for the current mailing list. The Reject button sends a rejection notice back to the remote user. Please
note that valid text must be placed in each of the fields in order to make the Approve and Reject buttons enabled. The Address field is read-only, and cannot be changed, but the Name field is editable.
You may add many members to a mailing list at once with the Bulk Additions feature. To do so, you first prepare an input file in the format described next. Then, choose Bulk Additions under the System Menu. From the drop-down menu, choose Mailing List
Members. From the list box, select the mailing list to which you wish to add members. Finally, use the open file dialog to find the file you have prepared.
The format of the file is as follows:
<address>,<name> #comment
as in
support@seattlelab.com,Seattle Lab Technical Support #us
Any white space at the end of the line, once the comments are removed, is also removed from the line.
Once the operation has been completed, a message box is displayed that informs the user of the number of entries successfully added. Otherwise, a message box is displayed that states what kind of error occurred, and where it occurred.
Blat is a public domain Windows NT console-mode (or Windows 95 DOS prompt) utility that e-mails a file to a user using SMTP. The program requires GENSOCK.DLL (borrowed from WinVN). A Registry entry is generated when the program is used with the -install
flag. This stores the address of the default SMTP server and the address of the default sender. Blat is used by CGI Perform to mail the contents of an HTML form to whomever we choose.
Use WinZip to decompress Blat directly from the CD-ROM to a new directory on your hard drive. Blat doesn't include a setup program, but it really doesn't need one. Just follow these steps:
A Registry entry is generated when the program is used with the -install flag. This stores the address of the default SMTP server and the address of the default sender (which may be overridden with the -f flag).
Impersonation can be done with the -i flag, which puts the value specified in place of the senders address in the From: line of the header. When this is done, however, the real sender's address is stamped in the Reply-To: and Sender: lines. This feature
can be useful when using the program to send a message from Windows users who are not registered on the SMTP host.
The Blat command line has a few variations. Here are the command types, followed by a description of each of the syntax elements:
Here are the descriptions of the preceding syntax elements.
filename
the file with the message body.
-s subject
the (optional) subject line.
-t recipient
the recipient's address.
-c recipient
the carbon copy recipient's address.
-f sender
the sender's address (must be known to the SMTP server).
-i address
a From: address, not necessarily known to the SMTP server.
-h
displays help.
-server server address
overrides the default SMTP server to be used.
Note that if the -i option is used, <sender> is included in Reply-to: and Sender: fields in the header of the message.
Although we installed Blat for use with the CGI Perform CGI application, you can use Blat from the command line or implement your own CGI applications that call Blat. Here are some examples of using Blat from the command line.
Blat -install smtphost.bar.com foo@bar.com
This command sets the host and userid.
Blat -install smtphost.bar.com
This command sets the host only.
Blat myfile.txt -s "A file for pedro" -t foo@bar.com
This example sends a file with subject line A file for pedro.
Blat myfile.txt -s "A file for mark" -t fee@fi.com -f foo@bar.com
The -f option overrides the default sender.
Blat myfile.txt -s "A file for pedro" -t foo@bar.com -i "devil@fire.hell"
In this example, -i replaces the From: line in the address, but leaves the Reply-To: and Sender: lines.
Blat myfile.txt -s "animals" -t fee@fi.com -c "moo@grass.edu,horse@meadow.hill"
The -c option here mails carbon copies to users moo@grass.edu and horse@meadow.hill.
The authors of Blat have very generously placed it in the public domain. This means you can use Blat free of charge, for any purpose you like. The source code is also available free of charge! The authors of Blat are Mark Neal (mjn@aber.ac.uk) and Pedro Mendes (prm@aber.ac.uk).
You might have guessed that these topics don't belong in a chapter about e-mail. You're right. In fact, if you'll excuse us, we really didn't feel that they belonged anywhere in this book. Here, in between the sections on mail servers, list servers, and
the next chapter on FTP, is as good a spot as any to tell you why we decided to leave out Gopher and Finger.
As discussed in Chapter 1, "Internet Technology Primer," Gopher has been around for a while and is a popular way to provide access to a repository of text documents on the Internet. Gopher's greatest weakness is also its greatest strength: it
only provides text-based menus to the clientno hypertext. Of course, that means that it can run on just about any kind of client that can hook up to the Net. The main reason we don't bother running a Gopher server is that you can do the same thing
with a Web server. All you need to do is provide an unordered list of <A HREF> tags in your HTML code. Virtually all browsers can handle either text or binary documents (through MIME) by either invoking the appropriate viewer application or by
prompting the user to do a download. The fact that the Web includes other Internet client/server protocols as well as HTTP, is one reason why the Web has become so popular.
"What about finger?" you ask? We'll give it to you straight: There are a couple of reasons for us bypassing a finger server. Finger has frequently been used as a back door by hackers to breach security and we simply didn't have the time and
space to include everything about the Internet in one book.
The FTP server is up next, followed by WAIS. Installing these two servers will complete the list of Internet servers for building a complete Web site. There is much more to come!