home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

DeliveryMode

Set delivery mode All versions

sendmail can use four modes for delivering mail. Three have always been a part of sendmail: background, interactive, and queue-only. The deferred mode has been added under V8.7 and later sendmail.

The mode is selected with the DeliveryMode option:

O DeliveryMode=mode             configuration file (V8.7 and later) 
-ODeliveryMode=mode             command line (V8.7 and later) 
define(`confDELIVERY_MODE',mode)    mc configuration (V8.7 and later) 
Odmode                          configuration file (deprecated) 
-odmode                         command line (deprecated) 

The mode argument is of type character. It is case-sensitive (must be lowercase) and is selected from one of the keywords shown in Table 24-16. Only the first letter of each is recognized, but we recommend full words for improved clarity.

Table 24-16. DeliveryMode option keywords

Keyword

§

Description

background

See this section

Background (asynchronous) delivery

deferred

See this section

Deferred (held as is) delivery (V8.7 and later)

interactive

See this section

Interactive (synchronous) delivery

queueonly

See this section

Queued (held but processed) delivery

If the mode argument is missing, this option defaults to the i or interactive mode. If the entire DeliveryMode option is missing, V8 sendmail defaults to background mode, but old sendmail behaves unpredictably; consequently, this option should be considered mandatory. The default for the mc configuration is also background.

If the mode character is anything other than the first lowercase letter of one of the keywords shown in Table 24-16, sendmail will print and log the following error and will immediately exit with an exit value of EX_USAGE as defined in <sysexits.h>:

Unknown delivery mode char

Prior to V8.12, queue-only and deferred modes were available only if QUEUE was defined when sendmail was compiled (QUEUE). If QUEUE was not defined and one of these two modes was selected, sendmail would print and log the following:

need QUEUE to set -odqueue or -oddefer

Beginning with V8.12, the QUEUE Build macro has been removed, and the various queue-related modes are always available.

The DeliveryMode option is safe. Even if it is specified from the command line, sendmail retains its special privileges.

DeliveryMode=background

Background mode—intended primarily[20] for use in the configuration file—allows sendmail to run asynchronously. This means that once sendmail has gathered the entire message and verified that the recipient is deliverable, it will fork(3) a copy of itself and exit. The copy, running in the background (asynchronously), will then handle the delivery. From the user's point of view, this mode allows the mail interface program to act as though it sent the message nearly instantaneously.

[20] A sending program (MUA) might need to use background mode on the command line if the message is urgent and if the default in sendmail's configuration file is to queue all messages (with q mode).

DeliveryMode=deferred

Deferred mode—for use in either the command line or the configuration file—is much like queue-only mode except that all database lookups, including DNS, are deferred until the actual queue run. Deferred mode (V8.7 and later) is preferred for dial-on-demand sites (typically, modem-based SL/IP or PPP connections). Just as in queue-only mode, all mail is queued for later delivery, but with deferred mode, code inside sendmail that would ordinarily interact with DNS is suppressed. This prevents the modem from being dialed and connections from being established every time mail is queued.

See also the -D database-map switch (-D), and the DialDelay option (DialDelay).

DeliveryMode=interactive

Interactive mode—intended for use from the command line—causes sendmail to run synchronously. This mode is useful primarily for debugging mail problems. Instead of going into the background with fork(3), it runs in the foreground (synchronously). In this mode, error messages are printed back to the controlling terminal rather than being mailed to the user as bounced mail. The -v command-line switch (-v) automatically sets the mode to interactive.

DeliveryMode=queueonly

Queue-only mode—for use in either the command line or the configuration file—causes sendmail to synchronously queue mail. Queue-only mode is useful at sites that have huge amounts of UUCP mail or Usenet news batch feeds, or when delivering to low-priority addresses such as mailing lists. Queuing has the beneficial effect of serializing delivery through queue runs, and it reduces the load on a machine that many parallel backgrounded sendmail processes can cause. Queue-only mode is typically supplied as a command-line option to sendmail by the uuxqt(8) program. When queue-only mode is selected, all mail is queued for delivery, and none is actually delivered. A separate run of sendmail with its -q command-line switch (Section 11.8.1) is needed to actually process the queue. Note that addresses can still be looked up with DNS as a part of the queueing process. Consequently, queue-only mode is probably not suitable for dial-on-demand sites.

    Previous Section Next Section