Name

-bs

Synopsis

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:

  • At security-conscious sites, sendmail can be hidden behind a tcpd(8) or miscd(8) wrapper that can selectively accept or reject connections. (But see TCPWRAPPERS in TCPWRAPPERS for a way to include this support directly inside sendmail.)

  • At hosts that receive few incoming mail messages, this mode avoids the need to run a daemon.

The disadvantages are the following:

  • At sites that receive many incoming mail messages, this mode causes a new ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.