The -bs command-line switch causes sendmail to run a single SMTP session in the foreground over its standard input and output, and then exit. The SMTP session is exactly like a network SMTP session. Usually, one or more messages are submitted to sendmail for delivery. This mode is intended for use at sites that wish to run sendmail with the inetd (8) daemon. To implement this, place an entry such as the following in your inetd.conf (5) file, then restart inetd (8) by killing it with a SIGHUP signal: smtp stream tcp nowait root /usr/sbin/sendmail sendmail -bs With this scheme it is important to either use cron (3) to run sendmail periodically to process its queue: [8]
0 * * * * /usr/sbin/sendmail -q or run sendmail in the background to process the queue periodically by specifying an interval to the -q command-line switch's interval (Section 11.8.1): /usr/sbin/sendmail -q1h There are advantages and disadvantages to using inetd (8) instead of the -bd daemon mode to listen for and process incoming SMTP messages. The advantages are the following:
The disadvantages are the following:
In general, the inetd (8) approach should be used only on lightly loaded machines that receive few SMTP connections. The -bs switch is also useful for MUAs that prefer to use SMTP rather than a pipe to transfer a mail message to sendmail . Depending on how it is configured, mh (1) can use this feature. |