![]() |
This appendix discusses post.office's compatibility with sendmail:
|
SENDMAIL COMPATIBILITY |
This appendix is directed towards system administrators who are thinking about or have made the switch from sendmail to post.office.
The first section discusses the replacement sendmail program provided with post.office for compatibility with UNIX systems. The second section is a comprehensive list of command-line switches and configuration options is included along with their effects on post.office behavior.
We intend to keep this compatibility section current. However it is possible that new functionality will be added to post.office that makes it more compatible with sendmail than is noted here. If you find that you require some missing functionality, let us know so we can schedule it for a future release.
This section discusses the compatibility between sendmail and post.office:
First the functional compatibility section discusses how things you can do with sendmail are done with post.office.
Following, the command-line compatibility of the replacement sendmail program is outlined.
The sendmail program can be configured to exchange mail with remote destinations using SMTP. Routing of mail is achieved with rule sets containing address production rules which are written in a specialized programming language used to rip apart addresses and put them back together in useful ways. While this is a very powerful facility, it is error-prone and requires extensive knowledge of Internet standards to be set up correctly.
In contrast, post.office comes with a pre-configured SMTP channel for interacting with other machines on the Internet. It works off-the-shelf, so you don't have to become an expert just to send and receive mail. If you have any special routing requirements, post.office provides channel aliases and a mail routing table which should cover those needs. They are easy to set up (refer to operations chapters for details regarding these features). The following two sections describe mail flow through the SMTP channel of post.office.
Incoming mail is received by the SMTP-Accept module of post.office. 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 decide how to route the message to its destination.
Any message that the SMTP-Router decides needs to be delivered using SMTP to a remote site is given 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).
The sendmail program supports several types of aliases in the /etc/aliases file and users' personal .forward files. The various types of aliases allow:
With post.office each type of alias is created differently. This is due to the structure of user accounts in the account database. The use of accounts and aliases is discussed at length in chapter 4.
Using sendmail, it is possible to 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 are used to filter messages into different mailboxes, or to 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. post.office program delivery is set up using the account form.
Because there are security issues specific to program delivery, program delivery is disabled by default. For a discussion of the security issues and instructions on how to enable program delivery, refer to appendix G.
The sendmail program 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 it (by sending it to /dev/null). However, the author of sendmail recommends using an alternate delivery agent for delivery-to-file needs, invoked via the delivery-to-program facility.
The sendmail replacement that comes with post.office will append undeliverable messages to users' dead.letter files. No general delivery-to-file facility is planned for post.office; appending mail to a file should be done with the delivery-to-program facility.
Mailing lists in 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 the recipient distribution list(s), while sendmail handles the delivery of the messages.
post.office has "hooks" to handle mailing lists. Delivering messages to a list of recipients is something post.office does well. However there are some other special requirements of mailing list exploders that are not yet implemented. Also, Automating the administration tasks is an interesting and difficult problem to solve. (There are many deficiencies in currently available mailing list administration programs that we are in the process of reviewing.) As with the rest of post.office, we will insure that mailing lists are as easy to set up and maintain as normal accounts.
The post.office mail system includes a program which replaces /usr/lib/sendmail on UNIX machines. Most of sendmail's functionality is performed by one or more modules in post.office as noted above, so the sendmail replacement actually has limited use. However, it is needed for compatibility with many mail programs that employ sendmail to deliver their mail, rather than using SMTP. It can also be used to start up the post.office mail system, and check and deliver the mail queue.
Probably the most important reason to have a replacement sendmail program is to maintain 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 left up to sendmail 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 the reference section below (F.2).
Since 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 like:
/usr/lib/sendmail -bd -q30m
The sendmail replacement provided with post.office recognizes this and starts up post.office if it is not already running. The -q30m switch is ignored in this command since queue intervals are set up in the system configuration of post.office.
Many system administrators are used to typing 'mailq' to check for queued messages. The sendmail replacement provided with post.office will respond to this command with the contents of the mail queue.
However, many users prefer to use the post.office mail queue form, which makes processing the queue a little easier.
The sendmail program has several other operating modes which are not necessary or are not supported in post.office. For a complete list of supported operating modes, command-line switches and options, see the reference section below.
This reference section lists all the available command-line arguments the sendmail replacement program recognizes, along with the behavior that can be expected when they are used. Certain options are recognized (via the -o command-line switch) and their effects are noted in a separate table.
The sendmail program can be run under several names as a shorthand way to specify the action to perform. The 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 the following table.
Name | Default Behavior |
---|---|
sendmail | Send a single mail message |
newaliases | Prints an error message since the aliases file is not used |
mailq | Report the contents of the mail queue |
smtpd | Run the post.office daemon |
bsmtp | Prints an error message since batch SMTP is not supported |
Table F.1 Alternate Behavior of sendmail Replacement
It is important to note that the behavior listed in the above table is the behavior that 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, and the extent of support for these switches is given in the following table.
Switch | Impact on Behavior |
---|---|
-B | If set to 7bit, the high bit is stripped from every byte of the input message |
-b | Changes the mode of operation.
The following modes are supported:
These modes are recognized but not supported:
|
-C | None. There is no configuration file, so this switch is ignored. |
-c | None. This switch is obsolete. |
-d | None. This switch is ignored since there is no debug mode. |
-e | Sets the error reporting mode (see option 'e' below). |
-F | Sets the full name of the sender. If the user running sendmail is not either root, daemon, uucp, smtp, mail, or sendmail, then a header is added to the message indicating the actual sender. |
-f | Sets the E-mail address of the sender. The same precaution is taken as in the -F switch above. |
-h | None. The hop count is determined by counting the number Received headers in the message. |
-I | Runs as if invoked as 'newaliases' which just prints an informational message. |
-i | None. This is the default behavior. If sendmail is interactively, a single '.' will end the message. If it is non-interactively, e.g. via a pipe to standard input, then 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 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 given (as in 'sendmail -bd -q30m') then this switch is ignoredIf specified as -qR, -qS, or -qI (as in V8 sendmail), then behavior is the same as -R, -S, or -M respectively. |
-R | Attempts to process the queue for hosts matching the provided (e.g. sendmail -Rabc will start delivery of queued messages for all hosts containing the string 'abc'). |
-r | Same as -f switch above. |
-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 message header and the message is delivered. |
-v | Output is more verbose when sending mail. |
-x | None. This is an illegal switch which is only recognized prevent printing an error message. |
-Z | None. There is no frozen configuration file or even a regular configuration file for that matter. |
Table F.2 Supported command-line switches
The sendmail replacement provided with post.office does not need a configuration file (sendmail.cf), yet most of 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 of the options supported by V8 sendmail are recognized and the extent of the support for these options is shown below. Note that the options below only refer to the replacement sendmail program, not to post.office as a whole. Many of the options not supported by the sendmail replacement are supported by post.office in one way or another. Refer to the relevant sections of the manual to determine how to set parameters within post.office.
Option | Impact on Behavior |
---|---|
7 | If set, the high bit is stripped from every byte of the message. Also see the -B command-line switch |
B | This is always set to '.' and can not be changed. |
d | Currently none. Since messages are always just posted local SMTP server, the turn-around time is fairly quick so '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 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 "X-UNIX-From:" to be RFC822 compliant. |
i | None. See the -i command-line switch for details. |
o | None. This is the default behavior and can not 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 silently ignored. |
Table F.3 sendmail options as they are supported and affect the post.office sendmail program.