Compatibility with sendmail
[Previous][Next][Contents][Index]

Compatibility with sendmail


This appendix provides information for system administrators who are considering migrating, or who have already migrated, from sendmail to Netscape Messaging Server.

This appendix is divided into three sections:

Functional compatibility

The following sections specify the differences between Unix sendmail and the Messaging Server sendmail replacement with regard to SMTP, aliases and mail forwarding, program delivery, file delivery, and mailing lists.

SMTP network interface

You can configure Unix sendmail to exchange mail with remote destinations using SMTP. Mail routing is achieved with rule sets containing address production rules written in a specialized programming language used to take addresses apart and put them back together in useful ways. Although this is a very powerful facility, it is error prone and requires extensive knowledge of Internet standards to set it up correctly.

In contrast, Netscape Messaging Server comes with a preconfigured SMTP channel for interacting with other machines on the Internet. If you have any special routing requirements, the Messaging Server provides channel aliases and a mail-routing table, which should cover those needs.

The following two sections describe mail flow through the SMTP channel of the Messaging Server.

Incoming mail

Incoming mail is received by the SMTP-Accept module of the Messaging Server. Its job is to read in one or more messages from a remote mail server and store them in the message queue. For each incoming message, SMTP-Accept invokes the SMTP-Router to determine how to route the message to its destination.

Outgoing mail

If the SMTP-Router determines that a message needs to be delivered to a remote site using SMTP, it gives the message to the SMTP-Deliver module. This module contacts the destination computer (actually one of its mail exchangers) and delivers the message. If for some reason delivery fails, the message remains queued for a later attempt or is returned (if the error is considered permanent).

Aliases and mail forwarding

Unix sendmail supports several types of aliases in the /etc/aliases file and in users' personal .forward files. The various types of aliases allow

With Netscape Messaging Server, each type of alias is created differently because of the structure of user accounts in the directory database.

Delivery to programs

Using Unix sendmail, you can create an alias or forward that delivers an incoming message to a program. The program then reads the message and performs some operation depending on the message contents. Usually these types of programs filter messages into different mailboxes or send out vacation notices. This functionality makes it easy to extend the mail system to do virtually anything you want but has been problematic with respect to security.

You can use the Administration Server's New User form to set up Netscape Messaging Server program delivery. Because there are security issues specific to program delivery, program delivery is disabled by default.

Delivery to files

Unix sendmail makes it possible to set up an alias or .forward file to append mail to a file. This can be used to keep a record of incoming mail or to delete incoming mail by sending it to /dev/null. However, the author of sendmail recommends using an alternate delivery agent for delivery-to-file needs invoked through the delivery-to-program facility.

The Messaging Server's sendmail replacement will append undeliverable messages to users' dead.letter files, for users with Unix Delivery enabled. No general delivery-to-file facility is planned for the Messaging Server; appending mail to a file should be done with the delivery-to-program facility.

Mailing lists

Mailing lists in Unix sendmail are implemented using aliases and program deliveries. List recipients are stored either in the aliases database or in an external file using an :include: alias. Several mailing-list administration programs are available that can automate the task of maintaining recipient distribution lists, while sendmail handles the delivery of the messages.

With Netscape Messaging Server 3.0, you create groups in the Administration Server's User and & Group forms to provide mail lists. (See Chapter 1, "Working with users and groups" for information on creating groups.)

Command-line compatibility

The Messaging Server mail system includes a program that replaces /usr/lib/sendmail on Unix machines. Most of Unix sendmail's functionality is performed by one or more modules in the Messaging Server, so the sendmail replacement actually has limited use. However, it is needed for compatibility with many mail programs that employ Unix sendmail rather than SMTP to deliver their mail. It can also be used to start up the Messaging Server mail system and to check and deliver the mail queue.

Sending mail with the sendmail replacement

The Netscape Messaging Server sendmail replacement program maintains compatibility with existing software that delivers mail using the sendmail command. This software runs the sendmail command and feeds it the message to be delivered. It is then up to the sendmail replacement program to deliver the message to all the recipients.

Some examples of commands that work for sending mail are

/usr/lib/sendmail -t < /tmp/message

cat file1 | /usr/lib/sendmail -oem recip1,recip2

For a complete list of command-line switches and options related to sending mail, see "Sendmail replacement program reference" later in this appendix.

Starting the Messaging Server with sendmail

Because Unix sendmail comes installed on most Unix-based machines, many scripts such as system boot scripts exist to start up sendmail. This is done with a command such as

/usr/lib/sendmail -bd -q30m

The Netscape Messaging Server sendmail replacement recognizes this command and starts up the Messaging Server if it isn't already running. The
-q30m switch is ignored in this command because queue intervals are set up in the system configuration of the Messaging Server.

Checking the mail queue

Many system administrators are used to typing mailq to check for queued messages. The sendmail replacement provided with the Messaging Server will respond to this command with the contents of the mail queue. However, many server administrators prefer to use the Messaging Server mail queue form, which makes processing the queue a little easier.

To check the mail queue, type mailq at a command prompt. If there are no queued messages, that fact will be reported:

% mailq

Mail queue is empty.

%

If there are queued messages, each host that has queued messages waiting to be delivered will be listed, along with the number of pending deliveries. For example, output might look like this:

% mailq

            Queued Messages    Destination Host

            ---------------    ----------------

                   2           math.csusj.edu

                   3           expertelligence.com

%

In this example, five messages are waiting for delivery. Delivering all of them should require two connections to other machines because the Messaging Server attempts to deliver all queued mail for a host before disconnecting.

Other modes

The Unix sendmail program has several other operating modes that aren't necessary or aren't supported in Messaging Server 3.0. For a complete list of supported operating modes and command-line switches and options, see "Sendmail replacement program reference" next.

Sendmail replacement program reference

This reference section lists all the available command-line arguments that the Messaging Server 3.0 sendmail replacement program recognizes. It also describes the behavior to expect when they are used. Certain options are recognized (through the -o command-line switch); their effects are noted in a separate table.

Alternate names for sendmail

The Unix sendmail program can be run under several names as a shorthand way to specify the action to perform. The Messaging Server 3.0 sendmail replacement program recognizes several alternate names. The behavior that results from invoking the sendmail replacement with one of the alternate names
is summarized in Table B.1.

Invoking sendmail with alternate names

Name Default behavior
sendmail Sends a single mail message.
newaliases Prints an error message because the aliases file is not used.
mailq Reports the contents of the mail queue.
smtpd Runs the Messaging Server daemon.
bsmtp Prints an error message because batch SMTP is not supported.

Note

The behavior listed in Table B.1 will result if no other behavior is specified using a command-line option such as -b or -I.

Command-line switches are processed using getopt(3) as in V8 sendmail. All of the switches supported by V8 sendmail, IDA sendmail, and other versions of sendmail are recognized; the extent of support for these switches is given in Table B.2.

Command-line switches

Switch Impact on Behavior
-B If set to 7 bit, the high bit is stripped from every byte of the input message.
-b Changes the mode of operation.

The following modes are supported:

-be Starts the Messaging Server mail system.

-bm Sends a single mail message.

-bp Shows the status of the mail queue.

These modes are recognized but not supported:

-ba Uses Arpanet protocols.

-bb Does batch SMPT on standard input.

-bi Initializes the aliases database.

-bs Does SMTP on standard input.

-bt Goes into address-testing mode.

-bz Freezes the configuration.

-C None. There is no configuration file, so this switch is ignored.
-c None. This switch is obsolete.
-d None. This switch is ignored because there is no debug mode.
-e Sets the error reporting mode (see option e in the following table).
-F Sets the full name of the sender. If the user running sendmail isn't root, daemon, UUCP, SMTP, mail, or sendmail, a header is added to the message indicating the actual sender.
-f Sets the email address of the sender. The same precaution is taken as in the -F switch.
-h None. The hop count is determined by counting the number of received headers in the message.
-I Runs as if invoked a s "newaliases," which just prints an informational message.
-i None. This is the default behavior. If sendmail is run interactively, a
single "." (period) will end the message. If it is run noninteractively (for example, through a pipe to standard input), the end-of-file condition determines the end of the message.
-M The entire queue is processed regardless of the specified Message ID.
-m None. This is the default behavior. The sender is never removed from the list of recipients if it is listed as a recipient.
-n None. This switch is not supported.
-o Sets an option. See the next section for a list of supported options.
-p None. This switch is not supported.
-q The deferred message queue is processed. If a time interval is given (as in "sendmail -bd -q30m"), this switch is ignored. If specified as
-qR, -qS, or -qI (as in V8 sendmail), then the behavior is the same as -R, -S, or -M, respectively.
-R Attempts to process the queue for hosts matching the pattern provided (for example, sendmail -Rabc will start delivery of queued messages for all hosts containing the string "abc").
-r Same as -f switch.
-S The entire queue is processed regardless of the specified sender.
-s None. This switch is obsolete.
-T None. This switch is obsolete.
-t Recipients are gathered from both the command line and the message header, and the message is delivered.
-v Output is more verbose when sending mail.
-x None. This is an illegal switch that is recognized only to prevent printing an error message.
-Z None. There is no frozen configuration file (or even a regular configuration file).

Options for sendmail

The Netscape Messaging Server sendmail replacement doesn't need a configuration file (sendmail.cf), yet most of Unix sendmail's options can be set from the command line. Many of the options are meant for the sendmail daemon, but some of them are relevant to the normal operation of sending mail.

All the options supported by V8 sendmail are recognized, and the extent of the support for these options is shown in Table B.3. The options listed in Table B.3 refer only to the replacement sendmail program, not to Netscape Messaging Server as a whole. Many of the options not supported by the sendmail replacement are supported by the Messaging Server in one way or another. Refer to the relevant sections of this guide to determine how to set parameters within the Messaging Server.

Options supported by V8 sendmail

Option Impact on Behavior
7 If set, the high bit is stripped from every byte of the input message. Also see the -B command-line switch.
B This is always set to "." (period) and cannot be changed.
d None. Because messages are always just posted to the local SMTP server, the turn-around time is fairly quick, so the "i" or interactive mode, is always used. However, support for other delivery modes may be added in the future.
e Changes the error-reporting mode. Valid modes are e, m, p, q, and w. The behavior for each mode is the same as sendmail. However, if the local SMTP server is unavailable for some reason and mode m is chosen, the error message will not be deliverable either. In this case, the message is saved in the sender's ~/dead.letter file.
f None. When a "From:" line is received, it is changed to "X-Unix-From:" so that it will be RFC822 compliant.
i None. See the -i command-line switch for details.
o None. This is the default behavior and cannot be disabled.
v Turns on verbose output. Also see the -v command-line switch.
Others No other options have any effect. All other options, even invalid ones, are ignored.

[Previous][Next][Contents][Index]

For the latest technical information on Sun-Netscape Alliance products, go to: http://developer.iplanet.com

For more Internet development resources, try Netscape TechSearch.


Copyright © 1999 Netscape Communications Corporation.
This site powered by: Netscape Enterprise Server and Netscape Compass Server.