contents
Next: If You Don't Get Up: Setup for a LAN Previous: Writing the Configuration Files

Running smail

First, you have to decide whether to run smail as a separate daemon, or whether to have inetd manage the SMTP port and invoke smail only whenever an SMTP connection is requested from some client. Usually, you will prefer daemon operation on the mail server, because this loads the machine far less than spawning smail over and over again for each single connection. As the mail server also delivers most incoming mail directly to the users, you will choose inetd operation on most other hosts.

Whatever mode of operation you choose for each individual host, you have to make sure you have the following entry in your /etc/services file:

           smtp            25/tcp          # Simple Mail Transfer Protocol
This defines the TCP port number that smail should use for SMTP conversations. 25 is the standard defined by the Assigned Numbers RFC.

When run in daemon mode, smail will put itself in the background, and wait for a connection to occur on the SMTP port. When a connection occurs, it forks and conducts an SMTP conversation with the peer process. The smail daemon is usually started by invoking it from the rc.inet2 script using the following command:

           /usr/local/bin/smail -bd -q15m
The -bd flag turns on daemon mode, and -q15m makes it process whatever messages have accumulated in the message queue every 15 minutes.

If you want to use inetd instead, your /etc/inetd.conf file should contain a line like this:

           smtp    stream  tcp nowait  root  /usr/sbin/smtpd smtpd
 
smtpd should be a symbolic link to the smail binary. Remember you have to make inetd re-read inetd.conf by sending it a HUP signal after making these changes.

Daemon mode and inetd mode are mutually exclusive. If you run smail in daemon mode, you should make sure to comment out any line in inetd.conf for the smtp service. Equivalently, when having inetd manage smail, make sure that rc.inet2 does not start the smail daemon.


contents
Next: If You Don't Get Up: Setup for a LAN Previous: Writing the Configuration Files

Andrew Anderson
Thu Mar 7 23:22:06 EST 1996